Net-Nessus-ScanLite

 view release on metacpan or  search on metacpan

lib/Net/Nessus/ScanLite.pm  view on Meta::CPAN

                port            => 1241,
                user            => undef,
                password        => undef,
                ssl_version     => 'TLSv1',
                timeout         => 1,
		ssl		=> 1,
		debug		=> 1,
                _cfg            => undef,
                _section        => 'nessus',
		_duration	=> 0,
                _prefsect	=> 'preferences',
		_defsection	=> 'defaults',
                _holes          => [],
                _info           => [],
                preferences     => {},

        },$class;
	# Handle ini config handle or path
	if( $args{Cfg} )
		{
		$self->cfg($args{Cfg});

lib/Net/Nessus/ScanLite.pm  view on Meta::CPAN

                {
                foreach( $cfg->Parameters($section)  )
                        {
                        $hash->{$_} = $cfg->val($section,$_);
                        }
                }
        }
sub pref_section
        {
        my $this = shift;
        my $key = '_prefsect';
        $this->{$key} = shift if( @_ );
        return($this->{$key});
        }
sub ini_default
        {
        my $this = shift;
        my $key = '_defsection';
        $this->{$key} = shift if( @_ );
        return($this->{$key});
        }

lib/Net/Nessus/ScanLite.pm  view on Meta::CPAN

        $ssl->print( "CLIENT <|> NESSUS_VERSION  <|> CLIENT\n");
        $r = join(' ',$ssl->getline);
        chomp($r);
        if( $r =~ /Bad login/gis )
                {
                $this->set_error(1,"Bad login ".  $this->user);
                return(0);
                }
        return(1);
        }
sub setprefs
        {
        my $this = shift;
        my $p = "CLIENT <|> PREFERENCES <|>\n";
        $this->socket->flush;
        my $h = $this->preferences;
        foreach( sort keys %$h )
                { $p .= sprintf("%s <|> %s\n",$_,$h->{$_}); }
        $p .= " <|> CLIENT\n";
        $this->socket->print($p);
        my $msg = Net::Nessus::Message->new('socket' => $this->socket,

lib/Net/Nessus/ScanLite.pm  view on Meta::CPAN

        my $this = shift;
        return(sprintf("< NTP/%s >",$this->ntp_version));
        }



sub attack
        {
        my ($this,$host) = @_;
	my $start = time;
        $this->setprefs;
        my @hosts = ( $host );
        my $status = $this->Attack(@hosts);
	$this->duration(time - $start);
        }
sub user
        {
        my $this = shift;
        my $key = 'user';
        $this->{$key} = shift if( @_ );
        return($this->{$key});



( run in 0.806 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )