Compare commits

...

11 Commits

Author SHA1 Message Date
PrincessPi e1a16e6f1d v0.6-dev 2026-06-04 15:46:54 -06:00
PrincessPi 4e2ab5b0da migration 2026-05-26 20:51:40 -06:00
PrincessPi cb7d872b34 sorry dude i learned all my sex moves in china, you can not defeat me 2026-02-26 19:39:37 -07:00
PrincessPi 1b696d4cb7 initial commit via gitinitshit 2026-02-26 19:35:58 -07:00
PrincessPi be26f6eb47 v0.6-dev 2025-08-09 06:30:56 -06:00
PrincessPi eed57dad2f v0.6-dev 2025-08-09 06:27:18 -06:00
PrincessPi 22c37748e3 wooo 2025-06-07 16:04:20 -06:00
PrincessPi 2ddaa79706 v0.6-dev 2025-05-15 21:13:59 -06:00
PrincessPi 79f4caf9dd v0.5-dev 2025-05-15 19:45:27 -06:00
PrincessPi 9a0b7e951d v0.5-dev 2025-05-15 19:44:40 -06:00
PrincessPi 69c13606df v0.5-dev 2025-05-15 19:32:35 -06:00
16 changed files with 2302 additions and 144 deletions
+1
View File
@@ -3,3 +3,4 @@ logs/*
scratch* scratch*
*.bak* *.bak*
*.old* *.old*
*tmp*
+4
View File
@@ -0,0 +1,4 @@
AuthUserFile /etc/apache2/.htpasswd
AuthType Basic
AuthName "My restricted Area"
Require valid-user
+5
View File
@@ -6,3 +6,8 @@ add alias to .zshrc or .basrc
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
+6
View File
@@ -19,3 +19,9 @@ 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
+6
View File
@@ -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;
+1 -1
View File
@@ -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"
+12 -5
View File
@@ -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">&nbsp;</a>
<br> <br>
<form id="cmdform">
<label for="nmapcmd">nmap command</label>
<input type="text" id="nmapcmd" name="nmapcmd"> <input type="text" id="nmapcmd" name="nmapcmd">
<input type="hidden" name="nonce" id="nonce" value="<?php echo $nonce; ?>"> <input type="hidden" name="nonce" id="nonce" value="<?php echo $nonce; ?>">
<input type="button" onclick="runNmapScan()" value="Go, Baby, Go!"> <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">&nbsp;</a>
</body> </body>
</html> </html>
+22 -9
View File
@@ -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');
});
}
View File
+1 -1
View File
@@ -13,7 +13,7 @@
} }
$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));
+15 -3
View File
@@ -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
@@ -28,3 +34,9 @@ work on princesspi-nmap.xsl
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
View File
@@ -1 +1 @@
v0.5-dev v0.6-dev
+125 -116
View File
@@ -65,14 +65,6 @@
<xsl:comment>generated with nmap.xsl - version <xsl:value-of select="$nmap_xsl_version" /> by Benjamin Erb - http://www.benjamin-erb.de/nmap_xsl.php </xsl:comment> <xsl:comment>generated with nmap.xsl - version <xsl:value-of select="$nmap_xsl_version" /> by Benjamin Erb - http://www.benjamin-erb.de/nmap_xsl.php </xsl:comment>
<style type="text/css"> <style type="text/css">
@font-face {
font-family: "Comic-Code-Regular";
src: url("/nmaprincesspi/css/fonts/Comic-Code-Regular.ttf"),
url("/nmaprincesspi/css/fonts/Comic-Code-Regular.woff"),
url("/nmaprincesspi/css/fonts/Comic-Code-Regular.otf");
}
/* stylesheet print */ /* stylesheet print */
@media print @media print
{ {
@@ -81,56 +73,55 @@
} }
body { body {
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
background-color: #FFDDDD;
} }
h1 { h1 {
font-size: 13pt; font-size: 13pt;
font-weight: bold; font-weight:bold;
margin: 4pt 0 0 0; margin:4pt 0pt 0pt 0pt;
padding: 0; padding:0;
} }
h2 { h2 {
font-size: 12pt; font-size: 12pt;
font-weight: bold; font-weight:bold;
margin: 3pt 0 0 0p margin:3pt 0pt 0pt 0pt;
padding: 0; padding:0;
} }
h3, a:link, a:visited { h3, a:link, a:visited {
font-size: 9pt; font-size: 9pt;
font-weight: bold; font-weight:bold;
margin: 1pt 0 0 20pt; margin:1pt 0pt 0pt 20pt;
padding: 0; padding:0;
text-decoration: none; text-decoration: none;
color: #800080; color: #000000;
} }
p,ul { p,ul {
font-size: 9pt; font-size: 9pt;
margin: 1pt 0 8pt 40pt; margin:1pt 0pt 8pt 40pt;
padding: 0; padding:0;
text-align: left; text-align:left;
} }
li { li {
font-size: 9pt; font-size: 9pt;
margin: 0; margin:0;
padding: 0; padding:0;
text-align: left; text-align:left;
} }
table { table {
margin:1pt 0pt 8pt 40pt; margin:1pt 0pt 8pt 40pt;
border: 0; border:0px;
width: 90% width:90%
} }
td { td {
border: 0; border:0px;
border-top: 1px solid #FFB4C0; border-top:1px solid black;
font-size: 9pt; font-size: 9pt;
} }
@@ -146,109 +137,109 @@
@media screen @media screen
{ {
body { body {
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
background-image: url('/nmaprincesspi/css/img/princesspi-large-alpha-transparency-more-faded.png'); margin: 0px;
background-repeat: no-repeat; background-color: #FFFFFF;
background-color: #FFDDDD; color: #000000;
margin: 0;
color: #800080;
text-align: center; text-align: center;
} }
#container { #container {
text-align: left; text-align:left;
margin: 10px auto; margin: 10px auto;
width: 90%; width: 90%;
} }
h1 { h1 {
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-weight: bold; font-weight:bold;
font-size: 2em; font-size: 14pt;
color: #800080; color: #FFFFFF;
background-color: #FFB4C0; background-color:#2A0D45;
margin: 10px 0 0 0; margin:10px 0px 0px 0px;
padding: 5px 4px 5px 4px; padding:5px 4px 5px 4px;
width: 100%; width: 100%;
border:1px solid #FFB4C0; border:1px solid black;
text-align: left; text-align: left;
} }
h2 { h2 {
font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-weight:bold; font-weight:bold;
font-size: 1.7em; font-size: 11pt;
color: #800080; color: #000000;
margin:30px 0px 0px 0px; margin:30px 0px 0px 0px;
padding:4px; padding:4px;
width: 100%; width: 100%;
background-color: #FFB4C0; background-color:#F0F8FF;
text-align: left; text-align: left;
} }
h2.green { h2.green {
color: #800080; color: #000000;
background-color: #FFEEEE; background-color:#CCFFCC;
border-color: #800080; border-color:#006400;
} }
h2.red { h2.red {
color: #800080; color: #000000;
background-color: #FFCCCC; background-color:#FFCCCC;
border-color: #800080; border-color:#8B0000;
} }
h3 { h3 {
font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-weight:bold; font-weight:bold;
font-size: 1.5em; font-size: 10pt;
color: #800080; color:#000000;
background-color: #FFB4C0; background-color: #FFFFFF;
width: 75%; width: 75%;
text-align: left; text-align: left;
} }
p { p {
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-size: 1em; font-size: 8pt;
color: #800080; color:#000000;
background-color: #FFB4C0; background-color: #FFFFFF;
width: 75%; width: 75%;
text-align: left; text-align: left;
} }
p i { p i {
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-size: 1em; font-size: 8pt;
color: #800080; color:#000000;
background-color: #FFEEEE; background-color: #CCCCCC;
} }
ul { ul {
font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-size: 1em; font-size: 8pt;
color: #800080; color:#000000;
background-color: #FFB4C0; background-color: #FFFFFF;
width: 75%; width: 75%;
text-align: left; text-align: left;
} }
a { a {
font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
text-decoration: none; text-decoration: none;
font-size: 1em; font-size: 8pt;
font-weight: bold; color:#000000;
background-color: #FFB4C0; font-weight:bold;
color: #800080; background-color: #FFFFFF;
color: #000000;
} }
li a { li a {
font-family: "Comic-Code-Regular","Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
text-decoration: none; text-decoration: none;
font-size: 1em; font-size: 10pt;
font-weight: bold; color:#000000;
background-color: #FFB4C0; font-weight:bold;
color: #800080; background-color: #FFFFFF;
color: #000000;
} }
a:hover { a:hover {
@@ -256,77 +247,96 @@
} }
a.up { a.up {
color: #800080; color:#006400;
} }
table { table {
width: 80%; width: 80%;
border: 0; border:0px;
margin: 10px; color: #000000;
color: #800080; background-color: #000000;
background-color: #FFB4C0; margin:10px;
} }
tr { tr {
vertical-align:top; vertical-align:top;
font-family: "Comic-Code-Regular", "Comic Sans MS", "Comic Sans", sans-serif; font-family: Verdana, Helvetica, sans-serif;
font-size: 1em; font-size: 8pt;
color: #800080; color:#000000;
background-color: #FFB4C0; background-color: #FFFFFF;
} }
tr.head { tr.head {
background-color: #FFEEEE; background-color: #E1E1E1;
color: #800080; color: #000000;
font-weight: bold; font-weight:bold;
} }
tr.open { tr.open {
background-color: #FFEEEE; background-color: #CCFFCC;
color: #800080; color: #000000;
} }
tr.script { tr.script {
background-color: #FFDDDD; background-color: #EFFFF7;
color: #800080; color: #000000;
} }
tr.filtered { tr.filtered {
background-color: #FFDDDD; background-color: #F2F2F2;
color: #800080; color: #000000;
} }
tr.closed { tr.closed {
background-color: #FFDDDD; background-color: #F2F2F2;
color: #800080; color: #000000;
} }
td { td {
padding: 2px; padding:2px;
} }
#menu li { #menu li {
display: inline; display : inline;
margin: 0; margin : 0;
padding: 0; /*margin-right : 10px;*/
list-style-type: none; padding : 0;
list-style-type : none;
} }
#menubox { #menubox {
position: fixed; position: fixed;
bottom: 0; bottom: 0px;
right: 0; right: 0px;
width: 120px; width: 120px;
} }
<![CDATA[
/* This section handle's IE's refusal to honor the fixed CSS attribute */
* html div#menubox {
position: absolute;
top:expression(eval(
document.compatMode && document.compatMode=='CSS1Compat') ?
documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight)
: document.body.scrollTop +(document.body.clientHeight-this.clientHeight));
}
/* This fixes the jerky effect when scrolling in IE*/
* html,* html body {
background: #fff url(nosuchfile) fixed;
}
]]>
.up { .up {
color: #800080; color: #000000;
background-color: #FFEEEE; background-color:#CCFFCC;
} }
.down { .down {
color: #800080; color:#626262;
background-color: #FFEEEE; background-color: #F2F2F2;
} }
.print_only { display: none; } .print_only { display: none; }
@@ -336,9 +346,8 @@
} }
</style> </style>
<title>Princess Pi's Magical Nmap Scan Report! - Scanned at <xsl:value-of select="$start" /></title> <title>Nmap Scan Report - Scanned at <xsl:value-of select="$start" /></title>
<link rel="icon" href="https://h.acker.is/nmaprincesspi/img/favicon.ico" type="image/x-icon" />
<link rel="icon" type="image/x-icon" href="/nmaprincesspi/css/img/favicon.ico" />
<script type="text/javascript"> <script type="text/javascript">
@@ -389,7 +398,7 @@
<a name="top" /> <a name="top" />
<div id="container"> <div id="container">
<h1>Princess Pi's Magical Nmap Scan Report! - Scanned at <xsl:value-of select="$start" /></h1> <h1>Nmap Scan Report - Scanned at <xsl:value-of select="$start" /></h1>
<ul id="menu"> <ul id="menu">
<li><a href="#scansummary">Scan Summary</a></li> <li><a href="#scansummary">Scan Summary</a></li>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long