Hacking

How to install and use Nmap

nmap

Nmap

Nmap is a ‘Network Mapper’, which is a very popular for  free and open source hacking tool. It is used for networking and security auditing. Thousands of system admins are using nmap for network inventory, check for open ports, manage service upgrade schedules, and monitor host or service uptime. Nmap, as a tool uses raw IP packets in creative ways to determine what hosts are available on the network, what services  those hosts are providing information about, what operating systems  and what type and version of packet filters/ firewalls are being used by the target.

Installation


Open termux and sort the subsequent commands step by step.

pkg update
pkg install nmap

Nmap Commands :

nmap

Nmap Target Selection :-
scan a single IP: nmap 192.168.1.1
Scan a host: nmap www.testhostname.com
Scan a range of IPs: nmap 192.168.1.1-20
Scan a subnet: nmap 192.168.1.0/24
Scan targets from a text file: nmap -iL list-of-ips.txt

Nmap Port Selection :-

To Scan a single Port: nmap -p 22 192.168.1.1
To Scan a range of ports: nmap -p 1-100 192.168.1.1
To Scan 100 most common ports (Fast): nmap -F 192.168.1.1
To Scan all 65535 ports: nmap -p- 192.168.1.1

Nmap Port Scan types :-

Scan using TCP connect: nmap -sT 192.168.1.1
Scan using TCP SYN scan (default): nmap -sS 192.168.1.1
Scan UDP ports: nmap -sU -p 123,161,162 192.168.1.1
Scan selected ports – ignore discovery: nmap -Pn -F 192.168.1.1

Nmap Output Formats :-

Save default output to file: nmap -oN outputfile.txt 192.168.1.1
Save results as XML: nmap -oX outputfile.xml 192.168.1.1
Save results in a format for grep: nmap -oG outputfile.txt 192.168.1.1
Save in all formats: nmap -oA outputfile 192.168.1.1

HTTP Service Information :-

Gather page titles from HTTP services: nmap –script=http-title 192.168.1.0/24
Get HTTP headers of web services: nmap –script=http-headers 192.168.1.0/24
Find web apps from known paths: nmap –script=http-enum 192.168.1.0/24
Heartbleed Testing: nmap -sV -p 443 –script=ssl-heartbleed 192.168.1.0/24

IP Address information :-


Find Information about IP address: nmap –script=asn-query,whois,ip-geolocation-maxmind 192.168.1.0/24