manual nmap scan

a little less PHP/POST and a little more JS. the nmap scan now also works via the presence page
This commit is contained in:
leiweibau
2022-06-28 23:04:14 +02:00
parent 334eea8592
commit 169d69251c
3 changed files with 11 additions and 4 deletions

View File

@@ -436,13 +436,19 @@
<!-- Datatable Session -->
<div style="width:100%; text-align: center;">
<button type="button" class="btn btn-default pa-btn" style="margin: auto;" onclick="loadDoc()">execute quick scan on <?php echo $_REQUEST['lastip'];?></button>
<script>
setTimeout(function(){
document.getElementById('piamanualnmap').innerHTML='execute quick scan on ' + document.getElementById('txtLastIP').value;
}, 2000);
</script>
<button type="button" id="piamanualnmap" class="btn btn-default pa-btn" style="margin: auto;" onclick="loadDoc(document.getElementById('txtLastIP').value)">... loading</button>
</div>
<div id="scanoutput" style="margin-top: 30px;"></div>
<script>
function loadDoc() {
function loadDoc(targetip) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
@@ -451,7 +457,7 @@
};
xhttp.open("POST", "./php/server/nmap_scan.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("scan=<?php echo $_REQUEST['lastip'];?>");
xhttp.send("scan=" + targetip);
}
</script>