SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Nmap Commands
www.lucideus.com KAILASH KUMAR
NSIC Campus,Okhla PhaseIII Lucideus Grade2(5-7)
New Delhi-110020
Nmap Commands July 28, 2016
www.lucideus.com Page 1
INTRODUCTION TO NMAP
Nmap (Network Mapper) is a security scanner originally written by Gordon Lyon used to
discover hosts and services on a computer network, thus creating a "map" of the network. To
accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the
responses.
The software provides a number of features for probing computer networks, including host
discovery and service and operating system detection. These features are extensible by scripts
that provide more advanced service detection,vulnerability detection, and other features. Nmap is
also capable of adapting to network conditions including latency and congestion during a scan.
Nmap is under development and refinement by its user community.
FEATURES AND USES OF NMAP
Nmap features include:
 Host discovery – Identifying hosts on a network. For example, listing the hosts that
respond to TCP and/or ICMP requests or have a particular port open.
 Port scanning – Enumerating the open ports on target hosts.
 Version detection – Interrogating network services on remote devices to determine
application name and version number.
 OS detection – Determining the operating system and hardware characteristics of
network devices.
 Scriptable interaction with the target – using Nmap Scripting Engine (NSE) and Lua
programming language.
Nmap can provide further information on targets, including reverse DNS names, device
types, and MAC addresses.
Typical uses of Nmap:
 Auditing the security of a device or firewall by identifying the network connections
which can be made to, or through it.
 Identifying open ports on a target host in preparation for auditing.
 Network inventory, network mapping, maintenance and asset management.
 Auditing the security of a network by identifying new servers.
 Generating traffic to hosts on a network, response analysis and response time
measurement.
 Find and exploit vulnerabilities in a network.
Nmap Commands July 28, 2016
www.lucideus.com Page 2
NMAP COMMANDS
1-Scan a Single Host or an IP Address
Scan a Single IP Address :
 $ nmap 192.168.159.128
Scan for Host Name:
 $ nmap server.shellhacks.com
Nmap Commands July 28, 2016
www.lucideus.com Page 3
2-Scan multiple IP Addresses
Scan multiple IP Addresses
 $nmap 192.168.159.1 192.168.159.2 192.168.159.3
 $nmap 192.168.159.1,2,3
Scan for Subnet:
 $ nmap 192.168.159.0/24
 $nmap 192.168.159.*
Scan for Ranges of IP(192.168.159.0-192.168.159.30)
Nmap Commands July 28, 2016
www.lucideus.com Page 4
3- Scan Network for Active computers
Scan Network for Active Host on a Network
 nmap -sn 192.168.159.1/24
4- Scan a List of Host From Input File
Scan hosts/networks from Input File:
create file using command
cat > ipfile.txt
 $ nmap -iL '/root/Desktop/ipfile.txt'
Nmap Commands July 28, 2016
www.lucideus.com Page 5
5.Exclude IP/Hosts/networks from Nmap Scan
Exclide targets from Nmap scan:
 $ nmap 192.168.159.0/24 --exclude 192.168.1.128
Exclude List of hosts from a file:
 $ nmap 192.168.159.0/24 --excludefile '/root/Desktop/ipfile.txt'
Nmap Commands July 28, 2016
www.lucideus.com Page 6
6.Scan for Specific ports
Scan for single Port:
 $ nmap -p 80 192.168.159.128
Scan for all Ports:
 $ nmap -p* 192.168.159.128
Scan for all Ports:
 $ nmap -p* 192.168.159.128
Scan for common ports:
 $ namp --top-ports 5 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 7
7.Determine Suppoeted IP Protocols
Determine Which IP protocols are supported by the target host:
 $ nmap -sO 192.168.159.128
8.Scan For TCP/UDP Ports
Scan for all TCP ports:
 $ nmap -sT 192.168.159.128
Scan for all TCP ports:
 $ nmap -sU 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 8
