Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse::Nessus::NBE

Status
Not open for further replies.

macubergeek

IS-IT--Management
Dec 29, 2004
41
US
Hi all
I'm trying to write a script using the above perl module and am having difficulties. I'm trying to read a file "combined.nbe" into array @mynessusdata then parse it using this perl module.
----------------my code-------------------
#!/usr/bin/perl

open(DAT, "/Users/jamesk/Desktop/combined.nbe") || die("Could not open file!");
my @nessusdata=<DAT>;
close DAT;
my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;
----------------/my code------------------
I'm getting:
Undefined subroutine &main::nports called at ./testme3 line 7.

I was hoping someone could point out where I've screwed this up. The perl docs for this module has this:

To query by port

my $port = 80;
my @ports = nports(@nessusdata,$port);
print @ports;

# returns
IP|specified port

# example
192.168.0.5|ssh (22/tcp)
192.168.0.6|ssh (22/tcp)
192.168.0.8|ssh (22/tcp)
192.168.0.23|ssh (22/tcp)
192.168.0.89|ssh (22/tcp)
...
 
I don't see a use statement in your code.

use Parse::Nessus::NBE qw(vars or subs from module);

You need this in order to use the module. Take a look at perldoc perlmod.

 
**slapping forehead**
Thanks mikevh so much!! It works fine now and I'll go read perldoc perlmod right away!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top