{"id":3080,"date":"2012-11-28T12:18:01","date_gmt":"2012-11-28T04:18:01","guid":{"rendered":"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3080"},"modified":"2012-11-28T12:18:01","modified_gmt":"2012-11-28T04:18:01","slug":"nmap-usage","status":"publish","type":"post","link":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=3080","title":{"rendered":"nmap usage"},"content":{"rendered":"<h2>#1: Scan a single host or an IP address (IPv4)<\/h2>\n<pre>### Scan a single ip address ###\r\nnmap 192.168.1.1\r\n\r\n## Scan a host name ###\r\nnmap server1.cyberciti.biz\r\n\r\n## Scan a host name with more info###\r\nnmap -v server1.cyberciti.biz<\/pre>\n<p>Sample outputs:<\/p>\n<div><a href=\"http:\/\/www.cyberciti.biz\/faq\/howto-install-nmap-on-centos-rhel-redhat-enterprise-linux\/\"><img loading=\"lazy\" decoding=\"async\" title=\"Fig.01: nmap output\" src=\"http:\/\/s0.cyberciti.org\/uploads\/faq\/2012\/11\/redhat-nmap-command-output.png\" alt=\"Fig.01: nmap output\" width=\"592\" height=\"176\" \/><\/a>Fig.01: nmap output<\/p>\n<\/div>\n<h2>#2: Scan multiple IP address or subnet (IPv4)<\/h2>\n<pre>nmap 192.168.1.1 192.168.1.2 192.168.1.3\r\n## works with same subnet i.e. 192.168.1.0\/24\r\nnmap 192.168.1.1,2,3<\/pre>\n<p>You can scan a range of IP address too:<\/p>\n<pre>nmap 192.168.1.1-20<\/pre>\n<p>You can scan a range of IP address using a wildcard:<\/p>\n<pre>nmap 192.168.1.*<\/pre>\n<p>Finally, you scan an entire subnet:<\/p>\n<pre>nmap 192.168.1.0\/24<\/pre>\n<h2>#3: Read list of hosts\/networks from a file (IPv4)<\/h2>\n<p>The -iL option allows you to read the list of target systems using a text file. This is useful to scan a large number of hosts\/networks. Create a text file as follows:<br \/>\n<code>cat &gt; \/tmp\/test.txt<\/code><br \/>\nSample outputs:<\/p>\n<pre>server1.cyberciti.biz\r\n192.168.1.0\/24\r\n192.168.1.1\/24\r\n10.1.2.3\r\nlocalhost<\/pre>\n<p>The syntax is:<\/p>\n<pre>nmap -iL \/tmp\/test.txt<\/pre>\n<h2>#4: Excluding hosts\/networks (IPv4)<\/h2>\n<p>When scanning a large number of hosts\/networks you can exclude hosts from a scan:<\/p>\n<pre>nmap 192.168.1.0\/24 --exclude 192.168.1.5\r\nnmap 192.168.1.0\/24 --exclude 192.168.1.5,192.168.1.254<\/pre>\n<p>OR exclude list from a file called \/tmp\/exclude.txt<\/p>\n<pre>nmap -iL \/tmp\/scanlist.txt --excludefile \/tmp\/exclude.txt<\/pre>\n<h2>#5: Turn on OS and version detection scanning script (IPv4)<\/h2>\n<pre>nmap -A 192.168.1.254\r\nnmap -v -A 192.168.1.1\r\nnmap -A -iL \/tmp\/scanlist.txt<\/pre>\n<h2>#6: Find out if a host\/network is protected by a firewall<\/h2>\n<pre>nmap -sA 192.168.1.254\r\nnmap -sA server1.cyberciti.biz<\/pre>\n<h2>#7: Scan a host when protected by the firewall<\/h2>\n<pre>nmap -PN 192.168.1.1\r\nnmap -PN server1.cyberciti.biz<\/pre>\n<h2>#8: Scan an IPv6 host\/address<\/h2>\n<p>The <kbd>-6<\/kbd> option enable IPv6 scanning. The syntax is:<\/p>\n<pre>nmap -6 IPv6-Address-Here\r\nnmap -6 server1.cyberciti.biz\r\nnmap -6 2607:f0d0:1002:51::4\r\nnmap -v A -6 2607:f0d0:1002:51::4<\/pre>\n<h2>#9: Scan a network and find out which servers and devices are up and running<\/h2>\n<p>This is known as host discovery or ping scan:<\/p>\n<pre>nmap -sP 192.168.1.0\/24<\/pre>\n<p>Sample outputs:<\/p>\n<pre>Host 192.168.1.1 is up (0.00035s latency).\r\nMAC Address: BC:AE:C5:C3:16:93 (Unknown)\r\nHost 192.168.1.2 is up (0.0038s latency).\r\nMAC Address: 74:44:01:40:57:FB (Unknown)\r\nHost 192.168.1.5 is up.\r\nHost nas03 (192.168.1.12) is up (0.0091s latency).\r\nMAC Address: 00:11:32:11:15:FC (Synology Incorporated)\r\nNmap done: 256 IP addresses (4 hosts up) scanned in 2.80 second<\/pre>\n<h2>#10: How do I perform a fast scan?<\/h2>\n<pre>nmap -F 192.168.1.1<\/pre>\n<h2>#11: Display the reason a port is in a particular state<\/h2>\n<pre>nmap --reason 192.168.1.1\r\nnmap --reason server1.cyberciti.biz<\/pre>\n<h2>#12: Only show open (or possibly open) ports<\/h2>\n<pre>nmap --open 192.168.1.1\r\nnmap --open server1.cyberciti.biz<\/pre>\n<h2>#13: Show all packets sent and received<\/h2>\n<pre>nmap --packet-trace 192.168.1.1\r\nnmap --packet-trace server1.cyberciti.biz<\/pre>\n<h2>14#: Show host interfaces and routes<\/h2>\n<p>This is useful for debugging (<a href=\"http:\/\/www.cyberciti.biz\/faq\/howto-linux-configuring-default-route-with-ipcommand\/\">ip command<\/a> or <a href=\"http:\/\/www.cyberciti.biz\/faq\/what-is-a-routing-table\/\">route command<\/a> or <a href=\"http:\/\/www.cyberciti.biz\/faq\/linux-unix-open-ports\/\">netstat command<\/a> like output using nmap)<\/p>\n<pre>nmap --iflist<\/pre>\n<p>Sample outputs:<\/p>\n<pre>Starting Nmap 5.00 ( http:\/\/nmap.org ) at 2012-11-27 02:01 IST\r\n************************INTERFACES************************\r\nDEV    (SHORT)  IP\/MASK          TYPE        UP MAC\r\nlo     (lo)     127.0.0.1\/8      loopback    up\r\neth0   (eth0)   192.168.1.5\/24   ethernet    up B8:AC:6F:65:31:E5\r\nvmnet1 (vmnet1) 192.168.121.1\/24 ethernet    up 00:50:56:C0:00:01\r\nvmnet8 (vmnet8) 192.168.179.1\/24 ethernet    up 00:50:56:C0:00:08\r\nppp0   (ppp0)   10.1.19.69\/32    point2point up\r\n\r\n**************************ROUTES**************************\r\nDST\/MASK         DEV    GATEWAY\r\n10.0.31.178\/32   ppp0\r\n209.133.67.35\/32 eth0   192.168.1.2\r\n192.168.1.0\/0    eth0\r\n192.168.121.0\/0  vmnet1\r\n192.168.179.0\/0  vmnet8\r\n169.254.0.0\/0    eth0\r\n10.0.0.0\/0       ppp0\r\n0.0.0.0\/0        eth0   192.168.1.2<\/pre>\n<h2>#15: How do I scan specific ports?<\/h2>\n<pre>map -p [port] hostName\r\n## Scan port 80\r\nnmap -p 80 192.168.1.1\r\n\r\n## Scan TCP port 80\r\nnmap -p T:80 192.168.1.1\r\n\r\n## Scan UDP port 53\r\nnmap -p U:53 192.168.1.1\r\n\r\n## Scan two ports ##\r\nnmap -p 80,443 192.168.1.1\r\n\r\n## Scan port ranges ##\r\nnmap -p 80-200 192.168.1.1\r\n\r\n## Combine all options ##\r\nnmap -p U:53,111,137,T:21-25,80,139,8080 192.168.1.1\r\nnmap -p U:53,111,137,T:21-25,80,139,8080 server1.cyberciti.biz\r\nnmap -v -sU -sT -p U:53,111,137,T:21-25,80,139,8080 192.168.1.254\r\n\r\n## Scan all ports with * wildcard ##\r\nnmap -p \"*\" 192.168.1.1\r\n\r\n## Scan top ports i.e. scan $number most common ports ##\r\nnmap --top-ports 5 192.168.1.1\r\nnmap --top-ports 10 192.168.1.1<\/pre>\n<p>Sample outputs:<\/p>\n<pre>Starting Nmap 5.00 ( http:\/\/nmap.org ) at 2012-11-27 01:23 IST\r\nInteresting ports on 192.168.1.1:\r\nPORT     STATE  SERVICE\r\n21\/tcp   closed ftp\r\n22\/tcp   open   ssh\r\n23\/tcp   closed telnet\r\n25\/tcp   closed smtp\r\n80\/tcp   open   http\r\n110\/tcp  closed pop3\r\n139\/tcp  closed netbios-ssn\r\n443\/tcp  closed https\r\n445\/tcp  closed microsoft-ds\r\n3389\/tcp closed ms-term-serv\r\nMAC Address: BC:AE:C5:C3:16:93 (Unknown)\r\n\r\nNmap done: 1 IP address (1 host up) scanned in 0.51 seconds<\/pre>\n<h2>#16: The fastest way to scan all your devices\/computers for open ports ever<\/h2>\n<pre>nmap -T5 192.168.1.0\/24<\/pre>\n<h2>#17: How do I detect remote operating system?<\/h2>\n<p>You can <a href=\"http:\/\/www.cyberciti.biz\/faq\/identify-remote-host-by-unix-linux-command\/\">identify a remote host apps and OS using the -O option<\/a>:<\/p>\n<pre>\u00a0\r\nnmap -O 192.168.1.1\r\nnmap -O  --osscan-guess 192.168.1.1\r\nnmap -v -O --osscan-guess 192.168.1.1<\/pre>\n<p>Sample outputs:<\/p>\n<pre>Starting Nmap 5.00 ( http:\/\/nmap.org ) at 2012-11-27 01:29 IST\r\nNSE: Loaded 0 scripts for scanning.\r\nInitiating ARP Ping Scan at 01:29\r\nScanning 192.168.1.1 [1 port]\r\nCompleted ARP Ping Scan at 01:29, 0.01s elapsed (1 total hosts)\r\nInitiating Parallel DNS resolution of 1 host. at 01:29\r\nCompleted Parallel DNS resolution of 1 host. at 01:29, 0.22s elapsed\r\nInitiating SYN Stealth Scan at 01:29\r\nScanning 192.168.1.1 [1000 ports]\r\nDiscovered open port 80\/tcp on 192.168.1.1\r\nDiscovered open port 22\/tcp on 192.168.1.1\r\nCompleted SYN Stealth Scan at 01:29, 0.16s elapsed (1000 total ports)\r\nInitiating OS detection (try #1) against 192.168.1.1\r\nRetrying OS detection (try #2) against 192.168.1.1\r\nRetrying OS detection (try #3) against 192.168.1.1\r\nRetrying OS detection (try #4) against 192.168.1.1\r\nRetrying OS detection (try #5) against 192.168.1.1\r\nHost 192.168.1.1 is up (0.00049s latency).\r\nInteresting ports on 192.168.1.1:\r\nNot shown: 998 closed ports\r\nPORT   STATE SERVICE\r\n22\/tcp open  ssh\r\n80\/tcp open  http\r\nMAC Address: BC:AE:C5:C3:16:93 (Unknown)\r\nDevice type: WAP|general purpose|router|printer|broadband router\r\nRunning (JUST GUESSING) : Linksys Linux 2.4.X (95%), Linux 2.4.X|2.6.X (94%), MikroTik RouterOS 3.X (92%), Lexmark embedded (90%), Enterasys embedded (89%), D-Link Linux 2.4.X (89%), Netgear Linux 2.4.X (89%)\r\nAggressive OS guesses: OpenWrt White Russian 0.9 (Linux 2.4.30) (95%), OpenWrt 0.9 - 7.09 (Linux 2.4.30 - 2.4.34) (94%), OpenWrt Kamikaze 7.09 (Linux 2.6.22) (94%), Linux 2.4.21 - 2.4.31 (likely embedded) (92%), Linux 2.6.15 - 2.6.23 (embedded) (92%), Linux 2.6.15 - 2.6.24 (92%), MikroTik RouterOS 3.0beta5 (92%), MikroTik RouterOS 3.17 (92%), Linux 2.6.24 (91%), Linux 2.6.22 (90%)\r\nNo exact OS matches for host (If you know what OS is running on it, see http:\/\/nmap.org\/submit\/ ).\r\nTCP\/IP fingerprint:\r\nOS:SCAN(V=5.00%D=11\/27%OT=22%CT=1%CU=30609%PV=Y%DS=1%G=Y%M=BCAEC5%TM=50B3CA\r\nOS:4B%P=x86_64-unknown-linux-gnu)SEQ(SP=C8%GCD=1%ISR=CB%TI=Z%CI=Z%II=I%TS=7\r\nOS:)OPS(O1=M2300ST11NW2%O2=M2300ST11NW2%O3=M2300NNT11NW2%O4=M2300ST11NW2%O5\r\nOS:=M2300ST11NW2%O6=M2300ST11)WIN(W1=45E8%W2=45E8%W3=45E8%W4=45E8%W5=45E8%W\r\nOS:6=45E8)ECN(R=Y%DF=Y%T=40%W=4600%O=M2300NNSNW2%CC=N%Q=)T1(R=Y%DF=Y%T=40%S\r\nOS:=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%R\r\nOS:D=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=\r\nOS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=N)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID\r\nOS:=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)\r\nUptime guess: 12.990 days (since Wed Nov 14 01:44:40 2012)\r\nNetwork Distance: 1 hop\r\nTCP Sequence Prediction: Difficulty=200 (Good luck!)\r\nIP ID Sequence Generation: All zeros\r\nRead data files from: \/usr\/share\/nmap\r\nOS detection performed. Please report any incorrect results at http:\/\/nmap.org\/submit\/ .\r\nNmap done: 1 IP address (1 host up) scanned in 12.38 seconds\r\n           Raw packets sent: 1126 (53.832KB) | Rcvd: 1066 (46.100KB)<\/pre>\n<p>See also: <a href=\"http:\/\/www.cyberciti.biz\/faq\/find-out-remote-webserver-name\/\">Fingerprinting a web-server<\/a> and a <a href=\"http:\/\/www.cyberciti.biz\/tips\/howto-remotely-determine-dns-server-version.html\">dns server<\/a> command line tools for more information.<\/p>\n<h2>#18: How do I detect remote services (server \/ daemon) version numbers?<\/h2>\n<pre>nmap -sV 192.168.1.1<\/pre>\n<p>Sample outputs:<\/p>\n<pre>Starting Nmap 5.00 ( http:\/\/nmap.org ) at 2012-11-27 01:34 IST\r\nInteresting ports on 192.168.1.1:\r\nNot shown: 998 closed ports\r\nPORT   STATE SERVICE VERSION\r\n22\/tcp open  ssh     <strong>Dropbear sshd 0.52 (protocol 2.0)<\/strong>\r\n80\/tcp open  http?\r\n1 service unrecognized despite returning data.<\/pre>\n<h2>#19: Scan a host using TCP ACK (PA) and TCP Syn (PS) ping<\/h2>\n<p>If firewall is blocking standard ICMP pings, try the following host discovery methods:<\/p>\n<pre>nmap -PS 192.168.1.1\r\nnmap -PS 80,21,443 192.168.1.1\r\nnmap -PA 192.168.1.1\r\nnmap -PA 80,21,200-512 192.168.1.1<\/pre>\n<h2>#20: Scan a host using IP protocol ping<\/h2>\n<pre>nmap -PO 192.168.1.1<\/pre>\n<h2>#21: Scan a host using UDP ping<\/h2>\n<p>This scan bypasses firewalls and filters that only screen TCP:<\/p>\n<pre>nmap -PU 192.168.1.1\r\nnmap -PU 2000.2001 192.168.1.1<\/pre>\n<h2>#22: Find out the most commonly used TCP ports using TCP SYN Scan<\/h2>\n<pre>\u00a0\r\n### Stealthy scan ###\r\nnmap -sS 192.168.1.1\r\n\r\n### Find out the most commonly used TCP ports using  TCP connect scan (warning: no stealth scan)\r\n###  OS Fingerprinting ###\r\nnmap -sT 192.168.1.1\r\n\r\n### Find out the most commonly used TCP ports using TCP ACK scan\r\nnmap -sA 192.168.1.1\r\n\r\n### Find out the most commonly used TCP ports using TCP Window scan\r\nnmap -sW 192.168.1.1\r\n\r\n### Find out the most commonly used TCP ports using TCP Maimon scan\r\nnmap -sM 192.168.1.1<\/pre>\n<h2>#23: Scan a host for UDP services (UDP scan)<\/h2>\n<p>Most popular services on the Internet run over the TCP protocol. DNS, SNMP, and DHCP are three of the most common UDP services. Use the following syntax to find out UDP services:<\/p>\n<pre>nmap -sU nas03\r\nnmap -sU 192.168.1.1<\/pre>\n<p>Sample outputs:<\/p>\n<pre>\u00a0\r\nStarting Nmap 5.00 ( http:\/\/nmap.org ) at 2012-11-27 00:52 IST\r\nStats: 0:05:29 elapsed; 0 hosts completed (1 up), 1 undergoing UDP Scan\r\nUDP Scan Timing: About 32.49% done; ETC: 01:09 (0:11:26 remaining)\r\nInteresting ports on nas03 (192.168.1.12):\r\nNot shown: 995 closed ports\r\nPORT     STATE         SERVICE\r\n111\/udp  open|filtered rpcbind\r\n123\/udp  open|filtered ntp\r\n161\/udp  open|filtered snmp\r\n2049\/udp open|filtered nfs\r\n5353\/udp open|filtered zeroconf\r\nMAC Address: 00:11:32:11:15:FC (Synology Incorporated)\r\n\r\nNmap done: 1 IP address (1 host up) scanned in 1099.55 seconds<\/pre>\n<h2>#24: Scan for IP protocol<\/h2>\n<p>This type of scan allows you to determine which IP protocols (TCP, ICMP, IGMP, etc.) are supported by target machines:<\/p>\n<pre>nmap -sO 192.168.1.1<\/pre>\n<h2>#25: Scan a firewall for security weakness<\/h2>\n<p>The following scan types exploit a subtle loophole in the TCP and good for testing security of common attacks:<\/p>\n<pre>\u00a0\r\n## TCP Null Scan to fool a firewall to generate a response ##\r\n## Does not set any bits (TCP flag header is 0) ##\r\nnmap -sN 192.168.1.254\r\n\r\n## TCP Fin scan to check firewall ##\r\n## Sets just the TCP FIN bit ##\r\nnmap -sF 192.168.1.254\r\n\r\n## TCP Xmas scan to check firewall ##\r\n## Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree ##\r\nnmap -sX 192.168.1.254<\/pre>\n<p>See <a href=\"http:\/\/www.cyberciti.biz\/tips\/linux-iptables-10-how-to-block-common-attack.html\">how to block Xmas packkets, syn-floods and other conman attacks<\/a> with iptables.<\/p>\n<h2>#26: Scan a firewall for packets fragments<\/h2>\n<p>The -f option causes the requested scan (including ping scans) to use tiny fragmented IP packets. The idea is to split up the TCP header over<br \/>\nseveral packets to make it harder for packet filters, intrusion detection systems, and other annoyances to detect what you are doing.<\/p>\n<pre lang=\"bash\">nmap -f 192.168.1.1\r\nnmap -f fw2.nixcraft.net.in\r\nnmap -f 15 fw2.nixcraft.net.in\r\n## Set your own offset size with the --mtu option ##\r\nnmap --mtu 32 192.168.1.1<\/pre>\n<h2>#27: Cloak a scan with decoys<\/h2>\n<p>The <kbd>-D<\/kbd> option it appear to the remote host that the host(s) you specify as <a href=\"http:\/\/www.cyberciti.biz\/tips\/nmap-hide-ipaddress-with-decoy-ideal-scan.html\">decoys are scanning the target network too<\/a>. Thus their IDS might report 5-10 port scans from unique IP addresses, but they won&#8217;t know which IP was scanning them and which were innocent decoys:<\/p>\n<pre>nmap -n -Ddecoy-ip1,decoy-ip2,your-own-ip,decoy-ip3,decoy-ip4 remote-host-ip\r\nnmap -n -D192.168.1.5,10.5.1.2,172.1.2.4,3.4.2.1 192.168.1.5<\/pre>\n<h2>#28: Scan a firewall for MAC address spoofing<\/h2>\n<pre>\u00a0\r\n### Spoof your MAC address ##\r\nnmap --spoof-mac MAC-ADDRESS-HERE 192.168.1.1\r\n\r\n### Add other options ###\r\nnmap -v -sT -PN --spoof-mac MAC-ADDRESS-HERE 192.168.1.1\r\n\r\n### Use a random MAC address ###\r\n### The number 0, means nmap chooses a completely random MAC address ###\r\nnmap -v -sT -PN --spoof-mac 0 192.168.1.1<\/pre>\n<h2>#29: How do I save output to a text file?<\/h2>\n<p>The syntax is:<\/p>\n<pre>nmap 192.168.1.1 &gt; output.txt\r\nnmap -oN \/path\/to\/filename 192.168.1.1\r\nnmap -oN output.txt 192.168.1.1<\/pre>\n<h2>#30: Not a fan of command line tools?<\/h2>\n<p>Try <a href=\"http:\/\/nmap.org\/zenmap\/\" target=\"_blank\">zenmap the official network mapper<\/a> front end:<\/p>\n<blockquote><p>Zenmap is the official Nmap Security Scanner GUI. It is a multi-platform (Linux, Windows, Mac OS X, BSD, etc.) free and open source application which aims to make Nmap easy for beginners to use while providing advanced features for experienced Nmap users. Frequently used scans can be saved as profiles to make them easy to run repeatedly. A command creator allows interactive creation of Nmap command lines. Scan results can be saved and viewed later. Saved scan results can be compared with one another to see how they differ. The results of recent scans are stored in a searchable database.<\/p><\/blockquote>\n<p>You can install zenmap using the following <a href=\"http:\/\/www.cyberciti.biz\/tips\/linux-debian-package-management-cheat-sheet.html\">apt-get command<\/a>:<br \/>\n<code>$ sudo apt-get install zenmap<\/code><br \/>\nSample outputs:<\/p>\n<pre>[sudo] password for vivek:\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\nThe following NEW packages will be installed:\r\n  zenmap\r\n0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.\r\nNeed to get 616 kB of archives.\r\nAfter this operation, 1,827 kB of additional disk space will be used.\r\nGet:1 http:\/\/debian.osuosl.org\/debian\/ squeeze\/main zenmap amd64 5.00-3 [616 kB]\r\nFetched 616 kB in 3s (199 kB\/s)\r\nSelecting previously deselected package zenmap.\r\n(Reading database ... 281105 files and directories currently installed.)\r\nUnpacking zenmap (from ...\/zenmap_5.00-3_amd64.deb) ...\r\nProcessing triggers for desktop-file-utils ...\r\nProcessing triggers for gnome-menus ...\r\nProcessing triggers for man-db ...\r\nSetting up zenmap (5.00-3) ...\r\nProcessing triggers for python-central ...<\/pre>\n<p>Type the following command to start zenmap:<br \/>\n<code>$ sudo zenmap<\/code><br \/>\nSample outputs<\/p>\n<div id=\"attachment_275\"><a href=\"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?attachment_id=275\" rel=\"attachment wp-att-275\"><img loading=\"lazy\" decoding=\"async\" title=\"Nmap Command GUI Usage Examples Output From zenmap\" src=\"http:\/\/s0.cyberciti.org\/uploads\/cms\/2012\/11\/nmap-usage-examples-output.png\" alt=\"Fig.02: zenmap in action\" width=\"592\" height=\"640\" \/><\/a>Fig.02: zenmap in action<\/p>\n<\/div>\n<h2>How do I detect and block port scanning?<\/h2>\n<p>Try the following resources:<\/p>\n<ol>\n<li><a href=\"http:\/\/www.cyberciti.biz\/faq\/linux-detect-port-scan-attacks\/\">How to use psad tool to detect and block port scan attacks in real time<\/a>.<\/li>\n<li><a href=\"http:\/\/www.cyberciti.biz\/faq\/debian-ubuntu-linux-shorewall-firewall-configuration\/\">Debian \/ Ubuntu Linux: Install and Configure Shoreline Firewall (Shorewall)<\/a>.<\/li>\n<li><a href=\"http:\/\/www.cyberciti.biz\/faq\/rhel-fedorta-linux-iptables-firewall-configuration-tutorial\/\">CentOS \/ Redhat Iptables Firewall Configuration Tutorial<\/a>.<\/li>\n<li><a href=\"http:\/\/www.cyberciti.biz\/tips\/linux-iptables-examples.html\">Linux: 20 Iptables Examples For New SysAdmins<\/a>.<\/li>\n<li><a href=\"http:\/\/www.cyberciti.biz\/tips\/linux-security.html\">20 Linux Server Hardening Security Tips<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>#1: Scan a single host or an IP address (IPv4) ### Scan a single ip address ### nmap 192.168.1.1 ## Scan a host name ### nmap server1.cyberciti.biz ## Scan a host name with more info### nmap -v server1.cyberciti.biz <\/p>\n<p>Sample outputs:<\/p>\n<p> Fig.01: nmap output<\/p>\n<p> #2: Scan multiple IP address or subnet (IPv4) nmap 192.168.1.1 192.168.1.2 192.168.1.3 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[57,103],"class_list":["post-3080","post","type-post","status-publish","format-standard","hentry","category-computer","tag-linux","tag-nmap","odd"],"_links":{"self":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3080"}],"version-history":[{"count":2,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3080\/revisions"}],"predecessor-version":[{"id":3082,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3080\/revisions\/3082"}],"wp:attachment":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}