9-Perform a Fast Scan
Enable Fast Mode:
 $ nmap -F 192.168.159.128
10- Display the Reason a Port is in a Particular State
 $ nmap --reason 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 9
11-Show Only Open Ports
 $ namp --open 192.168.159.128
12-OS Detection
 $ namp -O 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 10
13- Service Version Detection
 $ nmap -sV 192.168.159.128
14- Firewall Detection.
 $nmap -sA 192.168.159.128
15- MAC Address Spoofing
 $ nmap --spoof-mac 00:11:22:33:44:55 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 11
 $nmap --spoof-mac 0 192.168.159.128
16- scan a firewall For Security vulnerabilities
TCP Null Scan:
 $ nmap -sN 192.168.159.128
TCP Fin Scan:
 $ nmap -sF 192.168.159.128
TCP Xmas Scan:
 $ nmap -sX 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 12
17-Stealth Scan
TCP SYN scan
 $ nmap -sS 192.168.159.128
18-Disable Host Discovery(No Ping)
 $ namp -Pn 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 13
19-Disable DNS Resolution
 $ namp -n 192.168.159.128
20- Save Output of Nmap scan to a File
save output of Nmap scan to TEXT File
 $ nmap 192.168.159.128 > output.txt
 $ nmap -oN output.txt 192.168.159.128
Nmap Commands July 28, 2016
www.lucideus.com Page 14
save output of Nmap scan to an xml
 $ nmap -oN output.txt 192.168.159.128
References
 http://www.shellhacks.com/en/20-Awesome-Nmap-Command-Examples
 https://nmap.org/

Weitere ähnliche Inhalte

Was ist angesagt?

Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
amiable_indian
 
Open Vulnerability Assesment System (OpenVAS)
Open Vulnerability Assesment System (OpenVAS)Open Vulnerability Assesment System (OpenVAS)
Open Vulnerability Assesment System (OpenVAS)
Information Technology Inistitute
 

Was ist angesagt? (20)

NMAP - The Network Scanner
NMAP - The Network ScannerNMAP - The Network Scanner
NMAP - The Network Scanner
 
Hacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning TechniquesHacking With Nmap - Scanning Techniques
Hacking With Nmap - Scanning Techniques
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
 
Port Scanning
Port ScanningPort Scanning
Port Scanning
 
N map presentation
N map presentationN map presentation
N map presentation
 
Nmap tutorial
Nmap tutorialNmap tutorial
Nmap tutorial
 
Nmap
NmapNmap
Nmap
 
Nmap and metasploitable
Nmap and metasploitableNmap and metasploitable
Nmap and metasploitable
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
 
Nmap
NmapNmap
Nmap
 
Network scanning
Network scanningNetwork scanning
Network scanning
 
Port scanning
Port scanningPort scanning
Port scanning
 
Nmap scripting engine
Nmap scripting engineNmap scripting engine
Nmap scripting engine
 
Network Mapper (NMAP)
Network Mapper (NMAP)Network Mapper (NMAP)
Network Mapper (NMAP)
 
Nmap Hacking Guide
Nmap Hacking GuideNmap Hacking Guide
Nmap Hacking Guide
 
Network scanning
Network scanningNetwork scanning
Network scanning
 
Nmap
NmapNmap
Nmap
 
Open Vulnerability Assesment System (OpenVAS)
Open Vulnerability Assesment System (OpenVAS)Open Vulnerability Assesment System (OpenVAS)
Open Vulnerability Assesment System (OpenVAS)
 
Snort
SnortSnort
Snort
 
Wireshark Basic Presentation
Wireshark Basic PresentationWireshark Basic Presentation
Wireshark Basic Presentation
 

Andere mochten auch

[NCTU] [CCCA] Network Security I
[NCTU] [CCCA] Network Security I[NCTU] [CCCA] Network Security I
[NCTU] [CCCA] Network Security I
Xatierlike Lee
 
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
BSides Algiers - Nmap Scripting Engine - Hani BenhabilesBSides Algiers - Nmap Scripting Engine - Hani Benhabiles
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
Shellmates
 

