v0.3-dev
This commit is contained in:
@@ -5,3 +5,7 @@ v0.2-dev
|
|||||||
added polling system to monitor output
|
added polling system to monitor output
|
||||||
added logs dir
|
added logs dir
|
||||||
refactored js
|
refactored js
|
||||||
|
|
||||||
|
v0.3-dev
|
||||||
|
added toggleable list of previous scans
|
||||||
|
added link to clear all old scans
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
v0.2-dev
|
v0.3-dev
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<?php
|
||||||
|
$dir = './scans';
|
||||||
|
$scans = array_diff(scandir($dir), array('..', '.')); # silly method to remove the . and ..
|
||||||
|
foreach($scans as $scan) {
|
||||||
|
$scanList .= "<a href='/nmaprincesspi/scans/$scan'>$scan<a><br>\n";
|
||||||
|
}
|
||||||
|
?><!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@@ -14,10 +20,17 @@
|
|||||||
<br>
|
<br>
|
||||||
<input type="text" id="nmapcmd" name="nmapcmd">
|
<input type="text" id="nmapcmd" name="nmapcmd">
|
||||||
<input type="button" onclick="runNmapScan()" value="Go, Baby, Go!">
|
<input type="button" onclick="runNmapScan()" value="Go, Baby, Go!">
|
||||||
<br><br>
|
|
||||||
<span class="hidden" id="link"></span>
|
|
||||||
<br>
|
<br>
|
||||||
<pre class="hidden" id="progress">
|
<br>
|
||||||
</pre>
|
<span class="fakelink" id="showlist" onclick="toggleShow('scanlist', 'showlist', 'Hide Previous Scans', 'Show Previous Scans')">Show Previous Scans</span>
|
||||||
|
<br>
|
||||||
|
<p class="hidden" id="link"></p>
|
||||||
|
<div id="scanlist" class="hidden">
|
||||||
|
<p><a href="run_clear_scans.php">Delete All Old Scans</a></p>
|
||||||
|
<p><?php echo $scanList; ?></p>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<pre class="hidden" id="progress"></pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+20
-1
@@ -6,6 +6,24 @@ function getID(ID) {
|
|||||||
return document.getElementById(ID);
|
return document.getElementById(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleShow(ID, htmlUpdateID=false, htmlUpdateShowing=false, htmlUpdateHidden=false) {
|
||||||
|
let elemClasses = getID(ID).classList;
|
||||||
|
|
||||||
|
if(elemClasses.contains('hidden')) {
|
||||||
|
elemClasses.remove('hidden');
|
||||||
|
|
||||||
|
if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) {
|
||||||
|
getID(htmlUpdateID).innerHTML = htmlUpdateShowing;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
elemClasses.add('hidden');
|
||||||
|
|
||||||
|
if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) {
|
||||||
|
getID(htmlUpdateID).innerHTML = htmlUpdateHidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function copyToClipboard(ID) {
|
function copyToClipboard(ID) {
|
||||||
let copyText = getID(ID);
|
let copyText = getID(ID);
|
||||||
copyText.select();
|
copyText.select();
|
||||||
@@ -72,7 +90,7 @@ function xhrRunNmapScan(xhrRet) {
|
|||||||
// let xhrResponseText = xhrRet.target.responseText;
|
// let xhrResponseText = xhrRet.target.responseText;
|
||||||
xhrJson = JSON.parse(xhrRet.target.responseText);
|
xhrJson = JSON.parse(xhrRet.target.responseText);
|
||||||
|
|
||||||
getID('link').innerHTML = '<a href="'+xhrJson.webName+'">Scan Report Here ('+xhrJson.webName+')</a>';
|
getID('link').innerHTML = '<a href="'+xhrJson.webName+'">Scan Report ('+xhrJson.webName+')</a>';
|
||||||
getID('link').style.display = "inline";
|
getID('link').style.display = "inline";
|
||||||
|
|
||||||
if(typeof pollInterval !== 'undefined') {
|
if(typeof pollInterval !== 'undefined') {
|
||||||
@@ -104,3 +122,4 @@ function runNmapScan() {
|
|||||||
|
|
||||||
doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData);
|
doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
$scansDir = './scans';
|
||||||
|
$logsDir = './logs';
|
||||||
|
|
||||||
|
$scans = array_diff(scandir($scansDir), array('..', '.')); # silly method to remove the . and ..
|
||||||
|
$logs = array_diff(scandir($logsDir), array('..', '.'));
|
||||||
|
|
||||||
|
foreach($scans as $scan) {
|
||||||
|
unlink("$scansDir/$scan");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($logs as $log) {
|
||||||
|
unlink("$logsDir/$log");
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Location: /nmaprincesspi/");
|
||||||
|
?>
|
||||||
@@ -8,8 +8,9 @@ error handling
|
|||||||
php script fail
|
php script fail
|
||||||
input validation fail
|
input validation fail
|
||||||
containerize
|
containerize
|
||||||
scans listing
|
x scans listing
|
||||||
c work on scans filename?
|
clear scans buttons
|
||||||
|
x work on scans filename?
|
||||||
fix perms
|
fix perms
|
||||||
auth system
|
auth system
|
||||||
input/output validation
|
input/output validation
|
||||||
|
|||||||
Reference in New Issue
Block a user