Information Gathering

Passive and Active Reconnaissance

ko-fiarrow-up-right

Area
Description

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.

Category
Description

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

Brute Force TLD

DNS (53)chevron-right

Passive Recon Script

Passive DNS

Whois

Whoischevron-right

crt.sh

Filtered by the unique subdomains:

IP addresses

Tool

CertSniff

OpenSSL

Shodan

Shodan CLI:

Smap

ShoLister - Subdomains enum

ShodanSpider

LazyHunter

Nrich

Based on Shodan - No API rate limiting

FOFA

Netlas.io

Hunter

ZoomEye

Censys

Profundis

DNS Record

Metabigor

Subdomain Enumeration

DNS Subdomain Enumerationchevron-right

Virus Total

  1. Create an account on VirusTotal (https://www.virustotal.comarrow-up-right).

  2. Generate or locate your API key.

  3. Use the following endpoint to fetch URLs associated with a specific domain

circle-check

Virustotalx

Urlscan.io

Search for URL:

Dorking:

TheHarvester

Merge all files

Google Dorks

Google Dorkschevron-right

Domain.glass

Passive - Infrastructure

Netcraft

Wayback Machine

Web Enumerationchevron-right

Waymore

Passive - others

RIPE Database

Infra and known vulnerabilities

Web-Check

LeakIX

SecurityTrails

FullHunt

Onyphe

OSINT

OSINTchevron-right

Cloud

Cloudchevron-right

Mail

Emailschevron-right

Others

IntelX

  • Public company information

    • CGU / CGV : Search for names, emails, etc

    • Societe.com

  • Social medias:

  • Job Post - Search for technologies used, HR names, etc

  • Github, repos - See Credentials in Git Repos

Active - DNS

DNS Subdomain Enumeration

DNS Subdomain Enumerationchevron-right

DNS - Zone Transfer

DNS (53)chevron-right

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

Waf detection

Scan multiple subdomains

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

Slackchevron-right

Interesting Books

Interesting Bookschevron-right
circle-info

Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.

Support this Gitbook

I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.

ko-fiarrow-up-right

buymeacoffeearrow-up-right

Last updated