Andere mochten auch (20)

[NCTU] [CCCA] Network Security I
[NCTU] [CCCA] Network Security I[NCTU] [CCCA] Network Security I
[NCTU] [CCCA] Network Security I
 
Ch 09 -- ARP & IP Analysis
Ch 09 -- ARP & IP AnalysisCh 09 -- ARP & IP Analysis
Ch 09 -- ARP & IP Analysis
 
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
BSides Algiers - Nmap Scripting Engine - Hani BenhabilesBSides Algiers - Nmap Scripting Engine - Hani Benhabiles
BSides Algiers - Nmap Scripting Engine - Hani Benhabiles
 
Ch 07 -- The Expert System
Ch 07 -- The Expert SystemCh 07 -- The Expert System
Ch 07 -- The Expert System
 
Wireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics toolsWireshark course, Ch 05: Advanced statistics tools
Wireshark course, Ch 05: Advanced statistics tools
 
Wireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filtersWireshark course, Ch 03: Capture and display filters
Wireshark course, Ch 03: Capture and display filters
 
SSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wiresharkSSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wireshark
 
Ch 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching TroubleshootingCh 08 -- Ethernet & LAN Switching Troubleshooting
Ch 08 -- Ethernet & LAN Switching Troubleshooting
 
Reconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awarenessReconnaissance - For pentesting and user awareness
Reconnaissance - For pentesting and user awareness
 
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
OSTU - Quickstart Guide for Wireshark (by Tony Fortunato)
 
Wireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wiresharkWireshark course, Ch 02: Introduction to wireshark
Wireshark course, Ch 02: Introduction to wireshark
 
Ch 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter IssuesCh 06 -- Bandwidth Delay and Jitter Issues
Ch 06 -- Bandwidth Delay and Jitter Issues
 
Network Forensics: Packet Analysis Using Wireshark
Network Forensics: Packet Analysis Using WiresharkNetwork Forensics: Packet Analysis Using Wireshark
Network Forensics: Packet Analysis Using Wireshark
 
Wireshark
WiresharkWireshark
Wireshark
 
Footprinting tools for security auditors
Footprinting tools for security auditorsFootprinting tools for security auditors
Footprinting tools for security auditors
 
Wireshark
WiresharkWireshark
Wireshark
 
Packet analysis using wireshark
Packet analysis using wiresharkPacket analysis using wireshark
Packet analysis using wireshark
 
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet Nmap not only a port scanner by ravi rajput comexpo security awareness meet
Nmap not only a port scanner by ravi rajput comexpo security awareness meet
 
Wireshark
WiresharkWireshark
Wireshark
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 

Ähnlich wie Nmap commands

Lab-5 Scanning and Enumeration Reconnaissance and inform.docx
Lab-5 Scanning and Enumeration        Reconnaissance and inform.docxLab-5 Scanning and Enumeration        Reconnaissance and inform.docx
Lab-5 Scanning and Enumeration Reconnaissance and inform.docx
LaticiaGrissomzz
 
Nmap Discovery
Nmap DiscoveryNmap Discovery
Nmap Discovery
Tai Pan
 

Ähnlich wie Nmap commands (20)

Christchurch ISIG 27 oct2015
Christchurch ISIG 27 oct2015Christchurch ISIG 27 oct2015
Christchurch ISIG 27 oct2015
 
Lab-5 Scanning and Enumeration Reconnaissance and inform.docx
Lab-5 Scanning and Enumeration        Reconnaissance and inform.docxLab-5 Scanning and Enumeration        Reconnaissance and inform.docx
Lab-5 Scanning and Enumeration Reconnaissance and inform.docx
 
NMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge AcademyNMap 101 offline meetup by CyberForge Academy
NMap 101 offline meetup by CyberForge Academy
 
