mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
manual nmap scan improvements
3 options to do a scan. - fast (nmap -F) - normal - detailed (nmap -A)
This commit is contained in:
@@ -432,23 +432,34 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="tab-pane fade" id="panNmap">
|
<div class="tab-pane fade" id="panNmap">
|
||||||
|
<h4 class="">nmap Scans</h4>
|
||||||
<!-- Datatable Session -->
|
|
||||||
<div style="width:100%; text-align: center;">
|
<div style="width:100%; text-align: center;">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
document.getElementById('piamanualnmap').innerHTML='execute quick scan on ' + document.getElementById('txtLastIP').value;
|
document.getElementById('piamanualnmap_fast').innerHTML='Fast Scan (' + document.getElementById('txtLastIP').value +')';
|
||||||
|
document.getElementById('piamanualnmap_normal').innerHTML='Default Scan (' + document.getElementById('txtLastIP').value +')';
|
||||||
|
document.getElementById('piamanualnmap_detail').innerHTML='Detailed Scan (' + document.getElementById('txtLastIP').value +')';
|
||||||
}, 2000);
|
}, 2000);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button type="button" id="piamanualnmap" class="btn btn-default pa-btn" style="margin: auto;" onclick="loadDoc(document.getElementById('txtLastIP').value)">... loading</button>
|
<button type="button" id="piamanualnmap_fast" class="btn btn-default pa-btn" style="margin: auto;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'fast')">Loading...</button>
|
||||||
</div>
|
<button type="button" id="piamanualnmap_normal" class="btn btn-default pa-btn" style="margin: auto;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'normal')">Loading...</button>
|
||||||
|
<button type="button" id="piamanualnmap_detail" class="btn btn-default pa-btn" style="margin: auto;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'detail')">Loading...</button>
|
||||||
|
|
||||||
<div id="scanoutput" style="margin-top: 30px;"></div>
|
<div style="margin-top: 20px; text-align: left;">
|
||||||
|
<ul style="padding:20px;">
|
||||||
|
<li>Fast Scan: Scan fewer ports than the default scan (a few seconds)</li>
|
||||||
|
<li>Default Scan: By default, Nmap scans the top 1,000 ports for each scan protocol requested. This catches roughly 93% of the TCP ports and 49% of the UDP ports. (about 5 sconds)</li>
|
||||||
|
<li>Detailed Scan: Default scan with enabled OS detection, version detection, script scanning and traceroute (up to 30 seconds and more)</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="scanoutput" style="margin-top: 30px;"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function loadDoc(targetip) {
|
function manualnmapscan(targetip, mode) {
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
@@ -457,7 +468,7 @@
|
|||||||
};
|
};
|
||||||
xhttp.open("POST", "./php/server/nmap_scan.php", true);
|
xhttp.open("POST", "./php/server/nmap_scan.php", true);
|
||||||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
xhttp.send("scan=" + targetip);
|
xhttp.send("scan=" + targetip + '&mode=' + mode);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$PIA_HOST_IP = $_REQUEST['scan'];
|
$PIA_HOST_IP = $_REQUEST['scan'];
|
||||||
exec('nmap '.$PIA_HOST_IP, $output);
|
$PIA_SCAN_MODE = $_REQUEST['mode'];
|
||||||
echo 'Scan Results of the target: '.$PIA_HOST_IP;
|
|
||||||
|
if ($PIA_SCAN_MODE == 'fast') {
|
||||||
|
exec('nmap -F '.$PIA_HOST_IP, $output);
|
||||||
|
} elseif ($PIA_SCAN_MODE == 'normal') {
|
||||||
|
exec('nmap '.$PIA_HOST_IP, $output);
|
||||||
|
} elseif ($PIA_SCAN_MODE == 'detail') {
|
||||||
|
exec('nmap -A '.$PIA_HOST_IP, $output);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<h4>Scan ('.$PIA_SCAN_MODE.') Results of: '.$PIA_HOST_IP.'</h4>';
|
||||||
echo '<pre style="border: none;">';
|
echo '<pre style="border: none;">';
|
||||||
foreach($output as $line){
|
foreach($output as $line){
|
||||||
echo $line . "\n";
|
echo $line . "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user