[go: nahoru, domu]

Skip to content

Commit

Permalink
Changed ETag logic to only display issue if ETag is found to actually…
Browse files Browse the repository at this point in the history
… contain inode fields
  • Loading branch information
wireghoul committed Jan 22, 2018
1 parent d09507a commit c8f003c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions program/plugins/nikto_headers.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ sub nikto_headers_postfetch {
my $etag = $result->{'etag'};
$etag =~ s/"//g;
my @fields = split("-", $etag);
my $message =
"Server may leak inodes via ETags, header found with file " . $request->{'whisker'}->{'uri'};
if ($#fields == 2) {

# Only report ETags which actuallyleak inodes...
if (scalar(@fields) == 3) {
my $message =
"Server may leak inodes via ETags, header found with file " . $request->{'whisker'}->{'uri'};
# check for numbers that are too large
my $ishex = 1;
for (my $i = 0 ; $i < 3 ; $i++) {
Expand All @@ -119,15 +119,9 @@ sub nikto_headers_postfetch {
? sprintf(", inode: %d, size: %d, mtime: %s",
hex($inode), hex($size), scalar(localtime($ltime)))
: sprintf(", inode: %s, size: %s, mtime: %s", $inode, $size, $mtime);
add_vulnerability($mark, $message, 999984, 0, $request->{'whisker'}->{'method'}, $request->{'whisker'}->{'uri'}, $request, $result);
$ETAGS{ $mark->{hostname} }{ $mark->{port} } = 1;
}
else {
$message .= ", fields: ";
foreach my $field (@fields) {
$message .= "0x$field ";
}
}
add_vulnerability($mark, $message, 999984, 0, $request->{'whisker'}->{'method'}, $request->{'whisker'}->{'uri'}, $request, $result);
$ETAGS{ $mark->{hostname} }{ $mark->{port} } = 1;
}

# Look for X-Frame-Options
Expand Down

0 comments on commit c8f003c

Please sign in to comment.