diff --git a/README.md b/README.md index e61747f..11185c5 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,9 @@ add alias to .zshrc or .basrc `alias nmap="/var/www/html/nmaprincesspi/nmap-script.sh"` manuual - `nmap -oX /var/www/html/nmaprincesspi/scans/FILENMAME.xml --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl` \ No newline at end of file + `nmap -oX /var/www/html/nmaprincesspi/scans/FILENMAME.xml --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl` + +Designed to run on apache2 and php + +need to make a .htpasswd file and put it somewhere + https://www.web2generators.com/apache-tools/htpasswd-generator \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 1058f26..07695ef 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,4 +18,10 @@ v0.4-dev v0.5-dev added csrf protection bug fixes - layout improvements \ No newline at end of file + layout improvements + +v0.6-dev + added basic html auth (apache2) + cleaned up code + added nmap reference link + open xml and nmap reference links in new tab \ No newline at end of file diff --git a/css/nmaprincesspi.css b/css/nmaprincesspi.css index 9dd0c0d..cc79bb8 100644 --- a/css/nmaprincesspi.css +++ b/css/nmaprincesspi.css @@ -26,6 +26,12 @@ body { background-repeat: no-repeat; } +#stickymenu { + position: fixed; + right: 0; + bottom: 0; +} + h1.title { color: #800080; font-size: 3em; diff --git a/index.php b/index.php index fdf2309..0d93b14 100644 --- a/index.php +++ b/index.php @@ -16,18 +16,21 @@ foreach($scans as $scan) { - Princess Pi's Magical Nmapprincesspi Thingy! + Princess Pi's Magical Nmaprincesspi! -

Princess Pi's Magical Nmapprincesspi Thingy!

- +

Princess Pi's Magical Nmaprincesspi!

+  
- - - +
+ + + + +


- Show Previous Scans + Show Previous Scans | Nmap Reference

+ +   \ No newline at end of file diff --git a/js/nmaprincesspi.js b/js/nmaprincesspi.js index 6acf8b0..aaa5ddf 100644 --- a/js/nmaprincesspi.js +++ b/js/nmaprincesspi.js @@ -11,25 +11,24 @@ function getID(ID) { function toggleShow(ID, htmlUpdateID=false, htmlUpdateShowing=false, htmlUpdateHidden=false) { let elemClasses = getID(ID).classList; + var updating = false; if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) { - const updating = true; - updateElem = getID(htmlUpdateID).innerHTML; - } else { - const updating = false; - } + updating = true; + var updateElem = getID(htmlUpdateID); + } if(elemClasses.contains('hidden')) { elemClasses.remove('hidden'); - if(updating) { - updateElem = htmlUpdateShowing; + if(updating === true) { + updateElem.innerHTML = htmlUpdateShowing; } } else { elemClasses.add('hidden'); - if(updating) { - updateElem = htmlUpdateHidden; + if(updating === true) { + updateElem.innerHTML = htmlUpdateHidden; } } } @@ -104,7 +103,7 @@ function xhrRunNmapScan(xhrRet) { clearInterval(pollInterval); } - getID('link').innerHTML = 'Scan Report ('+xhrJson.webName+')'; + getID('link').innerHTML = 'Scan Report ('+xhrJson.webName+')'; getID('link').style.display = "inline"; getID('progressbox').innerHTML = ''; @@ -133,3 +132,17 @@ function runNmapScan() { doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData); } +/* listeners */ +window.onload = function() { + let cmdform = getID('cmdform'); + let showlist = getID('showlist'); + + cmdform.addEventListener('submit', function(event) { + event.preventDefault(); // prevents loading new page + runNmapScan(); + }); + + showlist.addEventListener('click', function(event) { + toggleShow('scanlist', 'showlist', 'Hide Previous Scans', 'Show Previous Scans'); + }); +} \ No newline at end of file diff --git a/todo.txt b/todo.txt index 11a05c3..da65abf 100644 --- a/todo.txt +++ b/todo.txt @@ -7,19 +7,25 @@ x bug on second scan in progress pre error handling nmap fail php script fail - input validation fail -containerize + x input validation fail + x csrf validation fail + xhr fail +"finished" notification by parsing xml for end bits +keep alive check with ps aux type thingggg x scans listing x clear scans buttons x work on scans filename? fix perms -auth system +x auth system input/output validation x escapeshellcmd layout collums do not show scan list text when empty figure out some kinda command ran for anchor text on previous scans + by parsing xml fmmmm + autoscroll + floating "top" button work on princesspi-nmap.xsl clean up minimize stuff @@ -27,4 +33,10 @@ work on princesspi-nmap.xsl make prettier green class padding on table items - centering text on table headers \ No newline at end of file + centering text on table headers +containerize + nmap docker? + perms? + script with sticky bit? + custom docker? + docker inside docker? \ No newline at end of file diff --git a/version.txt b/version.txt index 21af665..bcdb319 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.5-dev \ No newline at end of file +v0.6-dev \ No newline at end of file