NMap Info Flashcards

1
Q

What is NMap?

A

Nmap (Network Mapper) is a powerful network scanning tool used for discovering hosts, services, and vulnerabilities in a network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the key functions of Nmap?

A
  • Host discovery
  • Port scanning
  • OS detection
  • Version detection
  • Scriptable interaction with targets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the basic command to perform a default Nmap scan?

A

nmap [target]
(Default scan checks the 1,000 most common TCP ports.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the default nmap scan cover?

A

Default scan checks the 1,000 most common TCP ports

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Using NMap, how do you scan all 65,535 ports?

A

nmap -p- [target]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the -sS argument in Nmap do?

A

Performs a stealth (SYN) scan, which sends SYN packets and analyzes responses without completing the TCP handshake.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the -sT argument in Nmap do?

A

Performs a TCP connect scan, establishing a full connection to the target.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the -A argument in Nmap do?

A

Enables agreesive scan:

  • -O OS detection:
  • -sV version detection
  • -sC or –script=default: script scanning
  • –traceroute: traceroute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of the -p argument in Nmap?

A

Specifies the port(s) to scan. For example: -p 80 scans port 80; -p 1-100 scans ports 1–100.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the -p- argument in Nmap?

A

Scans all scan all 65,535 ports of the target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In nmap, what is the -Pn argument used for?

A

Disables host discovery, treating all hosts as “up” and scanning them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the -sU argument do in Nmap?

A

Performs a UDP scan, which sends UDP packets to detect open ports.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does -T in Nmap control?

A

The scan timing. For example:

-T0 (paranoid)
-T4 (aggressive, faster scans).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is and why is -T0 used in Nmap?

A
  1. Slowest and most cautious level, referred to as “paranoid.” It results in a significantly slower scan speed
  2. This is designed to minimize the risk of detection by Intrusion Detection Systems (IDS) and other monitoring tools
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you use Nmap to scan a specific IP range?

A

Use a CIDR notation or IP range:

Example: nmap 192.168.1.0/24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the -sV argument do in Nmap

A

Enables version detection to identify the services running on open ports.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does –script do in Nmap?

A

Runs Nmap Scripting Engine (NSE) scripts, which are used for tasks like vulnerability detection and network discovery. Example:

nmap –script vuln 192.168.1.1

18
Q

What does the nmap -oN argument do?

A

Outputs scan results in a normal format to a file. Example: nmap -oN results.txt 192.168.1.1

19
Q

What does -oX do in Nmap?

A

Outputs scan results in XML format. Example: nmap -oX results.xml 192.168.1.1

20
Q

How does Nmap perform OS detection?

A

By using the -O option, which analyzes responses to determine the operating system.

note: requires root privileges in Linux

21
Q

What does the –reason argument do in Nmap?

A

Displays the reason why a port is marked as open, closed, or filtered.

22
Q

How do you use Nmap to find live hosts on a network?

A

Use the ping scan option: nmap -sn 192.168.1.0/24

23
Q

What does the –top-ports argument do in Nmap do?

A

Scans the most common ports. Example: –top-ports 20 scans the top 20 ports.

24
Q

How can you perform a scan while avoiding detection in Nmap?

A

Use options like -sS (stealth scan) and adjust timing with -T0 (paranoid mode).

25
Q

How can Nmap perform banner grabbing?

A

nmap -sV [target] (retrieves service banners during version detection).

26
Q

How do you scan the top N most common ports in Nmap?

A

–top-ports [N]
Example: nmap –top-ports 10 [target]

27
Q

Service Banner

A

metadata sent by a service running on a networked system, often when a client connects to it. This banner typically provides information about the service, such as its name, version, or other identifying details.

For example:

  • A web server may display a banner showing Apache/2.4.41 (Ubuntu).
  • An SSH server might show OpenSSH_8.4.
28
Q

How do you increase the verbosity of Nmap scans?

A

-v or -vv (for more detailed output)

Levels:
* Default (no -v): Only the essential results are displayed, such as open ports and a summary at the end of the scan.
* -v: Increases verbosity level to show additional details, such as host discovery, progress updates, and timing information. For example, Nmap will display messages when hosts are found to be alive.
* -vv: Provides even more detailed output, including additional information on scan progress, responses received during the scan, and debugging-like details.
* You can combine verbosity with the debugging flag -d for even deeper insights (e.g., -v -d). This is useful for troubleshooting or understanding scan behavior.

29
Q

In Nmap, what options can help evade firewalls and IDS/IPS?

A
  • Fragment packets: -f
  • Randomize hosts: –randomize-hosts
  • Change scan delay: –scan-delay [time]
  • Paranoid mode: -T0
30
Q

What does nmap -F do?

A

Performs a fast scan, checking the top 100 ports instead of 1,000.

31
Q

How can Nmap interact with DNS for reconnaissance?

A

nmap –script dns-brute [domain]

32
Q

What does nmap –script dns-brute [domain] do?

A

performs DNS brute-forcing on the specified domain. The dns-brute script tries to discover subdomains of the target domain by attempting to resolve common or user-defined subdomain names.

How It Works: The script uses a predefined wordlist of subdomains (e.g., www, mail, ftp) to query the DNS server. If a subdomain resolves to an IP address, it is reported as a valid subdomain.

may return:
www.example.com -> 192.168.1.1
mail.example.com -> 192.168.1.2
ftp.example.com -> 192.168.1.3

33
Q

What Nmap scan helps detect firewalls?

A

nmap -sA [target] (ACK scan)

Why?

  • ACK packets are used in TCP to acknowledge data receipt. Normally, they don’t initiate new connections, so a server doesn’t expect them if no connection exists.
  • Stateful Firewalls: These firewalls maintain a state table of active connections. If an ACK packet arrives without a corresponding connection in the table, the firewall blocks it.
  • Stateless Firewalls: These firewalls may simply forward ACK packets, assuming they’re part of legitimate traffic.
  • If the target system replies with a RST (Reset), it means the packet reached the host, indicating no firewall or a stateless firewall exists.
  • If there’s no response, it suggests the packet was dropped by a firewall.
  • ACK scans don’t reveal open ports but instead help map the presence of firewalls and identify whether they are stateful or stateless.
  • This technique is stealthier than a full SYN scan because ACK packets often blend with normal network traffic.
34
Q

How do you disable ping in Nmap scans?

A

-Pn
Example: nmap -Pn [target]

this disables host discover and treats all hosts as online

35
Q

How do you run Nmap scripts for vulnerability detection?

A

nmap –script=[script name] [target]
Example: nmap –script=vuln [target]

36
Q

What options save Nmap scan results?

A
  • Normal: -oN [filename]
  • XML: -oX [filename]
  • Grepable: -oG [filename]
  • All formats: -oA [filename]
  • Script kiddie: -oS [filename] - randomly capitalizes letters
37
Q

List three common Nmap scan types and their flags.

A
  • TCP Connect: -sT
  • SYN Scan (default): -sS
  • UDP Scan: -sU
38
Q

How do you combine OS and version detection in Nmap?

A

nmap -O -sV [target]

39
Q

Given that you are conducting an internal penetration test and need to enumerate assets within the organization’s network, which Nmap command or script would you use to produce the most comprehensive list of live hosts, open ports, and services?

  • -sV -O –script=all
  • -Pn
  • –top-ports 100
  • -sn
A

-sV -O –script=all

The correct answer is -sV -O –script=all. The -sV option enables version detection, probing open ports to determine service/version info, while the -O option triggers OS detection. Combining these with –script=all applies a variety of scripts for further enumeration, including default and non-default scripts that check for a wide range of vulnerabilities and configurations, making it the most comprehensive choice for asset enumeration. -sn only performs host discovery, which would not enumerate open ports or services. –top-ports only scans the most common ports, which might miss out on less common but potentially critical ports. -Pn disables host discovery and should only be used when ensuring all ports are scanned regardless of the host being up.

40
Q

What does nmap -sn do?

A

used to perform a “ping scan,” which identifies active hosts on a network without performing a full port scan. It sends ICMP echo requests or ARP requests to check if hosts are up.