fix heredoc syntax for old php
This commit is contained in:
parent
b3aa55c9b4
commit
fee3f2a043
16
scan_all.php
16
scan_all.php
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (! function_exists('str_ends_with')) {
|
if (! function_exists('str_ends_with')) {
|
||||||
function str_ends_with(string $haystack, string $needle): bool
|
function str_ends_with(string $haystack, string $needle): bool {
|
||||||
{
|
|
||||||
$needle_len = strlen($needle);
|
$needle_len = strlen($needle);
|
||||||
return ($needle_len === 0 || 0 === substr_compare($haystack, $needle, - $needle_len));
|
return ($needle_len === 0 || 0 === substr_compare($haystack, $needle, - $needle_len));
|
||||||
}
|
}
|
||||||
@ -19,10 +18,10 @@ foreach (scandir("./confs/") as $file) {
|
|||||||
$services = [];
|
$services = [];
|
||||||
|
|
||||||
$xml = new SimpleXMLElement(<<<XML
|
$xml = new SimpleXMLElement(<<<XML
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-stylesheet href='../results.xsl' type='text/xsl'?>
|
<?xml-stylesheet href='../results.xsl' type='text/xsl'?>
|
||||||
<lanScanConf/>
|
<lanScanConf/>
|
||||||
XML);
|
XML;);
|
||||||
$xml->addChild("scan path='scans/$site.xml'");
|
$xml->addChild("scan path='scans/$site.xml'");
|
||||||
|
|
||||||
foreach ($yaml as $siteName => $groups) {
|
foreach ($yaml as $siteName => $groups) {
|
||||||
@ -46,10 +45,9 @@ foreach (scandir("./confs/") as $file) {
|
|||||||
$targets = join(array_keys($targets), " ");
|
$targets = join(array_keys($targets), " ");
|
||||||
$services = join(array_keys($services), ",");
|
$services = join(array_keys($services), ",");
|
||||||
|
|
||||||
exec("nmap -v -Pn -p $services --script smb-enum-shares.nse,./http-get.nse,./http-favicon-url.nse --script-args=httpspider.maxpagecount=1 -oX 'scans/$site.xml' $targets\n");
|
exec("nmap -v -Pn -p $services --script smb-enum-shares,./http-get.nse,./http-favicon-url.nse -oX 'scans/$site.xml' $targets\n");
|
||||||
|
|
||||||
$xml->asXML("site/$site.xml");
|
$xml->asXML("site/$site.xml");
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user