making progress, moved some stuff around

This commit is contained in:
2025-05-15 14:44:28 -06:00
parent 4140df51da
commit 97f61c7daf
4 changed files with 25 additions and 1 deletions
+1
View File
@@ -2,3 +2,4 @@ scans/*
scratch* scratch*
*.bak* *.bak*
*.old* *.old*
demo.html
+6
View File
@@ -10,5 +10,11 @@
</head> </head>
<body> <body>
<h1>Princess Pi's Magical Nmap Web Thingy!</h1> <h1>Princess Pi's Magical Nmap Web Thingy!</h1>
<form action="run_scan.php" method="post">
<label for="nmapcmd">nmap command</label>
<br>
<input type="text" name="nmapcmd">
<input type="submit" value="Go, Baby, Go!">
</form>
</body> </body>
</html> </html>
+17
View File
@@ -0,0 +1,17 @@
<?php
if(empty($_POST['nmapcmd'])) { die("nmapcmd POST var not found"); }
if(preg_match('/nmap/i', $_POST['nmapcmd']) !== 1) {
$post_cmd = $_POST['nmapcmd'];
} else {
$post_cmd = substr($_POST['nmapcmd'], 5);
}
$file_name = date("Ymd-Hi-s") . ".xml";
$run_cmd = "nmap -oX scans/$file_name --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl $post_cmd &";
$web_name = "/nmaprincesspi/scripts/$file_name";
echo $web_name;
$exec = shell_exec($run_cmd);
?>