From 900e16a3b17b108971d063558955eda16edc637a Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 15 Nov 2015 14:21:59 +0100 Subject: Add privileges configuration to nmap package --- config/nmap/nmap.priv.inc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 config/nmap/nmap.priv.inc (limited to 'config/nmap') diff --git a/config/nmap/nmap.priv.inc b/config/nmap/nmap.priv.inc new file mode 100644 index 00000000..131d6d99 --- /dev/null +++ b/config/nmap/nmap.priv.inc @@ -0,0 +1,37 @@ + -- cgit v1.2.3 From 088e90e3102e4e2c2d2c7fdae0f26a31978ea767 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 15 Nov 2015 14:24:26 +0100 Subject: Add privileges configuration to nmap package Improve descriptions while here. --- config/nmap/nmap.xml | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'config/nmap') diff --git a/config/nmap/nmap.xml b/config/nmap/nmap.xml index 446ba461..665b40e9 100644 --- a/config/nmap/nmap.xml +++ b/config/nmap/nmap.xml @@ -42,7 +42,7 @@ ]]> nmap - 1.4 + 1.4.1 Diagnostics: NMap Scan yes @@ -50,7 +50,6 @@ /usr/local/pkg/nmap.inc NMap - NMap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques (determine what services the hosts are offering), version detection (determine what application/service is runing on a port), and TCP/IP fingerprinting (remote host OS or device identification). It also offers flexible target and port specification, decoy/stealth scanning, SunRPC scanning, and more. Most Unix and Windows platforms are supported in both GUI and command line modes. Several popular handheld devices are also supported, including the Sharp Zaurus and the iPAQ.
Diagnostics
nmap.xml
@@ -58,6 +57,10 @@ /usr/local/pkg/ https://packages.pfsense.org/packages/config/nmap/nmap.inc + + /etc/inc/priv/ + https://packages.pfsense.org/packages/config/nmap/nmap.priv.inc + IP or Hostname @@ -68,7 +71,7 @@ Interface interface - Enter the source interface here. + Select the source interface here. select_source name @@ -86,28 +89,44 @@ - Scan method + Select scan method. -P0 noping - This allows the scanning of networks that don't allow ICMP echo requests (or responses) through their firewall. microsoft.com is an example of such a network, and thus you should always use -P0 or -PT80 when port scanning microsoft.com. Note the "ping" in this context may involve more than the traditional ICMP echo request packet. Nmap supports many such probes, including arbitrary combinations of TCP, UDP, and ICMP probes. By default, Nmap sends an ICMP echo request and a TCP ACK packet to port 80. + + + microsoft.com is an example of such a network, and thus you should always use -P0 or -PT80 when port scanning microsoft.com.
+ Note the "ping" in this context may involve more than the traditional ICMP echo request packet. Nmap supports many such probes, including arbitrary combinations of TCP, UDP, and ICMP probes.
+ By default, Nmap sends an ICMP echo request and a TCP ACK packet to port 80. + ]]> +
checkbox - Do not try to ping hosts at all before scanning them.
-sV servicever - After TCP and/or UDP ports are discovered using one of the other scan methods, version detection communicates with those ports to try and determine more about what is actually running. A file called nmap-service-probes is used to determine the best probes for detecting various services and the match strings to expect. Nmap tries to determine the service protocol (e.g. ftp, ssh, telnet, http), the application name (e.g. ISC Bind, Apache httpd, Solaris telnetd), the version number, and sometimes miscellaneous details like whether an X server is open to connections or the SSH protocol version). + + + A file called nmap-service-probes is used to determine the best probes for detecting various services and the match strings to expect.
+ Nmap tries to determine the service protocol (e.g. ftp, ssh, telnet, http), the application name (e.g. ISC Bind, Apache httpd, Solaris telnetd), the version number, and sometimes miscellaneous details like whether an X server is open to connections or the SSH protocol version). + ]]> +
checkbox - Try to identify service versions.
-O osdetect - This option activates remote host identification via TCP/IP fingerprinting. In other words, it uses a bunch of techniques to detect subtleties in the underlying operating system network stack of the computers you are scanning. It uses this information to create a "fingerprint" which it compares with its database of known OS fingerprints (the nmap-os-fingerprints file) to decide what type of system you are scanning. + + + In other words, it uses a bunch of techniques to detect subtleties in the underlying operating system network stack of the computers you are scanning.
+ It uses this information to create a "fingerprint" which it compares with its database of known OS fingerprints (the nmap-os-fingerprints file) to decide what type of system you are scanning. + ]]> +
checkbox - Turn on OS detection.
@@ -119,4 +138,7 @@ nmap_install(); + + nmap_deinstall(); + -- cgit v1.2.3 From a82eb1b5a23ff9e44bb8acf3ce0d396a1731f3b1 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 15 Nov 2015 14:29:49 +0100 Subject: Remove created symlink on uninstall, clean up input validations, code style fixes --- config/nmap/nmap.inc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'config/nmap') diff --git a/config/nmap/nmap.inc b/config/nmap/nmap.inc index cbf1b15a..9d867770 100644 --- a/config/nmap/nmap.inc +++ b/config/nmap/nmap.inc @@ -30,7 +30,7 @@ function nmap_install() { $destination_file = "/usr/local/share/nmap/nmap-mac-prefixes"; - $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); switch ($pfs_version) { case "2.1": $source_file = "/usr/pbi/nmap-" . php_uname("m") . "/share/nmap/nmap-mac-prefixes"; @@ -48,17 +48,23 @@ function nmap_install() { } } +function nmap_deinstall() { + $destination_file = "/usr/local/share/nmap/nmap-mac-prefixes"; + if (is_link($destination_file)) { + @unlink($destination_file); + } +} + function nmap_custom_php_validation_command($post, &$input_errors) { - global $_POST, $savemsg, $config; - if (empty($_POST['hostname'])) { + if (empty($post['hostname'])) { $input_errors[] = gettext("You must enter an IP address to scan."); - } elseif (!(is_ipaddr($_POST['hostname']) || is_subnet($_POST['hostname']) || is_hostname($_POST['hostname']))) { + } elseif (!(is_ipaddr($post['hostname']) || is_subnet($post['hostname']) || is_hostname($post['hostname']))) { $input_errors[] = gettext("You must enter a valid IP address to scan."); } - if(!empty($_POST['interface'])) { + if(!empty($post['interface'])) { $interfaces = get_configured_interface_with_descr(); - if (!array_key_exists($_POST['interface'], $interfaces)) { + if (!array_key_exists($post['interface'], $interfaces)) { $input_errors[] = gettext("Invalid interface."); } } @@ -122,7 +128,7 @@ function nmap_get_interfaces() { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { if (!isset($setting['disable'])) { - $tmp["name"] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']); + $tmp["name"] = gettext("OpenVPN") . " " . $mode . ": " . htmlspecialchars($setting['description']); $tmp["value"] = 'ovpn' . substr($mode, 0, 1) . $setting['vpnid']; $nmap_ifs[] = $tmp; } -- cgit v1.2.3 From 7d6e761a13c8ac2c1f6de46604b155bd2792ae92 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 15 Nov 2015 15:18:17 +0100 Subject: Add missing includes --- config/nmap/nmap.inc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config/nmap') diff --git a/config/nmap/nmap.inc b/config/nmap/nmap.inc index 9d867770..45a87d64 100644 --- a/config/nmap/nmap.inc +++ b/config/nmap/nmap.inc @@ -27,6 +27,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +require_once("pkg-utils.inc"); +require_once("util.inc"); function nmap_install() { $destination_file = "/usr/local/share/nmap/nmap-mac-prefixes"; -- cgit v1.2.3