Apply Your Knowledge
You have seen many of the tools used for passive reconnaissance in this Chapter. Passive reconnaissance is the act of gathering as much information about a target as passively as you can. Tools such as Whois, Nslookup, Sam Spade, traceroute, ARIN, and IANA are all useful for this task.
In this exercise, you will gather information about several organizations. Your goal is to use the tools discussed in the Chapter for passive information gathering. No port scans, no OS fingerprinting, or banner grabbing should be performed. Treat these organizations with the utmost respect.
Exercises
3.1 Performing Passive Reconnaissance
The best way to learn passive information gathering is to use the tools. In this exercise, you will perform reconnaissance on several organizations. Acquire only the information requested.
Estimated Time: 20 minutes.
- Review Table 3.7 to determine the target of your passive information gathering.
Table 3.7. Passive Information Gathering
Domain Name
IP Address
Location
Contact Person
Phone Number
Address
Redriff.com
Examcram.com
72.3.246.59
Rutgers.edu
- Start by resolving the IP address. This can be done by pinging the site.
- Next, use a tool such as Sam Spade or any of the other tools mentioned throughout the Chapter. Some of these include
- To verify the location of the organization, perform a traceroute or a ping with the –r option.
- Use the ARIN, RIPE, and IANA to fill in any information you have yet to acquire.
- Compare your results to those found in Table 3.8.
Table 3.8. Passive Information Gathering
Domain Name |
IP Address |
Location |
Contact Person |
Phone Number |
Address |
Redriff.com |
64.235.246.143 |
Los Angeles, CA |
Admin |
213-683-9910 |
5482 Wilshire Blvd |
Examcram.com |
63.240.93.157 |
Old Tappan, NJ |
Kenneth Simmons |
201-784-6187 123 |
Old Tappan Rd |
Theregister.com |
72.3.246.59 |
Southport Merseyside, UK |
Philip Mitchell |
+44-798-089-8072 |
19 Saxon Road |
Rutgers.edu |
128.6.72.102 |
Piscataway, NJ |
Net Manager |
732-445-2293 |
110 Frelinghuysen Road |
3.2 Performing Active Reconnaissance
The best way to learn active information gathering is to use the tools. In this exercise, you will perform reconnaissance on your own internal network. If you are not on a test network make sure you have permission before scanning or it may be seen as the precursor of an attack.
Estimated Time: 15 minutes.
- Download the most current version of Nmap from www.insecure.org/nmap/download.html. For Windows systems, the most current version is 3.95.
- Open a command prompt and go to the directory that you have installed Nmap in.
- Run Nmap –h from the command line to see the various options.
- You'll notice that Nmap has many different options. Review and find the option for a full connect scan. Enter your result here: ______
- Review and find the option for a stealth scan. Enter your result here: ____
- Review and find the option for a UDP scan. Enter your result here: ____
- Review and find the option for a fingerprint scan. Enter your result here: ____
- Perform a full connect scan on one of the local devices you have identified on your network. The syntax is Nmap -sT IP_Address .
- Perform a stealth scan on one of the local devices you have identified on your network. The syntax is Nmap -sS IP_Address .
- Perform a UDP scan on one of the local devices you have identified on your network. The syntax is Nmap -sU IP_Address .
- Perform a fingerprint scan on one of the local devices you have identified on your network. The syntax is Nmap -O IP_Address .
- Observe the results of each scan Was. Nmap capable of successfully identifying the system? Were the ports it identified correct?
Exam Questions
-
Your client has asked you to run an Nmap scan against the servers they have located in their DMZ. They would like you to identify the OS. Which of the following switches would be your best option?
-
Which of the following should be performed first in any penetration test?
-
ICMP is a valuable tool for troubleshooting and reconnaissance. What is the correct type for a ping request and a ping response?
-
You have become interested in fragmentation scans and how they manipulate the MTU value. What is the minimum value specified for IP's MTU?
-
Which of the following does Nmap require for an OS identification?
-
Which of the following netcat commands could be used to perform a UDP scan of the lower 1024 ports.
-
Which of the following terms is used to refer to a network that is connected as a buffer between a secure internal network and an insecure external network such as the Internet?
-
What is a null scan?
-
You have captured some packets from a system you would like to passively fingerprint. You noticed that the IP header length is 20 bytes and there is a datagram length of 84 bytes. What do you believe the system to be?
-
Which of the following tools is used for passive OS guessing?
-
This type of scan is harder to perform because of the lack of response from open services and because packets could be lost due to congestion or from firewall blocked ports.
-
A connect or SYN scan of an open port produces which of the following responses from a target?
-
You have just performed an ACK scan and have been monitoring a sniffer while the scan was performed. The sniffer captured the result of the scan as an ICMP type 3 code 13. What does this result mean?
-
One of the members of your security assessment team is trying to find out more information about a client's website. The Brazilian-based site has a .com extension. She has decided to use some online whois tools and look in one of the regional Internet registries. Which of the following represents the logical starting point?
-
While footprinting a network, what port/service should you look for to attempt a zone transfer?
Answers to Exam Questions
-
1. D. Running Nmap –O would execute OS guessing. Answer A is incorrect, as Nmap –P0 means do not ping before scanning. Answer B is incorrect because Nmap –sO would perform a IP Protocol scan. Answer C is incorrect, as Nmap –sS would execute a TCP stealth scan.
-
2. C. Passive information gathering should be the first step performed in the penetration test. EC-Council defines seven steps in the pre-attack phase, which include passive information gathering, determining the network range, identifying active machines, finding open ports and access points, OS fingerprinting, fingerprinting services, and mapping the network. Answer A is incorrect because social engineering is not the first step in the process. Answer B is incorrect, as Nmap port scanning would not occur until after passive information gathering. Answer D is incorrect because OS fingerprinting is one of the final steps, not the first.
-
3. B. Ping is the most common ICMP type. A ping request is a type 8, and a ping reply is a type 0. All other answers are incorrect because a request is always a type 8 and a reply is always a type 0. An ICMP type 5 is redirect, and a type 3 is destination unreachable. For a complete listing of ICMP types and codes, reference RFC 792.
-
4. C. RFC 1191 specifies that when one IP host has a large amount of data to send to another host, the data is transmitted as a series of IP datagrams. IP is designed so that these datagrams be of the largest size that does not require fragmentation anywhere along the path from the source to the destination. The specified range is from 68 to 65535 bytes. Answer A is incorrect, as 1500 bytes is the MTU for Ethernet. Answer B is incorrect, as 576 bytes is the default MTU for IP. Answer D is incorrect because that value is the frame size for Ethernet.
-
5. A. Nmap requires one open and one closed port to perform OS identification. Answers B, C, and D are incorrect because none of these answers list one open and one closed port, which is the minimum required for OS identification.
-
6. D.. The proper syntax for a UDP scan using Netcat is Netcat –u –v –w2 <host> 1-1024. Netcat is considered the Swiss army knife of hacking tools because it is so versatile. Answers A, B, and C are incorrect because they do not correctly specify the syntax used for UDP scanning with netcat.
-
7. B. A DMZ is a separate network used to divide the secure inner network from the unsecure outer network. Services such as HTTP, FTP, and email may be placed there. Answer A is incorrect, as a proxy is simply a system that stands in place of and does not specifically define a DMZ. Answer C is incorrect because an IDS is used to detect intrusions or abnormal traffic. Answer D is incorrect, as a bastion host is a computer that is fully on the public side of the demilitarized zone and is unprotected by a firewall or filtering router.
-
8. B. A null scan is a TCP-based scan in which all flags are turned off. Answer A is incorrect because it describes a XMAS scan. Answer C is incorrect because this could describe a TCP full connect of a stealth scan. Answer D is incorrect, as it describes a TCP WIN scan.
-
9. B. Active fingerprinting works by examining the unique characteristics of each OS. One difference between competing platforms is the datagram length. On a Linux computer, this value is typically 84, whereas Microsoft computers default to 60. Therefore, answers A, C, and D are incorrect, as they are all Windows OSes.
-
10. B. P0f is a passive OS fingerprinting tool. Answers A, C, and D are incorrect, as Queso was the first active fingerprinting tool, Nmap is probably the most well-known, and Xprobe 2 is the next generation of OS fingerprinting tools. These active tools have the capability to look at peculiarities in the way that each vendor implements the RFCs. These differences are compared with its database of known OS fingerprints. Then a best guess of the OS is provided to the user.
-
11. C. UDP scanning is harder to perform because of the lack of response from open services and because packets could be lost due to congestion or a firewall blocking ports. Answer A is incorrect, as a stealth scan is a TCP-based scan and is much more responsive than UDP scans. Answer B is incorrect because an ACK scan is again performed against TCP targets to determine firewall settings. Answer D is incorrect, as FIN scans also target TCP and seek to elicit a RST from a Windows-based system.
-
12. A. A full connect or SYN scan of a host will respond with a SYN/ACK if the port is open. Answer B is incorrect, as an ACK is not the normal response to the first step of a three step startup. Answer C is incorrect because an RST is used to terminate an abnormal session. Answer D is incorrect because an RST/ACK is not a normal response to a SYN packet.
-
13. A. An ICMP type 3 code 13 is administrative filtered. This type response is returned from a router when the protocol has been filtered by an ACL. Answer B is incorrect, as the ACK scan only provides a filtered or unfiltered response; it never connects to an application to confirm an open state. Answer C is incorrect, as port knock requires you to connect to a certain number of ports in a specific order. Answer D is incorrect, as again, an ACK scan is not designed to report a closed port; its purpose it to determine the router or firewall's rule set. Although this might appear limiting, the ACK scan can characterize the capability of a packet to traverse firewalls or packet filtered links.
-
14. B. Regional registries maintain records from the areas from which they govern. ARIN is responsible for domains served within North and South America; therefore, would be the logical starting point for that .com domain. Answer A is incorrect because AfriNIC is the RIR proposed for Africa. Answer C is incorrect because APNIC is the RIR for Asia and Pacific Rim countries. Answer D is incorrect because RIPE is the RIR for European-based domains.
-
15. B. TCP port 53 is used for zone transfers; therefore, if TCP 53 is open on the firewall, there is an opportunity to attempt a zone transfer. Answer A is incorrect, as UDP 53 is typically used for DNS lookups. Answer C is incorrect because UDP 161 is used for SNMP. Answer D is incorrect, as TCP 22 is used for SSH.
Suggested Reading and Resources
www.infosecwriters.com/text_resources/doc/Demystifying_Google_Hacks.doc—Demystifying Google hacks
www.professionalsecuritytesters.org/modules.php?name=Downloads&d_op=getit&lid=13—Reconnaissance and footprinting cheat sheet
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/AdminTips/Network/nslookupandDNSZoneTransfers.html—DNS zone transfers
http://www.auditmypc.com/freescan/readingroom/port_scanning.asp—Port scanning techniques
http://johnny.ihackstuff.com/security/premium/The_Google_Hackers_Guide_v1.0.pdf—The Google Hackers Guide
http://www.securityfocus.com/infocus/1224—Passive fingerprinting
www.microsoft.com/technet/archive/winntas/maintain/tcpip.mspx—TCP/IP from a security viewpoint
www.sys-security.com/archive/papers/ICMP_Scanning_v2.5.pdf—ICMP usage in scanning