Lession 3.2
Lession 3.2
Exam PT0-002
Lesson 7
Analyzing Scanning Results
3
Lesson 7
Topic 7A
Discover Nmap and NSE
5
Timing and Performance Considerations
• Vulnerability scanning is part of the PenTest exercise; however, the
process can be aggressive or intrusive
• You can adjust the scan by using the timing option: -T <0 - 5>, where
T0 is the slowest and T5 is the fastest
• In some cases, network devices enforce rate limiting, which limits
the data flow by either policing or shaping the traffic.
• Nmap will detect whether rate limiting is in place and will adjust the scan to
avoid flooding the network.
6
Using TCP or UDP when Scanning
• TCP can provide more detailed results when scanning. Nmap has a
variety of scans that use TCP that include:
• A TCP ACK scan is used to bypass firewall rulesets
• UDP scans are generally slower and more difficult. In addition, open
and filtered ports rarely send any response.
• Because of this, the team may choose not to run a UDP scan.
7
Scripting with Nmap Scripting Engine (NSE)
• NSE scripts are a core component of Nmap that allows users to
customize activity and automate the scanning process.
• Perform advanced network discovery
• Determine vulnerabilities
8
Using the Nmap Library of Scripts
• Scripts are grouped into several different categories that include:
• Malware—scripts capable of detecting malware.
10
Lab Activity
Assisted Lab: Understanding Nmap • Lab types
Common Usage • Assisted labs guide you step-by-step through tasks
• Applied labs set goals with limited guidance
• Complete lab
• Submit all items for grading and check each progress box
• Select “Grade Lab” from final page
• Save lab
• Select the hamburger menu and select “Save”
• Save up to two labs in progress for up to 7 days
11
Lesson 7
Topic 7B
Enumerate Network Hosts
13
Detecting Interesting Hosts
• The team will need to use a variety of scans to get a solid grasp on
the environment.
• By default, Nmap uses the following during host discovery:
• TCP SYN packet to port 443
• UDP Ping -PU <portlist> This scan uses User Datagram Protocol (UDP).
• Nmap will display the ports that were detected, which can be in one
of four states:
• Open, closed, filtered and unfiltered
15
The Host Discovery Phase
• During host discovery, the team has some options as follows:
• Skip the discovery phase altogether and treat all hosts as if they are online by
using the switch -Pn.
• Complete the network discovery without doing a port scan using the switch -
sn.
• Run a script without either a ping or port scan by using the two options -Pn
-sn together.
16
Fingerprinting the Operating System
• Nmap can detect the OS and version in use along with service
detection for a single host or a range of devices.
• Once the vulnerable machine(s) are identified, the vulnerabilities can either
be mitigated, or the team can attempt to actively attack the system.
17
Determining the OS
• Once a response is received from the target, Nmap will make a best
effort estimate of what OS is in use.
• Some of the key elements used to determine the OS include:
• Don’t Fragment (DF) bit—Is the DF bit in the IPv4 header on or off?
• Time to Live (TTL)—What is the TTL value set on the outbound packet?
18
Review Activity: Enumerate Network Hosts
• Outline what’s involved when mapping the network
• Explain the different scans Nmap uses during host discovery
• List techniques the team can use to modify the intensity of a scan
• Review options the team can use during host discovery
• Describe ways to fingerprint the OS
• Discuss methods Nmap uses to determine a target’s OS
19
Lab Activity
Assisted Lab: Understanding Scan • Lab types
Output • Assisted labs guide you step-by-step through tasks
• Applied labs set goals with limited guidance
• Complete lab
• Submit all items for grading and check each progress box
• Select “Grade Lab” from final page
• Save lab
• Select the hamburger menu and select “Save”
• Save up to two labs in progress for up to 7 days
20
Lesson 7
Topic 7C
Analyze Output from Scans
22
Testing Methods
• Depending on the parameters of the project scope, the team might
use one of three methods when testing:
• Unknown environment - no information is presented to the team
• Once the team learns more information, they can outline the
network topology and identify the boundaries more clearly.
23
Reporting with Nmap
• Nmap can provide exceptional results when discovering network
devices and related vulnerabilities.
• When viewing the results of a scan, Nmap has several available
formats for outputting the results as follows:
• Interactive output – human readable output and is the default
• Normal output (-oN) is like interactive; however, you can save the results of
an Nmap scan to a text file for later analysis.
24
Interfacing With Zenmap
25
Footprinting using DNS
• Can reveal additional targets that can help the team learn more
about the structure of an organization's network.
• DNS can fall victim to several threats that include:
• A flood or amplification attack.
• Cache poisoning.
26
Targeting the DNS Servers
• When dealing with DNS there are two servers can be at risk for
compromise: Authoritative and Recursive
• Nmap has several methods to test DNS for vulnerabilities.
• For example, you can use the following to discover the target host's
services: nmap --script=dns-service-discovery -p 5353 <target>
• The script uses the DNS Service Discovery protocol to get a list of services.
27
Transferring Zone Information
• A zone file is a text file that contains information and resource
records (RR) for a specific namespace.
• The following are some of the RR found in a zone file:
• Type A Maps a hostname to a 32-bit IPv4 address of the host
28
Exposing the Zone File
• If not properly configured, the zone file can be exposed and leak
resource record information.
• An attack occurs when an entity poses as a DNS client server and
asks for a copy of the zone records.
• This can be achieved using the Nmap script dns-zone-
transfer.domain.
• If the server honors the request, it will return the zone file.
29
Poisoning The DNS Cache
• If the server is not properly configured, this can lead to an attack,
such as a DNS cache poisoning attack.
• Corrupts the cache of a recursion server to point to a bogus IP address.
30
Exposing Vulnerable Web Servers
• During the PenTesting exercise, the team can test the organization's
web server using a few methods:
• Manually examine the source code and elements within the site for
comments or other interesting artifacts
• Examine the web or access logs that show the activity for a website.
• Intercept traffic using a proxy between the web client and the server.
31
Using Burp Suite
• Burp Suite is an integrated platform used to test the security of web
applications.
• Acts as a local proxy to capture the HTTP requests and responses
• When using a proxy, the team can gather more data to check for
security issues that occur during a web transaction.
• Vulnerabilities can include cryptographic weaknesses, missing or weak
authentication, and other web vulnerabilities .
33
Lab Activity
APPLIED Lab: Using Scanning a • Lab types
Vulnerable System • Assisted labs guide you step-by-step through tasks
• Applied labs set goals with limited guidance
• Complete lab
• Submit all items for grading and check each progress box
• Select “Grade Lab” from final page
• Save lab
• Select the hamburger menu and select “Save”
• Save up to two labs in progress for up to 7 days
34
Lesson 7
Summary