scan_all in bash script
This commit is contained in:
26
nmap_cmd.php
Normal file
26
nmap_cmd.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$file = $argv[1];
|
||||
$site = basename($file, ".yaml");
|
||||
$__DIR__ = __DIR__;
|
||||
|
||||
$conf = yaml_parse_file($file);
|
||||
|
||||
$targets = [];
|
||||
$services = [];
|
||||
|
||||
foreach ($conf as $key => $value) {
|
||||
if ($key != "site") {
|
||||
foreach($value as $hostaddress => $servicesList) {
|
||||
$targets[$hostaddress] = true;
|
||||
if ($servicesList) foreach ($servicesList as $service) {
|
||||
$services[$service] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$targets = join(array_keys($targets), " ");
|
||||
$services = join(array_keys($services), ",");
|
||||
|
||||
echo ("nmap -v -Pn -p $services --script smb-enum-shares,$__DIR__/nmap -oX $__DIR__/scans/.~$site.xml $targets");
|
||||
?>
|
Reference in New Issue
Block a user