Nmap Commands
Nmap Commands
© Copyright by Interviewbit
Contents
Category-wise diverse NMAP commands with examples are explained in the following
section.
2. Target Specification
nmap
Scans a domain
ramdom.doman.org
3. Scan Techniques
4. Host Discovery
nmap
-sL 192.168.1.6-9 - Creates targets List only
sL
nmap
Enables UDP ping on port
-PU 192.168.1.3-7 -
x.
PU53 Port 40125 is by default
nmap
ARP ping on the local
-PR 192.168.1.2-
network
3/24 -PR
nmap
-n 192.168.1.2 - Disables DNS resolution
n
5. Port Specification
nmap
-p 192.168.1.9 Scan a specific port
-p 27
nmap
-p 192.168.1.9 Scan a port range
-p 27-100
nmap
192.168.1.9
Scans multiple TCP and UDP
-p -p
ports
U:53,T:27-
40,80
nmap
-p- 192.168.1.9
Scan all ports
-p-
nmap
192.168.1.9 Scans based on the service
-p
-p name
http,https
nmap
-F 192.168.1.9 Scan 100 ports in fast manner
-F
nmap
–top- 192.168.1.9
Scans the top “x” ports
ports -top-ports
1015
nmap
Helps in determining the
-sV 192.168.1.9
version of the service
-sV
nmap
192.168.1.9 To increase the Intensity level
-sV –
-sV - between 0 to 9. The higher the
version-
version- number higher is possibility of
intensity
intensity correctness
9
nmap
-sV – 192.168.1.9 This enables light mode. This
version- -sV - has a lower possibility of
light version- correctness but is faster.
light
nmap
This enables an intensity level
-sV – 192.168.1.9
of 9. This has a higher
version- -sV -
possibility of correctness but
all version-
is slower.
all
7. OS Detection
nmap
TCP/IP stack fingerprinting is
-O 192.168.1.8
used for remote OS detection.
-O
nmap
-O –
192.168.1.8 Makes Nmap guess more
osscan-
-O -osscan- competently
guess
guess
nmap
-O –
192.168.1.8 This set the maximum number
max-
-O -max-os- “x” of OS detection attempts
os-tries
tries 1 against a target
nmap 192.168.1.8 -
-T0 Paranoid (0) Timing
T0
nmap 192.168.1.8 -
-T1 Sneaky (1) Timing
T1
nmap 192.168.1.8 -
-T2 Polite (2) Timing
T2
nmap 192.168.1.8 -
-T3 Normal (3) Timing
T3
nmap 192.168.1.8 -
-T5 Insane (5) Timing
T5
A er this long,
–host-timeout
5s; 10m; 5h give up on the
<time>
target.
–min-rtt-
How long it
timeout/max-rtt-
takes to return
timeout/initial- 5s; 10m; 5h
a probe round
rtt-timeout
trip.
<time>
–min-
parallelism/max- This probes
10; 1
parallelism parallelization
<numprobes>
Specifies the
maximum
–max-retries number retries
5
<tries> for port scan
probe
retransmissions
9. NSE Scripts
Default NSE
-sC nmap 192.168.1.9 -sC scripts are
used to scan.
This scans
–script nmap 192.168.1.9 -script
with default
default default
NSE scripts
Default
scanning
nmap 192.168.1.9 -script
–script without
"not intrusive"
intrusive
scripts
Command Description
Vulnerabilities
nmap -p80 -script http-unsafe-output-
detection on
escaping interviewbit.com
cross websites
Small fragmented
IP packets are
used in requested
-f nmap 192.168.1.9 -f scans (including
ping scans). More
difficult for packet
filters
nmap -D 192.168.9.102,
Scans from the
192.168.9.103,
-D spoofed IPs are
192.168.9.104,
send via this
192.168.9.523
nmap -S
Scans Scaler from
-S www.interviewbit.com
InterviewBit
www.scaler.com
12. Output
– nmap 192.168.1.9
Adds a scan to the
append- -oN file.file -
previous scanned file
output append-output
nmap 192.168.1.9
–open Open ports are shown
-open
Command Description
Conclusion
In this document, we’ve covered the basics of Network Mapper (NMAP), its features
and some of the important cheat sheets. NMAP is the supreme source of port scan
information, the foundation for most security enumeration during the initial phases
of a penetration test. It has a number of settings and when you first start out using it
it may be difficult to figure out. You can follow the guide for running Nmap on a Mac
OS X or Linux machine. The beauty of the Nmap tool is that it’s designed to work with
text output. This means that you do not have to be an expert in Linux or Bash
Scripting in order to use this amazing tool. The code examples are very easy to follow
and you will be up and running with Nmap in no time.
Now, it’s time for you to head out and try what we’ve covered here and more. More
than memorizing syntax, do pay attention to practising them and solving problems.
Css Interview Questions Laravel Interview Questions Asp Net Interview Questions