From 728f2c861d883588e9d329b4c549e1fd67877cf9 Mon Sep 17 00:00:00 2001 From: hPrnicessPi3 Date: Thu, 15 May 2025 15:25:39 -0600 Subject: [PATCH] 1747344339 --- css/princesspi-default-css.css | 8 +++++--- index.php | 10 +++++----- js/princesspi-default-js.js | 19 +++++++++++++++++-- run_scan.php | 1 - todo.txt | 3 +++ xsl/princesspi-nmap.xsl | 2 +- 6 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 todo.txt diff --git a/css/princesspi-default-css.css b/css/princesspi-default-css.css index 31c1c69..9dd0c0d 100644 --- a/css/princesspi-default-css.css +++ b/css/princesspi-default-css.css @@ -10,12 +10,14 @@ */ @font-face { - font-family: 'Comic Code Regular'; - src: url('fonts/ComicCodeRegular.otf'); + font-family: "Comic-Code-Regular"; + src: url("fonts/Comic-Code-Regular.ttf"), + url("fonts/Comic-Code-Regular.woff"), + url("fonts/Comic-Code-Regular.otf"); } body { - font-family: "Comic Code Regular", "Comic Sans MS", 'Courier New', Courier, monospace; + font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-weight: bold; color: #800080; diff --git a/index.php b/index.php index b2ddc50..0510096 100644 --- a/index.php +++ b/index.php @@ -5,16 +5,16 @@ - Princess Pi's Magical Nmap Web Thingy!

Princess Pi's Magical Nmap Web Thingy!

-

- - -
+ + +
+ + \ No newline at end of file diff --git a/js/princesspi-default-js.js b/js/princesspi-default-js.js index 4a266bb..ee9d85b 100644 --- a/js/princesspi-default-js.js +++ b/js/princesspi-default-js.js @@ -14,6 +14,8 @@ function copyToClipboard(ID) { function xhrSuccess(xhrRet) { let xhrResponseText = xhrRet.target.responseText; + getID('out').innerHTML = 'Scan Report Here ('+xhrResponseText+')'; + getID('out').style.display = "inline"; } function xhr404(xhrRet) { @@ -43,7 +45,13 @@ function doXhr(xhrFilePath, xhrMethod='GET', xhrPostData=null) { const xhr = new XMLHttpRequest(); xhr.addEventListener("loadend", xhrLoadend); xhr.open(xhrMethod, xhrFilePath); - xhr.send(); + + if(xhrMethod == 'POST') { + xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr.send(xhrPostData); + } else { + xhr.send(); + } } function changeFavIcon(icoFile) { @@ -58,4 +66,11 @@ function changeFavIcon(icoFile) { document.head.appendChild(icoLink); icoLink.href = icoFile; -} \ No newline at end of file +} + +function runNmapScan() { + let nmapcmd = getID('nmapcmd').value; + console.log(nmapcmd); + let postData = 'nmapcmd='+encodeURIComponent(nmapcmd); + doXhr('run_scan.php', 'POST', postData); +} \ No newline at end of file diff --git a/run_scan.php b/run_scan.php index 2b54684..3861bc6 100644 --- a/run_scan.php +++ b/run_scan.php @@ -14,5 +14,4 @@ echo $web_name; $exec = shell_exec($run_cmd); - echo $exec; ?> \ No newline at end of file diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..5e8e0b7 --- /dev/null +++ b/todo.txt @@ -0,0 +1,3 @@ +xhr->run_scan.php +fix perms +auth system \ No newline at end of file diff --git a/xsl/princesspi-nmap.xsl b/xsl/princesspi-nmap.xsl index 6ba440f..a93f01c 100644 --- a/xsl/princesspi-nmap.xsl +++ b/xsl/princesspi-nmap.xsl @@ -269,7 +269,7 @@ tr { vertical-align:top; - font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; + font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-size: 1em; color: #800080; background-color: #FFB4C0;