Contents namp
Contents nampContents namp
Contents namp
 
Contents namp
Contents nampContents namp
Contents namp
 
Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3Nmap basics-1198948509608024-3
Nmap basics-1198948509608024-3
 
Zen map
Zen mapZen map
Zen map
 
Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019Null Delhi chapter - Feb 2019
Null Delhi chapter - Feb 2019
 
Practical White Hat Hacker Training - Active Information Gathering
Practical White Hat Hacker Training - Active Information GatheringPractical White Hat Hacker Training - Active Information Gathering
Practical White Hat Hacker Training - Active Information Gathering
 
Namp
Namp Namp
Namp
 
01204427-scanner.ppt
01204427-scanner.ppt01204427-scanner.ppt
01204427-scanner.ppt
 
Nmap Discovery
Nmap DiscoveryNmap Discovery
Nmap Discovery
 
Backtrack Manual Part3
Backtrack Manual Part3Backtrack Manual Part3
Backtrack Manual Part3
 
A REVIEW ON NMAP AND ITS FEATURES
A REVIEW ON NMAP AND ITS FEATURESA REVIEW ON NMAP AND ITS FEATURES
A REVIEW ON NMAP AND ITS FEATURES
 
NMAP1.ppt
NMAP1.pptNMAP1.ppt
NMAP1.ppt
 
Nmap
NmapNmap
Nmap
 
wireshark.pdf
wireshark.pdfwireshark.pdf
wireshark.pdf
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
 
This Assignment consists of Amazon Web services
This Assignment consists of Amazon Web servicesThis Assignment consists of Amazon Web services
This Assignment consists of Amazon Web services
 
Network for amin
Network for aminNetwork for amin
Network for amin
 

