Changeset 152
- Timestamp:
- 08/13/2009 07:37:44 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
-
docs/CHANGES.txt (modified) (1 diff)
-
plugins/db_tests (modified) (1 diff)
-
plugins/nikto_apache_expect_xss.plugin (modified) (1 diff)
-
plugins/nikto_apacheusers.plugin (modified) (1 diff)
-
plugins/nikto_cgi.plugin (modified) (1 diff)
-
plugins/nikto_core.plugin (modified) (10 diffs)
-
plugins/nikto_dictionary_attack.plugin (modified) (1 diff)
-
plugins/nikto_favicon.plugin (modified) (1 diff)
-
plugins/nikto_headers.plugin (modified) (3 diffs)
-
plugins/nikto_httpoptions.plugin (modified) (3 diffs)
-
plugins/nikto_msgs.plugin (modified) (2 diffs)
-
plugins/nikto_multiple_index.plugin (modified) (1 diff)
-
plugins/nikto_put_del_test.plugin (modified) (2 diffs)
-
plugins/nikto_robots.plugin (modified) (1 diff)
-
plugins/nikto_subdomain.plugin (modified) (1 diff)
-
plugins/nikto_tests.plugin (modified) (1 diff)
-
plugins/nikto_user_enum_apache.plugin (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/CHANGES.txt
r150 r152 1 2009-08-13 plugins/* 2 - Various fixes to use nfetch and fix proxy use 1 3 2009-08-12 plugins/nikto_core 2 4 - New fetch (nfetch) sub added which uses a local request/result hash. -
trunk/plugins/db_tests
r132 r152 3591 3591 "003589","0","b","/cgi-bin/webcgi/about","GET","/cgi/locale/about_en.xsl","","","","","Host seems to be a Dell Remote Access Controller (RAC).","","" 3592 3592 "003590","0","b","/webservices/IlaWebServices","GET","200","","","","","Host has the Oracle iLearning environment installed.","","" 3593 "003591","0","a","/SoundBridgeStatus.html","GET","200","SoundBridge is running software version","","","","Host is running the SoundBridge web server which doesn't support identification.","","" -
trunk/plugins/nikto_apache_expect_xss.plugin
r150 r152 42 42 my ($mark) = @_; 43 43 my %headers=('Expect', '<script>alert(xss)</script>'); 44 (my $RES, $CONTENT) = nfetch( "/", "GET", "", \%headers);44 (my $RES, $CONTENT) = nfetch($mark,"/", "GET", "", \%headers); 45 45 46 46 if ($CONTENT =~ /<script>alert\(xss\)<\/script>/) -
trunk/plugins/nikto_apacheusers.plugin
r150 r152 41 41 { 42 42 my ($mark) = @_; 43 (my $RES, $CONTENT) = nfetch( "/~root", "GET");43 (my $RES, $CONTENT) = nfetch($mark,"/~root", "GET"); 44 44 45 45 $CONTENT = char_escape($CONTENT); 46 46 if ($CONTENT =~ /forbidden/i) # good on "root" 47 47 { 48 (my $RES, $CONTENT) = nfetch( "/~" . LW2::utils_randstr(8), "GET");48 (my $RES, $CONTENT) = nfetch($mark,"/~" . LW2::utils_randstr(8), "GET"); 49 49 50 50 $CONTENT = char_escape($CONTENT); -
trunk/plugins/nikto_cgi.plugin
r150 r152 65 65 foreach $possiblecgidir (@CFGCGI) 66 66 { 67 ($res, $CONTENT)=nfetch($ possiblecgidir,"GET");67 ($res, $CONTENT)=nfetch($mark,$possiblecgidir,"GET"); 68 68 nprint("Checked for CGI dir\t$possiblecgidir\tgot:$res","d"); 69 69 if (content_present($res) eq TRUE) -
trunk/plugins/nikto_core.plugin
r151 r152 1107 1107 { 1108 1108 my ($mark) = @_; 1109 my %headers; 1109 1110 1110 (my $ RES, $CONTENT) = fetch("/","HEAD");1111 1112 return $ result{'server'};1111 (my $res, $content) = nfetch($mark,"/","GET","",\%headers); 1112 1113 return $headers{server}; 1113 1114 } 1114 1115 ############################################################################### 1115 1116 sub port_check 1116 1117 { 1117 my ($ip, $port) = @_; 1118 my %request; 1119 1120 LW2::http_init_request(\%request); 1121 $request{'User-Agent'} = $NIKTO{useragent}; 1122 $request{'whisker'}->{'retry'} = 0; 1123 $request{'whisker'}->{'uri'}="/"; 1118 my ($hostname, $ip, $port) = @_; 1119 my %mark, %headers; 1120 1121 $mark{hostname}=$hostname; 1122 $mark{ip}=$ip; 1123 $mark{port}=$port; 1124 $mark{ssl}=0; 1125 1126 if (defined $CLI{vhost}) { $mark{vhost} = $CLI{vhost} }; 1124 1127 1125 1128 # test for proxy 1126 1129 proxy_check() unless $PROXYCHECKED; 1130 setup_hash(\%request,\%mark); 1127 1131 1128 1132 my @checktypes=('HTTP', 'HTTPS'); … … 1136 1140 { 1137 1141 nprint("- Checking for $checkssl on port $ip:$port, using $method","v"); 1138 $request{'whisker'}->{'host'} = $ip; 1139 $request{'whisker'}->{'ssl'}=($checkssl eq "HTTP")?0:1; 1140 $request{'whisker'}->{'port'}= $port; 1141 $request{'whisker'}->{'http_eol'}=$http_eol; 1142 dump_var("Request Hash", \%request); 1143 LW2::http_close(\%request); # force-close any old connections 1144 LW2::http_fixup_request(\%request); 1145 if ($CLI{pause} > 0) { sleep $CLI{pause}; } 1146 1147 my $res=LW2::http_do_request_timeout(\%request,\%result); 1148 if (!$res) 1142 1143 $mark{ssl}=($checkssl eq "HTTP")?0:1; 1144 my ($res, $content)=nfetch(\%mark, "/", $method, "", \%headers); 1145 1146 if ($res) 1149 1147 { 1150 1148 # this will fix for some Apaches that are smart enough to answer non ssl reqs on an ssl server 1151 if (defined $result{'whisker'}{'data'} && $result{'whisker'}->{'data'} =~ /speaking plain HTTP to an SSL/) 1149 if (defined $content && 1150 $content =~ /speaking plain HTTP to an SSL/) 1152 1151 { 1153 1152 dump_var("Result Hash", \%result); 1154 1153 next; 1155 1154 } 1156 nprint("- $checkssl Server found: $ip:$port \t$result{'server'}","d"); 1157 dump_var("Result Hash", \%result); 1158 return $request{'whisker'}->{'ssl'}+1; 1159 } 1160 else 1161 { 1162 dump_var("Result Hash", \%result); 1155 nprint("- $checkssl Server found: $ip:$port \t$headers{server}","d"); 1156 return $mark{ssl}+1; 1163 1157 } 1164 1158 } … … 1536 1530 my $uridir=$request{whisker}->{uri}; 1537 1531 $uridir =~ s#/[^/]*$#/#g; 1538 add_vulnerability($mark,"Blank credentials found at $uridir , $REALMS{$REALM}{realm}: $REALMS{$REALM}{msg}", $REALMS{$REALM}{tid},0,"GET",$uridir,\%result);1532 add_vulnerability($mark,"Blank credentials found at $uridir ($request{whisker}->{uri}), $REALMS{$REALM}{realm}: $REALMS{$REALM}{msg}", $REALMS{$REALM}{tid},0,"GET",$uridir,\%result); 1539 1533 } 1540 1534 else … … 1565 1559 my $uridir=$request{whisker}->{uri}; 1566 1560 $uridir =~ s#/[^/]*$#/#g; 1567 add_vulnerability($mark,"Default account found for '$realm' at $uridir ( ID '$REALMS{$REALM}{id}', PW '$REALMS{$REALM}{pw}'). $REALMS{$REALM}{msg}",$REALMS{$REALM}{tid},0,"GET",$uridir,\%result);1561 add_vulnerability($mark,"Default account found for '$realm' at $uridir ($request{whisker}->{uri}) (ID '$REALMS{$REALM}{id}', PW '$REALMS{$REALM}{pw}'). $REALMS{$REALM}{msg}",$REALMS{$REALM}{tid},0,"GET",$uridir,\%result); 1568 1562 $REALMS{$REALM}{checked}=1; 1569 1563 } … … 1682 1676 sub proxy_check 1683 1677 { 1684 $request{'whisker'}->{'method'}=" HEAD";1678 $request{'whisker'}->{'method'}="GET"; 1685 1679 $request{'whisker'}->{'uri'}="/"; 1680 $request{'whisker'}->{host}="www.cirt.net"; 1686 1681 1687 1682 if (defined $request{'whisker'}->{'proxy_host'}) # proxy is set up … … 1871 1866 sub setup_hash 1872 1867 { 1873 my ($reqhash ) = @_;1868 my ($reqhash,$mark) = @_; 1874 1869 1875 1870 # Do the standard set up for the hash … … 1884 1879 $reqhash->{User-Agent}=$NIKTO{useragent}; 1885 1880 $reqhash->{whisker}->{retry}=0; 1886 1881 $reqhash->{whisker}->{host} = $mark->{hostname} || $mark->{ip}; 1882 if ($mark->{vhost}) 1883 { 1884 $request{Host} = $mark->{vhost}; 1885 } 1886 $request->{whisker}->{port} = $mark->{port}; 1887 $request->{whisker}->{ssl} = $mark->{ssl}; 1888 1889 # Proxy stuff 1890 if ($PROXYCHECKED && defined $NIKTOCONFIG{PROXYHOST} && 1891 defined $CLI{useproxy}) 1892 { 1893 $reqhash->{'whisker'}->{'proxy_host'}=$NIKTOCONFIG{PROXYHOST}; 1894 $reqhash->{'whisker'}->{'proxy_port'}=$NIKTOCONFIG{PROXYPORT}; 1895 LW2::auth_set("proxy-basic",$reqhash,$NIKTOCONFIG{PROXYUSER}, 1896 $NIKTOCONFIG{PROXYPASS}); # set auth 1897 } 1898 1887 1899 return $reqhash; 1888 1900 } … … 1890 1902 sub nfetch 1891 1903 { 1892 my ($ uri, $method, $data, $headers, $noclean) = @_;1904 my ($mark, $uri, $method, $data, $headers, $noclean) = @_; 1893 1905 if ($CLI{pause} > 0) { sleep $CLI{pause}; } 1894 1906 1895 1907 my %request, %result; 1896 setup_hash(\%request );1908 setup_hash(\%request, $mark); 1897 1909 1898 1910 $request{whisker}->{uri} = $uri; … … 1925 1937 # Cache 1926 1938 if (defined $CACHE{$uri} && !defined $CLI{nocache} && 1927 $CACHE{$uri}{method} eq $method)1939 $CACHE{$uri}{method} eq $method && $CACHE{$uri}{mark} eq $mark) 1928 1940 { 1929 1941 # Get from cache 1930 nprint("- Retrieving $ request{whisker}->{uri}from cache.","v");1931 $result{whisker}->{code}=$CACHE{$ request{whisker}->{uri}}{res};1932 $result{whisker}->{data}=$CACHE{$ request{whisker}->{uri}}{content};1942 nprint("- Retrieving $uri from cache.","v"); 1943 $result{whisker}->{code}=$CACHE{$uri}{res}; 1944 $result{whisker}->{data}=$CACHE{$uri}{content}; 1933 1945 } 1934 1946 else … … 1938 1950 unless (defined $CLI{nocache}) 1939 1951 { 1940 $CACHE{$request{whisker}->{uri}}{method}=$result{whisker}->{method}; 1941 $CACHE{$request{whisker}->{uri}}{res}=$result{whisker}->{code}; 1942 $CACHE{$request{whisker}->{uri}}{content}=$result{whisker}->{data}; 1952 $CACHE{$uri}{method}=$result{whisker}->{method}; 1953 $CACHE{$uri}{res}=$result{whisker}->{code}; 1954 $CACHE{$uri}{content}=$result{whisker}->{data}; 1955 $CACHE{$uri}{mark}=$mark; 1943 1956 } 1944 1957 if ($OUTPUT{debug}) -
trunk/plugins/nikto_dictionary_attack.plugin
r150 r152 65 65 my $dir=$_; 66 66 if (($ctr % 100) == 0) { nprint("- Directory enumeration guess $ctr ($dir): /$dir/", "v"); } 67 (my $result, $content) = nfetch( "/$dir/", "HEAD");67 (my $result, $content) = nfetch($mark,"/$dir/", "HEAD"); 68 68 foreach my $found (split(/ /, $VARIABLES{"\@HTTPFOUND"})) 69 69 { -
trunk/plugins/nikto_favicon.plugin
r150 r152 41 41 { 42 42 my ($mark)=@_; 43 my ($RES, $CONTENT) = nfetch( "/favicon.ico","GET");43 my ($RES, $CONTENT) = nfetch($mark,"/favicon.ico","GET"); 44 44 my $dbarray = initialise_db("db_favicon"); 45 45 -
trunk/plugins/nikto_headers.plugin
r151 r152 52 52 foreach my $f (qw/\/index.php \/junk999.php \/ \/index.php3 \/ \/junk999.php3 \/index.cfm \/junk999.cfm \/index.asp \/junk999.asp \/index.aspx \/junk988.aspx/ ) 53 53 { 54 (my $RES, $CONTENT) = nfetch($ f, "GET", "", \%headers);54 (my $RES, $CONTENT) = nfetch($mark,$f, "GET", "", \%headers); 55 55 if (defined $headers{x-powered-by}) { $xpb{ $headers{x-powered-by} } = 1; } 56 56 } … … 147 147 148 148 # First let's hit something we know should return something 149 my ($res, $content)=nfetch( "/","GET","",\%headers);149 my ($res, $content)=nfetch($mark,"/","GET","",\%headers); 150 150 151 151 foreach my $header (@interesting_headers) … … 189 189 foreach my $f (qw/\/index.html \/index.htm \/robots.txt/) 190 190 { 191 (my $RES, $CONTENT) = nfetch($ f, "GET","", \%headers);191 (my $RES, $CONTENT) = nfetch($mark,$f, "GET","", \%headers); 192 192 } 193 193 -
trunk/plugins/nikto_httpoptions.plugin
r150 r152 79 79 # IIS Debug 80 80 81 ($RES, $CONTENT) = nfetch( "/","DEBUG",);81 ($RES, $CONTENT) = nfetch($mark,"/","DEBUG",); 82 82 if ($RES == 200) 83 83 { … … 89 89 "Content-Length" => "0", 90 90 ); 91 ($RES, $CONTENT) = nfetch( "/","PROPFIND","",\%headers,1);91 ($RES, $CONTENT) = nfetch($mark,"/","PROPFIND","",\%headers,1); 92 92 if ($RES == 207) 93 93 { … … 111 111 { 112 112 $request{whisker}{version} = $version; 113 ($RES, $CONTENT) = nfetch( "/","$method","",\%headers);113 ($RES, $CONTENT) = nfetch($mark,"/","$method","",\%headers); 114 114 if ($RES == 200) 115 115 { -
trunk/plugins/nikto_msgs.plugin
r150 r152 63 63 if ($mark->{banner} =~ /(Agent-ListenServer-HttpSvr\/1\.0)\b/i) 64 64 { 65 my ($RES, $CONTENT) = nfetch( "/","GET");65 my ($RES, $CONTENT) = nfetch($mark,"/","GET"); 66 66 next unless ($RES == 200); 67 67 # Computer name … … 75 75 if ($mark->{banner} =~ /(CompaqHTTPServer)/i) 76 76 { 77 my ($RES, $CONTENT) = nfetch( "/cpqlogin.htm","GET");77 my ($RES, $CONTENT) = nfetch($mark,"/cpqlogin.htm","GET"); 78 78 next unless ($RES == 200); 79 79 my $ipaddrs=""; -
trunk/plugins/nikto_multiple_index.plugin
r150 r152 46 46 # Use fetch to minimise extra code 47 47 # First we need to mangle the host. 48 my ($res, $content) = nfetch( "/$item->{index}", "GET");48 my ($res, $content) = nfetch($mark,"/$item->{index}", "GET"); 49 49 50 50 if (($res == 200) || ($res == 302)) -
trunk/plugins/nikto_put_del_test.plugin
r150 r152 45 45 # PUT a page 46 46 my $uri = "/nikto-test-" . LW2::utils_randstr(8) . ".html"; 47 (my $RES, $CONTENT) = nfetch($ uri, "PUT", "This was a Nikto test.");47 (my $RES, $CONTENT) = nfetch($mark,$uri, "PUT", "This was a Nikto test."); 48 48 49 49 # Request it back 50 50 if ($RES eq 201) 51 51 { 52 (my $RES, $CONTENT) = nfetch($ uri, "GET");52 (my $RES, $CONTENT) = nfetch($mark,$uri, "GET"); 53 53 if ($CONTENT =~ /This was a Nikto test/) 54 54 { … … 56 56 57 57 # we were able to put it there--can we delete it? 58 (my $RES, $CONTENT) = nfetch($ uri, "DELETE");58 (my $RES, $CONTENT) = nfetch($mark,$uri, "DELETE"); 59 59 if ($RES eq 200) 60 60 { 61 (my $RES, $CONTENT) = nfetch($ uri, "GET");61 (my $RES, $CONTENT) = nfetch($mark,$uri, "GET"); 62 62 if ($CONTENT !~ /This was a Nikto test/) # gone now 63 63 { -
trunk/plugins/nikto_robots.plugin
r150 r152 42 42 { 43 43 my ($mark) = @_; 44 (my $RES, $CONTENT) = nfetch( "/robots.txt", "GET");44 (my $RES, $CONTENT) = nfetch($mark,"/robots.txt", "GET"); 45 45 46 46 if (($RES eq 200) || ($RES eq $FoF{okay}{response})) # got one! -
trunk/plugins/nikto_subdomain.plugin
r150 r152 64 64 my $newhost=$item->{subdomain} . "." . $host; 65 65 $request{whisker}{host} = $newhost; 66 my ($res, $content) = nfetch( "/", "HEAD");66 my ($res, $content) = nfetch($mark,"/", "HEAD"); 67 67 68 68 if (($res == 200) || ($res == 302)) -
trunk/plugins/nikto_tests.plugin
r150 r152 55 55 (my $RES, $CONTENT) = fetch($uri,$TESTS{$CHECKID}{method},$TESTS{$CHECKID}{data}); 56 56 nprint("- $RES for $TESTS{$CHECKID}{method}:\t$request{whisker}{uri}","v"); 57 # Check for errors to reduce false positives58 if (defined $result{whisker}{error})59 {60 # An error occured, show in verbose mode and skip61 nprint("- ERROR: $uri returned an error: $result{whisker}{error}\n");62 next;63 }64 57 $NIKTO{resp_counts}{$RES}{total}++; 65 58 -
trunk/plugins/nikto_user_enum_apache.plugin
r150 r152 76 76 { 77 77 my $curl = "$cgidir" . "cgiwrap"; 78 (my $result, $content) = nfetch( "$curl", "GET");78 (my $result, $content) = nfetch($mark,"$curl", "GET"); 79 79 if ($content =~ /check your URL/i) 80 80 { … … 124 124 { 125 125 if (($ctr % 500) eq 0) { nprint("- User enumeration guess $ctr ($text)", "v"); } 126 (my $result, $content) = nfetch( "/~" . $text, "HEAD");126 (my $result, $content) = nfetch($mark,"/~" . $text, "HEAD"); 127 127 my $user = nikto_user_enum_apache_check($result, $text); 128 128 if (defined $user) … … 163 163 if ($_ eq "" ) { next }; 164 164 if (($ctr % 500) == 0) { nprint("- User enumeration guess $ctr ($_)", "v"); } 165 (my $result, $content) = nfetch( "/~" . $_, "HEAD");165 (my $result, $content) = nfetch($mark,"/~" . $_, "HEAD"); 166 166 my $user = nikto_user_enum_apache_check($result, $_); 167 167 if ($user)
Note: See TracChangeset
for help on using the changeset viewer.