From 06a21f139322c56ad322928b5ee3025ac33e3e58 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 25 Jun 2012 20:39:09 -0400 Subject: Fixup nmap for ipv6, bump version --- config/nmap/nmap.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'config/nmap') diff --git a/config/nmap/nmap.inc b/config/nmap/nmap.inc index e9093077..a2c0f8cf 100644 --- a/config/nmap/nmap.inc +++ b/config/nmap/nmap.inc @@ -30,6 +30,11 @@ function nmap_custom_add_php_command() { $nmap_options = ""; + + if (function_exists("is_ipaddrv6") && function_exists("is_subnetv6")) + if (is_ipaddrv6($_POST['hostname']) || is_subnetv6($_POST['hostname'])) + $nmap_options .= " -6"; + switch($_POST['scanmethod']) { case 'syn': $nmap_options .= " -sS"; @@ -48,7 +53,8 @@ function nmap_custom_add_php_command() { if($_POST['noping']) $nmap_options .= " -P0"; if($_POST['servicever']) $nmap_options .= " -sV"; if($_POST['osdetect']) $nmap_options .= " -O"; - $nmap_options .= " " . $_POST['hostname']; + + $nmap_options .= " " . escapeshellarg($_POST['hostname']); system("/usr/local/bin/nmap" . $nmap_options); } -- cgit v1.2.3