Web probing
Another important aspect of subdomain enumeration is identifying web applications hosted on those subdomains. Most people perform pentesting on web applications only hence their accurate identification/discovery is essential.
Port 80 & 443 are the default ports on which web applications are hosted. But one must also check for web applications on other common web ports. Most times something hosted on other common ports is very juicy or paid less attention by organizations.
Tools
Author: projectdiscovery
Language: Go
Httpx is a fast multi-purpose toolkit that allows running multiple HTTP probers and find for web applications on a particular port. (find hosts ?) Httpx is a highly configurable tool, which means it provides a ton of flags. So, users can get a highly customizable output as per their needs.
Installation:
Running Httpx
Flags:
follow-redirects - Follows redirects (can go out-of-scope)
follow-host-redirects - Follows redirects if on the same host (helps to be in-scope)
random-agent - Uses a random user-agent for each request
status-code - Shows the status code
retries - Number of times to retry if response not received
no-color - Don't use colorized output (to avoid color Unicode issues in output file)
o - Output file
Probing on default ports:
By default, httpx will probes on port 80(HTTP) & 443(HTTPS). Organizations host their web applications on these ports. After subdomain enumeration, the next first task is identifying web applications where vulnerabilities are found in abundance.
Probing on common ports:
Most people check for web applications only on the default ports, but what they fail to check is whether an application is hosted on any other port?
Generally, there are around 88 common ports on which web applications may be hosted. So, it's our duty to check for them. 👉 Here👈 is the list of those common ports. Mostly anything hosted on these ports is very juicy and tends to yield a higher vulnerability.
Method:
1) Using httpx
Using httpx for common ports generally takes a lot of time as it needs to probe on a relatively higher amount of ports(88 in total). Hence, this method is feasible.
2) Using Unimap
Unimap is a port scanner that uses Nmap as its base. Using Unimap we quickly scan for whether any of those 88 common ports are open on the subdomain or not(this happens at a blazing fast speed). Once we know that a particular port is open on the subdomain we can later send HTTP probes using httpx and check whether a web application is available on that open port or not**.** This method is far more quicker than just using httpx.
What's so special about Unimap?
You would be wondering why didn't we use Nmap/Naabu for port scanning purposes right?
The answer lies in the way Unimap performs open port scanning.
Sometimes many subdomains point to the same IP address. Hence, scanning the same IP again & again would lead us to an IP ban or greater execution time.
Unimap uses its own technology to initially resolve the IP addresses of all subdomains, once this process is finished, it creates a vector with the unique IP addresses and launches a parallel scan with Nmap.
Installation:
Steps:
1) First let's initialize all the common ports into a variable called COMMON_PORTS_WEB
2) Now we will run a port scan to check all the open ports
3) Now that we have a list of open ports, we will check for web applications running on them using httpx.
That's it, we have got those hidden web applications running on common ports. Go ahead! and hunt on them. 🐞
📊 Some stats: 🤓
Method | Execution Time (150 subdomains) |
1st Method | 42min 51secs |
2nd Method | 55 secs ⚡ |
Last updated