Skip to content

Commit

Permalink
Error if -port is specified with a full URI
Browse files Browse the repository at this point in the history
  • Loading branch information
sullo committed Oct 28, 2017
1 parent 8abdcef commit 21ea998
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions program/plugins/nikto_core.plugin
Original file line number Diff line number Diff line change
Expand Up @@ -1097,11 +1097,16 @@ sub set_targets {
my $targs = {};
foreach my $host (@checkhosts) {
$host =~ s/\s+//g;
if (!defined $host) { next; }
if ($host eq '') { next; }
my ($defhost, $defport) = '';

# is it a URL?
if ($host =~ /^https?:\/\//) {

if ($CLI{'ports'} ne '') {
nprint("- ERROR: The -port option cannot be used with a full URI");
exit;
}
my @hostdata = LW2::uri_split($host);

$defhost = $hostdata[2];
Expand Down Expand Up @@ -1167,7 +1172,8 @@ sub load_databases {
# verify required files
for my $file (@dbs) {
if (!-r "$CONFIGFILE{'DBDIR'}/$file") {
die nprint("+ ERROR: Can't find/read required file \"$CONFIGFILE{'DBDIR'}/$file\"");
nprint("+ ERROR: Can't find/read required file \"$CONFIGFILE{'DBDIR'}/$file\"");
exit;
}
}

Expand Down

0 comments on commit 21ea998

Please sign in to comment.