Skip to content

Commit

Permalink
Merge pull request #621 from schubergphilis/588-and-589
Browse files Browse the repository at this point in the history
Closes #588 and #589
  • Loading branch information
MrSeccubus committed Dec 7, 2017
2 parents 9c6b085 + e04851f commit 17f39a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Artien Bel <Ar0xA@users.noreply.github.com> <Sphaz@users.noreply.github.com>
Artien Bel <Ar0xA@users.noreply.github.com> <ar0xa@tldr.nu>
Jordan Bradley <phrag@nsa.wtf>
Alexander Kaasjager <akaasjager@schubergphilis.com>
Alireza Karbasian <alireza.karbasian@sophos.com>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ Enhancements

Bug Fixes
---------
* #588 - Fix Nmap Plugin ID leak (Thanks @alirezakv)
* #589 - Fix OpenVAS scan execution bug with only 1 target defined (Thanks @alirezakv)
* #603 - Nessus scan fails when pdf files cannot be exported (Thanks @Ar0xA)
* #615 - Docker: when the database was on the data volume the database failed to start
* #617 - Nikto scanner gives unintended error output
3 changes: 2 additions & 1 deletion bin/nmap2ivil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright 2011-2017 Frank Breedijk, Andrey Danin, Glenn ten Cate
# Copyright 2011-2017 Frank Breedijk, Andrey Danin, Glenn ten Cate, Alireza Karbasian
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -198,6 +198,7 @@ foreach my $host ( @{$nmap->{host}} ) {
}
} elsif ( $item eq 'ports') {
foreach my $port ( @{$host->{$item}->{'port'}} ) {
$finding->{id} = "ports";
$finding->{port} = "$port->{portid}/$port->{protocol}";
$finding->{finding} = "Port : $port->{portid}/$port->{protocol} - $port->{state}->{state}\n";
$finding->{finding} .= "State : $port->{state}->{state}\n";
Expand Down
15 changes: 11 additions & 4 deletions scanners/OpenVAS6/scan
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright 2017 Fabien Guillaume, Frank Breedijk, Andrey Danin, Floris Kraak
# Copyright 2017 Fabien Guillaume, Frank Breedijk, Andrey Danin, Floris Kraak, Alireza Karbasian
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -167,18 +167,25 @@ print "Target : $targetname \n" if $verbose >1;
print "Target ip : $targetip \n" if $verbose >1 && $targetip ne "0";

$xml = omp_request("<get_targets/>");
my $target = undef;
if ( exists $xml->{target}->{$targetname} ) {
$target = $xml->{target}->{$targetname};
} elsif ( $xml->{target}->{name} eq $targetname ) {
# if only one target is defined in OpenVAS, then the format changes
$target = $xml->{target};
}
if ( defined $target ) {
if ( $targetip ne "0" ) {
if ( $xml->{target}->{$targetname}->{hosts} ne $targetip ) {
if ( $target->{hosts} ne $targetip ) {
die "Target '$targetname' found, but it doesn't match target ip '$targetip', please omit target IP specification or edit the target manualy in OpenVAS to correct the problem";
}
}
if ( $portlist_id ) {
if ( $xml->{target}->{$targetname}->{port_list}->{id} ne $portlist_id ) {
if ( $target->{port_list}->{id} ne $portlist_id ) {
die "Target '$targetname' found, but it doesn't match the specified port list, please omit port list specification or edit the target manualy in OpenVAS to correct the problem";
}
}
$target_id = $xml->{target}->{$targetname}->{id};
$target_id = $target->{id};
} else {
# Need to create a target
if ( $targetip eq "0" ) {
Expand Down

0 comments on commit 17f39a0

Please sign in to comment.