Changeset 700


Ignore:
Timestamp:
12/10/2011 04:11:35 AM (18 months ago)
Author:
sullo
Message:

Ticket 228: Add client SSL certificate support. Thanks to monnerat for code submission!

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/CHANGES.txt

    r699 r700  
    112011-12-09 
     2        - Ticket 228: Add client SSL certificate support. Thanks to monnerat for code submission! 
    23        - Ticket 226: Add GMT offset to time outputs 
    34        - Ticket 224: Space in robots.txt kills scanner 
  • trunk/nikto.pl

    r694 r700  
    126126my @MARKS = set_targets($CLI{'host'}, $CLI{'ports'}, $CLI{'ssl'}, $CLI{'root'}); 
    127127 
     128if (defined($CLI{'key'}) || defined($CLI{'cert'})) { 
     129    $CLI{'key'} = $CLI{'cert'} unless (defined($CLI{'key'})); 
     130    $CLI{'cert'} = $CLI{'key'} unless (defined($CLI{'cert'})); 
     131} 
     132 
    128133# Now check each target is real and remove duplicates/fill in extra information 
    129134foreach my $mark (@MARKS) { 
     
    140145 
    141146    # Check that the port is open 
    142     my $open = port_check($mark->{'hostname'}, $mark->{'ip'}, $mark->{'port'}); 
     147    my $open = port_check($mark->{'hostname'}, $mark->{'ip'}, $mark->{'port'}, $CLI{'key'}, $CLI{'cert'}); 
    143148    if (defined $CLI{'vhost'}) { $mark->{'vhost'} = $CLI{'vhost'} } 
    144149    if ($open == 0) { 
     
    151156    $mark->{'ssl'} = $open - 1; 
    152157 
     158    if ($mark->{'ssl'}) { 
     159        $mark->{'key'} = $CLI{'key'}; 
     160        $mark->{'cert'} = $CLI{'cert'}; 
     161    } 
    153162} 
    154163 
     
    174183        $mark->{'vhost'} = $CLI{'vhost'}; 
    175184    } 
    176     $request{'whisker'}->{'port'}    = $mark->{'port'}; 
    177     $request{'whisker'}->{'ssl'}     = $mark->{'ssl'}; 
    178     $request{'whisker'}->{'version'} = $CONFIGFILE{'DEFAULTHTTPVER'}; 
     185    $request{'whisker'}->{'port'}            = $mark->{'port'}; 
     186    $request{'whisker'}->{'ssl'}             = $mark->{'ssl'}; 
     187    $request{'whisker'}->{'ssl_rsacertfile'} = $mark->{'key'}; 
     188    $request{'whisker'}->{'ssl_certfile'}    = $mark->{'cert'}; 
     189    $request{'whisker'}->{'version'}         = $CONFIGFILE{'DEFAULTHTTPVER'}; 
    179190 
    180191    # Cookies 
  • trunk/plugins/nikto_core.plugin

    r699 r700  
    508508               "host=s"           => \$CLI{'host'}, 
    509509               "id=s"             => \$CLI{'hostauth'}, 
     510               "key=s"            => \$CLI{'key'}, 
    510511               "IgnoreCode=s"     => \$CLI{'ignorecode'}, 
    511512               "list-plugins"     => \&list_plugins, 
     
    521522               "Pause=f"          => \$CLI{'pause'}, 
    522523               "Plugins=s"        => \$CLI{'plugins'}, 
     524               "RSAcert=s"        => \$CLI{'cert'}, 
    523525               "port=s"           => \$CLI{'ports'}, 
    524526               "root=s"           => \$CLI{'root'}, 
     
    13731375############################################################################### 
    13741376sub port_check { 
    1375     my ($hostname, $ip, $port) = @_; 
     1377    my ($hostname, $ip, $port, $key, $cert) = @_; 
    13761378    my (%headers); 
    13771379    my $m = {}; 
     
    14021404                   ); 
    14031405            $m->{ssl} = ($checkssl eq "HTTP") ? 0 : 1; 
     1406            if ($m->{'ssl'}) { 
     1407                $m->{'key'} = $key; 
     1408                $m->{'cert'} = $cert; 
     1409            } 
    14041410            proxy_check($m); 
    14051411            my ($res, $content) = 
     
    20582064    $reqhash->{'whisker'}->{'port'} = $mark->{'port'}; 
    20592065    $reqhash->{'whisker'}->{'ssl'}  = $mark->{'ssl'}; 
     2066    $reqhash->{'whisker'}->{'ssl_rsacertfile'} = $mark->{'key'}; 
     2067    $reqhash->{'whisker'}->{'ssl_certfile'}    = $mark->{'cert'}; 
    20602068 
    20612069    # Proxy stuff 
     
    26212629       -IgnoreCode        Ignore Codes--treat as negative responses 
    26222630       -id+               Host authentication to use, format is id:pass or id:pass:realm 
     2631       -key+              Client certificate key file 
    26232632       -list-plugins      List all available plugins, perform no testing 
    26242633       -maxtime+          Maximum testing time per host 
     
    26402649       -Plugins+          List of plugins to run (default: ALL) 
    26412650       -root+             Prepend root value to all requests, format is /directory 
     2651       -RSAcert+          Client certificate file 
    26422652       -ssl               Force ssl mode on port 
    26432653       -Single            Single request mode 
     
    26712681        print " 
    26722682       -config+            Use this config file 
    2673        -Cgidirs+           scan these CGI dirs: 'none', 'all', or values like \"/cgi/ /cgi-a/\" 
    26742683       -dbcheck            check database and other key files for syntax errors 
    26752684       -Display+           Turn on/off display outputs 
    2676        -evasion+           ids evasion technique 
    26772685       -Format+            save file (-o) format 
    26782686       -host+              target host 
     
    26802688       -id+                Host authentication to use, format is id:pass or id:pass:realm 
    26812689       -list-plugins       List all available plugins 
    2682        -mutate+            Guess additional file names 
    2683        -mutate-options+    Provide extra information for mutations 
    26842690       -output+            Write output to this file 
    26852691       -nocache            Disables the URI cache 
Note: See TracChangeset for help on using the changeset viewer.