Host Discovery
Host Discovery
This is the initial phase of the engagement. The way you will discover the hosts you will be attacking depends on the type of engagement, scope of the engagement. Sometimes the target will provide a list of IP addresses and or domain names they want you to target. This will be the scope of your engagement and you may not be able to go outside of that scope. Other times you may have to find all the assets associated with the target without having any information other that what is publicly available.
Even if you are given a list of hosts for your engagement, you should attempt to use basic host discovery techniques to determine the visibility of the targets.
Basic Host Discovery Techniques
Ping Sweep
There are a few ways to conduct a ping sweep of a given IP space.
NMAP
Bash
CMD (TODO)
PowerShell (TODO)
DNS
Not all systems will respond to ICMP; however, they may have a DNS record. This is a two step process: 1.) Find DNS server(s) 2.) Query reverse DNS lookup.
1.) Find DNS Server
With this you should be able to tell what ip addresses are responding to requests.
2.) Query the DNS server
Keep in mind that the IP address is reversed. The IP 192.168.0.1 will show up as 1.0.168.192.
My Process
Steps
Find live hosts (10.11.1.1-10.11.1.254) 1. nmap sn scan for hosts that respond to ICMP
Create a list of IP addresses from the ping sweep
nmap scan specifically to find the potential Name Server(s).
Identify the Name Server(s)
Resolve hosts in the IP range.
For this keep in mind that not all of the live hosts may have responded to ICMP; however they may have a PTR record in DNS. For that reason, we will scan the entire range again.
Address needs to be one that you feel will resolve. Otherwise, you can use a list or use the ip-address.txt list.
Combine the lists
This crazy loop is going to take the DNS lookup and turn it into a comma separated value of IP,hostname.
These two loops will combine the two lists created earlier from the ping sweep and the resolving scan.
Format this in a markdown table format.
Create the folder structure for analyzing the systems
Scan all the hosts
Although this is technically getting into information-gathering (ports and services), I will include the initial scanning here.
There are a couple of approaches you can take with this:
Scan for only a specific ports of interest
21,22,23,25,53,80,110,111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080
The good thing about this method is that you get to start poking at services fast.
The bad thing about this method is that you may forget to go back and scan for all the other open ports which may lead to being stuck in rabbit holes.
The next question for this method is if we should scan for versions and run default scripts or not. I would suggest, scanning for versions and default scripts. Although it will be slower, it will still get you a lot of information in a shortish period of time.
Scan for all ports on all found IP addresses
This will take a long time so fire and go do something else.
The pro for doing this is that you will have all the opened ports already.
The negative for this is that you have to wait for a long time.
Last updated
Was this helpful?