mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
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:
@@ -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>
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ function initializeDatatable () {
|
||||
// Device Name
|
||||
{targets: [0],
|
||||
'createdCell': function (td, cellData, rowData, row, col) {
|
||||
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[10] +'&lastip='+ rowData[7] +'" class="">'+ cellData +'</a></b>');
|
||||
$(td).html ('<b><a href="deviceDetails.php?mac='+ rowData[10] +'" class="">'+ cellData +'</a></b>');
|
||||
} },
|
||||
|
||||
// Favorite
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
$PIA_HOST_IP = $_REQUEST['scan'];
|
||||
exec('nmap '.$PIA_HOST_IP, $output);
|
||||
echo 'Scan Results of the target: '.$PIA_HOST_IP;
|
||||
echo '<pre style="border: none;">';
|
||||
foreach($output as $line){
|
||||
echo $line . "\n";
|
||||
|
||||
Reference in New Issue
Block a user