Hacking with Nmap

Nmap (Network Mapper) is a free and open-source network scanner. It is used to discover hosts and services on a computer network by sending packets and analyzing the responses. It comes inbuilt in both Kali Linux and Parrot OS.

It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are available for Linux, Windows, and Mac OS X.
It was even featured in different movies, including The Matrix Reloaded, Die Hard 4, The Bourne Ultimatum, Ocean's 8 etc..

Installing Nmap

Linux Terminal

sudo apt-get update
sudo apt-get install nmap

For more detailed instructions for installation across all distributions, visit



Nmap Commands

1.  Nmap Help

  nmap -h



2.  Nmap Version

  nmap -V

3.  Basic scan with URL

  nmap http://www.scanme.org/

4.  Basic scan with IP Address

  nmap 192.168.1.1

5.  Scan a range of IPs

  nmap 192.168.1.1-20

6. Scan a Subnet

  nmap 192.168.1.0/24


7.  Scan a single port

  nmap -p 22 192.168.1.1

8.  Scan a range of ports

  nmap -p 1-100 192.168.1.1

9.  Detect OS, services and traceroute using -A option

  nmap -A 192.168.1.1

10.  Enable OS detection with -O option

  nmap -O http://www.scanme.org/

11.  Scan Detect Firewall using -sA option

  nmap -sA 192.168.1.1

12.  Scan a host to check for Firewall protection with -PN option

  nmap -PN 192.168.1.1

13.  Ping scan

  nmap -sP 192.168.0.1

14.  Scan using TCP connect

  nmap -sT 192.168.1.1

15.  Scan using TCP SYN 

  nmap -sS 192.168.1.1

16.  Scan UDP ports

  nmap -sU scanme.nmap.org

17.  Xmas scan

  nmap -sX 192.168.1.1

18.  Ping without Port Scan

  nmap -sn 192.168.100.0/24

19.  Standard service detection

  nmap -sV 192.168.1.1

20.  Aggressive Service Detection

  nmap -sV --version-intensity 5 192.168.1.1

21.  TCP null scan

  nmap -sN 192.168.0.101



22. TCP ACK scan

  nmap -PA 192.168.0.101

23.  TCP Syn scan

  nmap -PS 192.168.0.101

24.  Find Host Interfaces and Routes

  nmap --iflist

25.  Find packets sent and received

  nmap --packet-trace

26. Aggressive Scans

  nmap -T5 192.168.0.1
  nmap -T4 192.168.0.1

27.  Scan hosts and IP addresses reading from a text file

  nmap -iL list.txt

28.   Save Nmap scan results to a file

  nmap -oN output.txt www.scanme.org
  nmap -oX output.xml www.scanme.org
  nmap -oA output www.scanme.org

29.  Nmap FIN Scan

  nmap -sF -T4 192.168.0.1-24

30.  Find live hosts in a network

  nmap -sP 192.168.1.*

31.  Update scripts database using Nmap

  nmap --script-updatedb

32.  Get page titles from HTTP services using Nmap

  nmap --script=http-title 192.168.1.0/24

33.  Get HTTP headers of web services with Nmap

  nmap --script=http-headers 192.168.1.0/24

34.  Find web apps using Nmap

  nmap --script=http-enum 192.168.1.0/24

35.  Find Information about IP address

  nmap --script=asn-query,whois,ip-geolocation-maxmind 192.168.0.1


36. Detect Heart bleed SSL vulnerability

  nmap -sV -p 443 --script=ssl-heartbleed 192.168.0.1

37.  Scan for DDOS reflection UDP services

  nmap –sU –A –PN –n –pU:19,53,123,161 –script=ntp-monlist,dns-recursion,snmp-sysdescr 192.168.0.1




Hope you have enjoyed reading this. 
Leave a comment below 















Comments

Popular Posts