Kürzlich hochgeladen

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Kürzlich hochgeladen (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Nmap commands

  • 1. Nmap Commands www.lucideus.com KAILASH KUMAR NSIC Campus,Okhla PhaseIII Lucideus Grade2(5-7) New Delhi-110020
  • 2. Nmap Commands July 28, 2016 www.lucideus.com Page 1 INTRODUCTION TO NMAP Nmap (Network Mapper) is a security scanner originally written by Gordon Lyon used to discover hosts and services on a computer network, thus creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the target host and then analyzes the responses. The software provides a number of features for probing computer networks, including host discovery and service and operating system detection. These features are extensible by scripts that provide more advanced service detection,vulnerability detection, and other features. Nmap is also capable of adapting to network conditions including latency and congestion during a scan. Nmap is under development and refinement by its user community. FEATURES AND USES OF NMAP Nmap features include:  Host discovery – Identifying hosts on a network. For example, listing the hosts that respond to TCP and/or ICMP requests or have a particular port open.  Port scanning – Enumerating the open ports on target hosts.  Version detection – Interrogating network services on remote devices to determine application name and version number.  OS detection – Determining the operating system and hardware characteristics of network devices.  Scriptable interaction with the target – using Nmap Scripting Engine (NSE) and Lua programming language. Nmap can provide further information on targets, including reverse DNS names, device types, and MAC addresses. Typical uses of Nmap:  Auditing the security of a device or firewall by identifying the network connections which can be made to, or through it.  Identifying open ports on a target host in preparation for auditing.  Network inventory, network mapping, maintenance and asset management.  Auditing the security of a network by identifying new servers.  Generating traffic to hosts on a network, response analysis and response time measurement.  Find and exploit vulnerabilities in a network.
  • 3. Nmap Commands July 28, 2016 www.lucideus.com Page 2 NMAP COMMANDS 1-Scan a Single Host or an IP Address Scan a Single IP Address :  $ nmap 192.168.159.128 Scan for Host Name:  $ nmap server.shellhacks.com
  • 4. Nmap Commands July 28, 2016 www.lucideus.com Page 3 2-Scan multiple IP Addresses Scan multiple IP Addresses  $nmap 192.168.159.1 192.168.159.2 192.168.159.3  $nmap 192.168.159.1,2,3 Scan for Subnet:  $ nmap 192.168.159.0/24  $nmap 192.168.159.* Scan for Ranges of IP(192.168.159.0-192.168.159.30)
  • 5. Nmap Commands July 28, 2016 www.lucideus.com Page 4 3- Scan Network for Active computers Scan Network for Active Host on a Network  nmap -sn 192.168.159.1/24 4- Scan a List of Host From Input File Scan hosts/networks from Input File: create file using command cat > ipfile.txt  $ nmap -iL '/root/Desktop/ipfile.txt'
  • 6. Nmap Commands July 28, 2016 www.lucideus.com Page 5 5.Exclude IP/Hosts/networks from Nmap Scan Exclide targets from Nmap scan:  $ nmap 192.168.159.0/24 --exclude 192.168.1.128 Exclude List of hosts from a file:  $ nmap 192.168.159.0/24 --excludefile '/root/Desktop/ipfile.txt'
  • 7. Nmap Commands July 28, 2016 www.lucideus.com Page 6 6.Scan for Specific ports Scan for single Port:  $ nmap -p 80 192.168.159.128 Scan for all Ports:  $ nmap -p* 192.168.159.128 Scan for all Ports:  $ nmap -p* 192.168.159.128 Scan for common ports:  $ namp --top-ports 5 192.168.159.128
  • 8. Nmap Commands July 28, 2016 www.lucideus.com Page 7 7.Determine Suppoeted IP Protocols Determine Which IP protocols are supported by the target host:  $ nmap -sO 192.168.159.128 8.Scan For TCP/UDP Ports Scan for all TCP ports:  $ nmap -sT 192.168.159.128 Scan for all TCP ports:  $ nmap -sU 192.168.159.128
  • 9. Nmap Commands July 28, 2016 www.lucideus.com Page 8 9-Perform a Fast Scan Enable Fast Mode:  $ nmap -F 192.168.159.128 10- Display the Reason a Port is in a Particular State  $ nmap --reason 192.168.159.128
  • 10. Nmap Commands July 28, 2016 www.lucideus.com Page 9 11-Show Only Open Ports  $ namp --open 192.168.159.128 12-OS Detection  $ namp -O 192.168.159.128
  • 11. Nmap Commands July 28, 2016 www.lucideus.com Page 10 13- Service Version Detection  $ nmap -sV 192.168.159.128 14- Firewall Detection.  $nmap -sA 192.168.159.128 15- MAC Address Spoofing  $ nmap --spoof-mac 00:11:22:33:44:55 192.168.159.128
  • 12. Nmap Commands July 28, 2016 www.lucideus.com Page 11  $nmap --spoof-mac 0 192.168.159.128 16- scan a firewall For Security vulnerabilities TCP Null Scan:  $ nmap -sN 192.168.159.128 TCP Fin Scan:  $ nmap -sF 192.168.159.128 TCP Xmas Scan:  $ nmap -sX 192.168.159.128
  • 13. Nmap Commands July 28, 2016 www.lucideus.com Page 12 17-Stealth Scan TCP SYN scan  $ nmap -sS 192.168.159.128 18-Disable Host Discovery(No Ping)  $ namp -Pn 192.168.159.128
  • 14. Nmap Commands July 28, 2016 www.lucideus.com Page 13 19-Disable DNS Resolution  $ namp -n 192.168.159.128 20- Save Output of Nmap scan to a File save output of Nmap scan to TEXT File  $ nmap 192.168.159.128 > output.txt  $ nmap -oN output.txt 192.168.159.128
  • 15. Nmap Commands July 28, 2016 www.lucideus.com Page 14 save output of Nmap scan to an xml  $ nmap -oN output.txt 192.168.159.128 References  http://www.shellhacks.com/en/20-Awesome-Nmap-Command-Examples  https://nmap.org/