Information Gathering
Domains and Subdomains
Often, we are given a single domain or perhaps a list of domains and subdomains that belong to an organization. Many organizations do not have an accurate asset inventory and may have forgotten both domains and subdomains exposed externally. This is an essential part of the reconnaissance phase. We may come across various subdomains that map back to in-scope IP addresses, increasing the overall attack surface of our engagement (or bug bounty program). Hidden and forgotten subdomains may have old/vulnerable versions of applications or dev versions with additional functionality (a Python debugging console, for example). Bug bounty programs will often set the scope as something such as *.inlanefreight.com
, meaning that all subdomains of inlanefreight.com
, in this example, are in-scope (i.e., acme.inlanefreight.com
, admin.inlanefreight.com
, and so forth and so on). We may also discover subdomains of subdomains. For example, let's assume we discover something along the lines of admin.inlanefreight.com
. We could then run further subdomain enumeration against this subdomain and perhaps find dev.admin.inlanefreight.com
as a very enticing target. There are many ways to find subdomains (both passively and actively) which we will cover later in this module.
IP ranges
Unless we are constrained to a very specific scope, we want to find out as much about our target as possible. Finding additional IP ranges owned by our target may lead to discovering other domains and subdomains and open up our possible attack surface even wider.
Infrastructure
We want to learn as much about our target as possible. We need to know what technology stacks our target is using. Are their applications all ASP.NET? Do they use Django, PHP, Flask, etc.? What type(s) of APIs/web services are in use? Are they using Content Management Systems (CMS) such as WordPress, Joomla, Drupal, or DotNetNuke, which have their own types of vulnerabilities and misconfigurations that we may encounter? We also care about the web servers in use, such as IIS, Nginx, Apache, and the version numbers. If our target is running outdated frameworks or web servers, we want to dig deeper into the associated web applications. We are also interested in the types of back-end databases in use (MSSQL, MySQL, PostgreSQL, SQLite, Oracle, etc.) as this will give us an indication of the types of attacks we may be able to perform.
Virtual Hosts
Lastly, we want to enumerate virtual hosts (vhosts), which are similar to subdomains but indicate that an organization is hosting multiple applications on the same web server. We will cover vhost enumeration later in the module as well.
Passive information gathering
We do not interact directly with the target at this stage. Instead, we collect publicly available information using search engines, whois, certificate information, etc. The goal is to obtain as much information as possible to use as inputs to the active information gathering phase.
Active information gathering
We directly interact with the target at this stage. Before performing active information gathering, we need to ensure we have the required authorization to test. Otherwise, we will likely be engaging in illegal activities. Some of the techniques used in the active information gathering stage include port scanning, DNS enumeration, directory brute-forcing, virtual host enumeration, and web application crawling/spidering.
Tool - Argus
The Ultimate Information Gathering Toolkit
Online Tool
Enum TLDs
Passive Recon Script
Passive DNS
Whois
Whoiscrt.sh
Filtered by the unique subdomains:
IP addresses
Tool
CertSniff
OpenSSL
Shodan
Smap
ShoLister - Subdomains enum
ShodanSpider
FOFA
Netlas.io
Hunter
ZoomEye
Censys
DNS Record
Metabigor
Subdomain Enumeration
DNS Subdomain EnumerationVirus Total
TheHarvester
Merge all files
Google Dorks
Google DorksDomain.glass
Passive - Infrastructure
Netcraft
Wayback Machine
Waymore
Passive - others
RIPE Database
Infra and known vulnerabilities
LeakIX
SecurityTrails
FullHunt
Onyphe
DomLink
OSINT
OSINTCloud
CloudMail
Others
IntelX
Public company information
CGU / CGV : Search for names, emails, etc
Societe.com
Social medias:
LinkedIn
Facebook
Twitter
Instagram
Youtube - See Credentials in Youtube videos
etc.
Job Post - Search for technologies used, HR names, etc
Github, repos - See Credentials in Git Repos
Active - DNS
DNS Subdomain Enumeration
DNS Subdomain EnumerationDNS - Zone Transfer
Active - Infrastructure
HTTP Headers
Cookies
.NET:
ASPSESSIONID<RANDOM>=<COOKIE_VALUE>
PHP:
PHPSESSID=<COOKIE_VALUE>
JAVA:
JSESSION=<COOKIE_VALUE>
Target Website - Source Code
Target Website - Comments
Whatwbeb
Wappalyser
Wafwoof
Aquatone
On ubuntu:
Lot of failed screen ==> Increase timeout option
firefox aquatone-out/aquatone_report.html &> /dev/null &
Eyewitness
exegol-CPTS /workspace # EyeWitness.py -f urls.txt --web
Gowitness
Slack Workspaces
SlackLast updated