This commit is contained in:
2025-05-15 18:17:14 -06:00
parent 0edd257a16
commit bdf524f0d0
3 changed files with 16 additions and 9 deletions
+6 -3
View File
@@ -1,10 +1,13 @@
<?php
if(empty($_POST['nmapcmd'])) { die("nmapcmd POST var not found"); }
if(preg_match('/nmap/i', $_POST['nmapcmd']) !== 1) {
$post_cmd = $_POST['nmapcmd'];
$cleannmapcmd = escapeshellcmd($_POST['nmapcmd']);
// if(preg_match('/nmap/i', $cleannmapcmd) !== 1) {
if(substr($cleannmapcmd, 0, 5) == 'nmap ') {
$post_cmd = $cleannmapcmd;
} else {
$post_cmd = substr($_POST['nmapcmd'], 5);
$post_cmd = substr($cleannmapcmd, 5);
}
$file_name = date("Ymd-Hi-s") . "-" . rand(1000000,9999999) . ".xml";