1747350365
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
scans/*
|
scans/*
|
||||||
|
logs/*
|
||||||
scratch*
|
scratch*
|
||||||
*.bak*
|
*.bak*
|
||||||
*.old*
|
*.old*
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
<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="out"></span>
|
<span class="hidden" id="link"></span>
|
||||||
|
<br>
|
||||||
|
<pre class="hidden" id="progress">
|
||||||
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+36
-12
@@ -14,8 +14,8 @@ function copyToClipboard(ID) {
|
|||||||
|
|
||||||
function xhrSuccess(xhrRet) {
|
function xhrSuccess(xhrRet) {
|
||||||
let xhrResponseText = xhrRet.target.responseText;
|
let xhrResponseText = xhrRet.target.responseText;
|
||||||
getID('out').innerHTML = '<a href="'+xhrResponseText+'">Scan Report Here ('+xhrResponseText+')</a>';
|
getID('link').innerHTML = '<a href="'+xhrResponseText+'">Scan Report Here ('+xhrResponseText+')</a>';
|
||||||
getID('out').style.display = "inline";
|
getID('link').style.display = "inline";
|
||||||
}
|
}
|
||||||
|
|
||||||
function xhr404(xhrRet) {
|
function xhr404(xhrRet) {
|
||||||
@@ -41,9 +41,9 @@ function xhrLoadend(xhrRet) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function doXhr(xhrFilePath, xhrMethod='GET', xhrPostData=null) {
|
function doXhr(xhrFilePath, xhrLoadEndFun=xhrLoadEnd, xhrMethod='GET', xhrPostData=null) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.addEventListener("loadend", xhrLoadend);
|
xhr.addEventListener("loadend", xhrLoadEndFun);
|
||||||
xhr.open(xhrMethod, xhrFilePath);
|
xhr.open(xhrMethod, xhrFilePath);
|
||||||
|
|
||||||
if(xhrMethod == 'POST') {
|
if(xhrMethod == 'POST') {
|
||||||
@@ -68,15 +68,39 @@ function changeFavIcon(icoFile) {
|
|||||||
icoLink.href = icoFile;
|
icoLink.href = icoFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
function runNmapScan() {
|
function xhrRunNmapScan(xhrRet) {
|
||||||
let nmapcmd = getID('nmapcmd').value;
|
// let xhrResponseText = xhrRet.target.responseText;
|
||||||
console.log(nmapcmd);
|
xhrJson = JSON.parse(xhrRet.target.responseText);
|
||||||
let postData = 'nmapcmd='+encodeURIComponent(nmapcmd);
|
|
||||||
doXhr('run_scan.php', 'POST', postData);
|
getID('link').innerHTML = '<a href="'+xhrJson.webName+'">Scan Report Here ('+xhrJson.webName+')</a>';
|
||||||
|
getID('link').style.display = "inline";
|
||||||
|
|
||||||
|
if(typeof pollInterval !== 'undefined') {
|
||||||
|
clearInterval(pollInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pollFile(filePath) {
|
getID('progress').innerHTML = '';
|
||||||
var poll = setInterval(function() {
|
getID('progress').style.display = 'none';
|
||||||
doXhr(filePath);
|
|
||||||
|
pollFile(xhrJson.runningLog);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function xhrPollFile(xhrRet) {
|
||||||
|
let xhrResponseText = xhrRet.target.responseText;
|
||||||
|
getID('progress').innerHTML = xhrResponseText;
|
||||||
|
getID('progress').style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
function pollFile(runningLog) {
|
||||||
|
var pollInterval = setInterval(function() {
|
||||||
|
doXhr(runningLog, xhrPollFile);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function runNmapScan() {
|
||||||
|
let nmapcmd = getID('nmapcmd').value;
|
||||||
|
let postData = 'nmapcmd='+encodeURIComponent(nmapcmd);
|
||||||
|
|
||||||
|
doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData);
|
||||||
|
}
|
||||||
+2
-4
@@ -11,8 +11,6 @@
|
|||||||
$run_cmd = "bash ./scripts/run_scan.sh nmap -oX ./scans/$file_name --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl $post_cmd";
|
$run_cmd = "bash ./scripts/run_scan.sh nmap -oX ./scans/$file_name --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl $post_cmd";
|
||||||
$web_name = "/nmaprincesspi/scans/$file_name";
|
$web_name = "/nmaprincesspi/scans/$file_name";
|
||||||
|
|
||||||
echo $web_name;
|
$exec = trim(shell_exec($run_cmd));
|
||||||
|
echo "{\"runningLog\":\"$exec\",\"webName\":\"$web_name\"}";
|
||||||
$exec = shell_exec($run_cmd);
|
|
||||||
echo $exec;
|
|
||||||
?>
|
?>
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-15 16:07 MDT
|
|
||||||
Nmap scan report for kasm.h.acker.is (64.20.45.110)
|
|
||||||
Host is up (0.070s latency).
|
|
||||||
Not shown: 995 filtered tcp ports (no-response)
|
|
||||||
PORT STATE SERVICE
|
|
||||||
22/tcp open ssh
|
|
||||||
80/tcp open http
|
|
||||||
443/tcp open https
|
|
||||||
3389/tcp open ms-wbt-server
|
|
||||||
8888/tcp open sun-answerbook
|
|
||||||
|
|
||||||
Nmap done: 1 IP address (1 host up) scanned in 7.70 seconds
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo chown -R www-data:www-data .. 2>>../error.log
|
sudo chown -R www-data:www-data .. 2>>../logs/error.log
|
||||||
|
sudo chmod +x ../logs/*
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
rm -f ../error.log 2>>./error.log
|
rm -f ../log/* 2>>../logs/error.log
|
||||||
rm -f ../running.log 2>>./error.log
|
rm -f ../scans/* 2>>../logs/error.log
|
||||||
rm -f ../scans/* 2>>./error.log
|
|
||||||
+3
-1
@@ -1,2 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
eval "$* 2>error.log 1>running.log&"
|
runningLog="$(date +%Y%m%d%H%M%S)-$RANDOM.log"
|
||||||
|
eval "$* 2>>logs/error.log 1>logs/$runningLog&"
|
||||||
|
echo "/nmaprincesspi/logs/$runningLog"
|
||||||
Reference in New Issue
Block a user