uncomment exec

This commit is contained in:
Adrien MALINGREY 2023-04-09 01:18:04 +02:00
parent 98b7fab684
commit 15e33765e5
2 changed files with 1 additions and 30 deletions

View File

@ -38,7 +38,7 @@ foreach (scandir("./site") as $file) {
$services = array_keys($services);
$xml->asXML("site/$site.xml");
//exec("nmap -v -Pn -p ".join($services, ",")." --script smb-enum-shares.nse -oX 'scans/$site.xml' ".join($targets, " "));
exec("nmap -v -Pn -p ".join($services, ",")." --script smb-enum-shares.nse -oX 'scans/$site.xml' ".join($targets, " "));
}
};

View File

@ -1,29 +0,0 @@
<?php
$yaml = yaml_parse_file($argv[1]);
$site = str_replace(".yaml", "", basename($argv[1]));
$xml = new SimpleXMLElement(<<<XML
<?xml version="1.0"?>
<?xml-stylesheet href='../results.xsl' type='text/xsl'?>
<lanScanConf/>
XML);
$xml->addChild("scan path='scans/$site.xml'");
foreach ($yaml as $siteName => $groups) {
$xml->addAttribute("name", $siteName);
if ($groups) foreach ($groups as $groupName => $hosts) {
$xmlGroup = $xml->addChild("group");
$xmlGroup->addAttribute("name", $groupName);
if ($hosts) foreach ($hosts as $hostName => $services) {
$xmlHost = $xmlGroup->addChild("host");
$xmlHost->addAttribute("address", $hostName);
if ($services) foreach ($services as $service) {
$xmlService = $xmlHost->addChild("service");
$xmlService->addAttribute("name", $service);
}
}
}
}
$xml->asXML("site/$site.xml");
?>