Changeset 622
- Timestamp:
- 02/11/2011 06:36:22 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
nikto.pl (modified) (2 diffs)
-
plugins/nikto_core.plugin (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/nikto.pl
r616 r622 2 2 use strict; 3 3 4 #VERSION,2.1. 34 #VERSION,2.1.4 5 5 # $Id$ 6 6 use Getopt::Long; … … 48 48 $VARIABLES{'DIV'} = "-" x 75; 49 49 $VARIABLES{'name'} = "Nikto"; 50 $VARIABLES{'version'} = "2.1. 3";50 $VARIABLES{'version'} = "2.1.4"; 51 51 $VARIABLES{'configfile'} = "/etc/nikto.conf"; ### Change if it's having trouble finding it 52 52 -
trunk/plugins/nikto_core.plugin
r621 r622 1012 1012 my ($file) = @_; 1013 1013 my (@results, $hostdesc); 1014 my $nmap= 0;1015 1014 my ($nmap, $lineno) = 0; 1015 1016 1016 open(IN, $file) || die print STDERR "+ ERROR: Cannot open '$file':$@\n"; 1017 1017 while (<IN>) { 1018 1018 my $found = 0; 1019 $lineno++; 1019 1020 1020 1021 # Check whether this is a greppable nmap file 1021 1022 chomp; 1023 #nprint("\nParsing line $lineno: $_", "d"); 1022 1024 $nmap = 1 if (/^# Nmap/); 1023 1025 s/\#.*$//; … … 1028 1030 if (($_ !~ /Host/) || ($_ !~ /Ports/) || ($_ !~ /open/) || ($_ !~ /(?:http|ssl)/i)) { next; } 1029 1031 1032 # parse out the line 1033 my @fields = split("\t", $_); 1034 1030 1035 # Get the host name 1031 my @line = split(/ /); 1032 $_ =~ /\(([^\)]+)/; 1033 $hostdesc = ($1 ne "") ? $1 : $line[1]; 1036 $fields[0] =~ /Host:\s+([\d\.]+)\s+\(([^\)]+)?\)/; 1037 $hostdesc = ($2 ne "") ? $2 : $1; 1034 1038 1035 1039 # Parse the ports list from: 1036 1040 # Host: 1.0.0.0 () Ports: 80/open/tcp//http///, 8000/open/tcp//http-alt/// 1037 for (my $i = 3 ; $i <= $#line ; $i++) { 1038 if (($line[$i] !~ /open\/tcp/) || ($line[$i] !~ /http/)) { next; } 1039 $line[$i] =~ /^(\d+)\//; 1041 $fields[1]=~s/^Ports: //; 1042 my @ports = parse_csv($fields[1]); 1043 foreach my $nmp (@ports) { 1044 if (($nmp !~ /(?:80|443)?\/open\/tcp/) || ($nmp !~ /(?:http|ssl)/i)) { 1045 nprint("\tNon web port identified on line $lineno: $hostdesc port: $nmp","d"); 1046 next; 1047 } 1048 $nmp =~ /^(?:\s+)?(\d+)\//; 1049 nprint("\tWeb port identified on line $lineno: $hostdesc port $1 ","d"); 1040 1050 push(@results, $hostdesc . ":" . $1); 1041 }1051 } 1042 1052 } 1043 1053 else {
Note: See TracChangeset
for help on using the changeset viewer.