Compare commits
10 Commits
6471998a46
...
4e2ab5b0da
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e2ab5b0da | |||
| cb7d872b34 | |||
| 1b696d4cb7 | |||
| be26f6eb47 | |||
| eed57dad2f | |||
| 22c37748e3 | |||
| 2ddaa79706 | |||
| 79f4caf9dd | |||
| 9a0b7e951d | |||
| 69c13606df |
@@ -3,3 +3,4 @@ logs/*
|
|||||||
scratch*
|
scratch*
|
||||||
*.bak*
|
*.bak*
|
||||||
*.old*
|
*.old*
|
||||||
|
*tmp*
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
AuthUserFile /etc/apache2/.htpasswd
|
||||||
|
AuthType Basic
|
||||||
|
AuthName "My restricted Area"
|
||||||
|
Require valid-user
|
||||||
@@ -5,4 +5,9 @@ add alias to .zshrc or .basrc
|
|||||||
`alias nmap="/var/www/html/nmaprincesspi/nmap-script.sh"`
|
`alias nmap="/var/www/html/nmaprincesspi/nmap-script.sh"`
|
||||||
|
|
||||||
manuual
|
manuual
|
||||||
`nmap -oX /var/www/html/nmaprincesspi/scans/FILENMAME.xml --stylesheet /nmaprincesspi/xsl/princesspi-nmap.xsl`
|
`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
|
||||||
+7
-1
@@ -18,4 +18,10 @@ v0.4-dev
|
|||||||
v0.5-dev
|
v0.5-dev
|
||||||
added csrf protection
|
added csrf protection
|
||||||
bug fixes
|
bug fixes
|
||||||
layout improvements
|
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
|
||||||
@@ -26,6 +26,12 @@ body {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#stickymenu {
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
h1.title {
|
h1.title {
|
||||||
color: #800080;
|
color: #800080;
|
||||||
font-size: 3em;
|
font-size: 3em;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
# Apache and PHP service
|
# Apache and PHP service
|
||||||
web:
|
web:
|
||||||
image: php:8-apache
|
image: php:8.3.21-apache
|
||||||
container_name: php-apache-container
|
container_name: php-apache-container
|
||||||
ports:
|
ports:
|
||||||
- "${WWW_PORT_HOST}:80"
|
- "${WWW_PORT_HOST}:80"
|
||||||
|
|||||||
@@ -16,18 +16,21 @@ foreach($scans as $scan) {
|
|||||||
<link rel="stylesheet" href="css/nmaprincesspi.css">
|
<link rel="stylesheet" href="css/nmaprincesspi.css">
|
||||||
<script src="js/nmaprincesspi.js"></script>
|
<script src="js/nmaprincesspi.js"></script>
|
||||||
<link rel="icon" type="css/img/" href="css/img/favicon.ico">
|
<link rel="icon" type="css/img/" href="css/img/favicon.ico">
|
||||||
<title>Princess Pi's Magical Nmapprincesspi Thingy!</title>
|
<title>Princess Pi's Magical Nmaprincesspi!</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Princess Pi's Magical Nmapprincesspi Thingy!</h1>
|
<h1>Princess Pi's Magical Nmaprincesspi!</h1>
|
||||||
<label for="nmapcmd">nmap command</label>
|
<a name="top"> </a>
|
||||||
<br>
|
<br>
|
||||||
<input type="text" id="nmapcmd" name="nmapcmd">
|
<form id="cmdform">
|
||||||
<input type="hidden" name="nonce" id="nonce" value="<?php echo $nonce; ?>">
|
<label for="nmapcmd">nmap command</label>
|
||||||
<input type="button" onclick="runNmapScan()" value="Go, Baby, Go!">
|
<input type="text" id="nmapcmd" name="nmapcmd">
|
||||||
|
<input type="hidden" name="nonce" id="nonce" value="<?php echo $nonce; ?>">
|
||||||
|
<input type="submit" value="Go, Baby, Go!">
|
||||||
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<span class="fakelink" id="showlist" onclick="toggleShow('scanlist', 'showlist', 'Hide Previous Scans', 'Show Previous Scans')">Show Previous Scans</span>
|
<span class="fakelink" id="showlist">Show Previous Scans</span> | <a href="https://nmap.org/book/man.html" target="_blank">Nmap Reference</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
<p class="hidden" id="link"></p>
|
<p class="hidden" id="link"></p>
|
||||||
<div id="scanlist" class="hidden">
|
<div id="scanlist" class="hidden">
|
||||||
@@ -38,5 +41,9 @@ foreach($scans as $scan) {
|
|||||||
<p>Progress<br>
|
<p>Progress<br>
|
||||||
<pre id="progressbox"></pre>
|
<pre id="progressbox"></pre>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="stickymenu">
|
||||||
|
<a href="#top">Top</a> | <a href="#bottom">Bottom</a>
|
||||||
|
</div>
|
||||||
|
<a name="bottom"> </a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+23
-10
@@ -11,25 +11,24 @@ function getID(ID) {
|
|||||||
|
|
||||||
function toggleShow(ID, htmlUpdateID=false, htmlUpdateShowing=false, htmlUpdateHidden=false) {
|
function toggleShow(ID, htmlUpdateID=false, htmlUpdateShowing=false, htmlUpdateHidden=false) {
|
||||||
let elemClasses = getID(ID).classList;
|
let elemClasses = getID(ID).classList;
|
||||||
|
var updating = false;
|
||||||
|
|
||||||
if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) {
|
if(htmlUpdateID !== false && htmlUpdateShowing !== false && htmlUpdateHidden !== false) {
|
||||||
const updating = true;
|
updating = true;
|
||||||
updateElem = getID(htmlUpdateID).innerHTML;
|
var updateElem = getID(htmlUpdateID);
|
||||||
} else {
|
}
|
||||||
const updating = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(elemClasses.contains('hidden')) {
|
if(elemClasses.contains('hidden')) {
|
||||||
elemClasses.remove('hidden');
|
elemClasses.remove('hidden');
|
||||||
|
|
||||||
if(updating) {
|
if(updating === true) {
|
||||||
updateElem = htmlUpdateShowing;
|
updateElem.innerHTML = htmlUpdateShowing;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
elemClasses.add('hidden');
|
elemClasses.add('hidden');
|
||||||
|
|
||||||
if(updating) {
|
if(updating === true) {
|
||||||
updateElem = htmlUpdateHidden;
|
updateElem.innerHTML = htmlUpdateHidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +103,7 @@ function xhrRunNmapScan(xhrRet) {
|
|||||||
clearInterval(pollInterval);
|
clearInterval(pollInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
getID('link').innerHTML = '<a href="'+xhrJson.webName+'">Scan Report ('+xhrJson.webName+')</a>';
|
getID('link').innerHTML = '<a href="'+xhrJson.webName+'" target="_blank">Scan Report ('+xhrJson.webName+')</a>';
|
||||||
getID('link').style.display = "inline";
|
getID('link').style.display = "inline";
|
||||||
|
|
||||||
getID('progressbox').innerHTML = '';
|
getID('progressbox').innerHTML = '';
|
||||||
@@ -133,3 +132,17 @@ function runNmapScan() {
|
|||||||
doXhr('run_scan.php', xhrRunNmapScan, 'POST', postData);
|
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');
|
||||||
|
});
|
||||||
|
}
|
||||||
+2
-2
@@ -13,9 +13,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$file_name = date("Ymd-Hi-s") . "-" . rand(1000000,9999999) . ".xml";
|
$file_name = date("Ymd-Hi-s") . "-" . rand(1000000,9999999) . ".xml";
|
||||||
$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 REPLACEMEFILLYFILLYFILLY $post_cmd";
|
||||||
$web_name = "/nmaprincesspi/scans/$file_name";
|
$web_name = "/nmaprincesspi/scans/$file_name";
|
||||||
|
|
||||||
$exec = trim(shell_exec($run_cmd));
|
$exec = trim(shell_exec($run_cmd));
|
||||||
echo "{\"runningLog\":\"$exec\",\"webName\":\"$web_name\"}";
|
echo "{\"runningLog\":\"$exec\",\"webName\":\"$web_name\"}";
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -7,19 +7,25 @@ x bug on second scan in progress pre
|
|||||||
error handling
|
error handling
|
||||||
nmap fail
|
nmap fail
|
||||||
php script fail
|
php script fail
|
||||||
input validation fail
|
x input validation fail
|
||||||
containerize
|
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 scans listing
|
||||||
x clear scans buttons
|
x clear scans buttons
|
||||||
x work on scans filename?
|
x work on scans filename?
|
||||||
fix perms
|
fix perms
|
||||||
auth system
|
x auth system
|
||||||
input/output validation
|
input/output validation
|
||||||
x escapeshellcmd
|
x escapeshellcmd
|
||||||
layout
|
layout
|
||||||
collums
|
collums
|
||||||
do not show scan list text when empty
|
do not show scan list text when empty
|
||||||
figure out some kinda command ran for anchor text on previous scans
|
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
|
work on princesspi-nmap.xsl
|
||||||
clean up
|
clean up
|
||||||
minimize stuff
|
minimize stuff
|
||||||
@@ -27,4 +33,10 @@ work on princesspi-nmap.xsl
|
|||||||
make prettier
|
make prettier
|
||||||
green class
|
green class
|
||||||
padding on table items
|
padding on table items
|
||||||
centering text on table headers
|
centering text on table headers
|
||||||
|
containerize
|
||||||
|
nmap docker?
|
||||||
|
perms?
|
||||||
|
script with sticky bit?
|
||||||
|
custom docker?
|
||||||
|
docker inside docker?
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
v0.5-dev
|
v0.6-dev
|
||||||
+1071
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user