Performing Open Source Intelligence Gathering
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
Open Source Intelligence (OSINT) gathering is the first active phase of a red team engagement, where operators collect publicly available information about the target organization to identify attack surfaces, potential targets for social engineering, technology stacks, and credential exposures. Effective OSINT directly shapes initial access strategies and reduces operational risk.
When to Use
Trigger phrases:
"performing open source intelligence gathering"
"Open Source Intelligence (OSINT) gathering is the first active phase of a red te"
When conducting security assessments that involve performing open source intelligence gathering
When following incident response procedures for related security events
When performing scheduled security testing or auditing activities
When validating security controls through hands-on testing
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Enumerate the target organization's external attack surface (domains, IPs, cloud assets)
- Identify employees and their roles for social engineering targeting
- Discover leaked credentials, API keys, and sensitive documents
- Map the organization's technology stack and vendors
- Identify physical locations, office layouts, and access control details
- Build target profiles for spearphishing campaign development
Core Concepts
This section covers core concepts for performing open source intelligence gathering.
- Ensure all prerequisites are met before proceeding
- Follow the documented workflow steps in sequence
- Record results and any anomalies encountered during this phase
OSINT Categories
| Category |
Sources |
Value |
| Domain Intelligence |
DNS records, WHOIS, CT logs, subdomain enumeration |
Network attack surface |
| Personnel Intelligence |
LinkedIn, social media, conference talks, publications |
Social engineering targets |
| Credential Intelligence |
Breach databases, paste sites, GitHub leaks |
Valid credential discovery |
| Technology Intelligence |
Job postings, Wappalyzer, Shodan, Censys |
Vulnerability identification |
| Physical Intelligence |
Google Maps, social media photos, Glassdoor |
Physical access planning |
| Document Intelligence |
SEC filings, public documents, metadata extraction |
Organizational structure |
MITRE ATT&CK Mapping
- T1595.001 - Active Scanning: Scanning IP Blocks
- T1595.002 - Active Scanning: Vulnerability Scanning
- T1592 - Gather Victim Host Information
- T1589 - Gather Victim Identity Information
- T1590 - Gather Victim Network Information
- T1591 - Gather Victim Org Information
- T1593 - Search Open Websites/Domains
- T1594 - Search Victim-Owned Websites
- T1596 - Search Open Technical Databases
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Scope and authorize — confirm written authorization and define target boundaries
- Reconnaissance — enumerate targets, services, and potential attack surfaces
- Exploitation — attempt exploitation of identified vulnerabilities within scope
- Post-exploitation — document access level, lateral movement, and data exposure
- Report and remediate — compile findings with reproduction steps and fix recommendations
Phase 1: Domain and Network Reconnaissance
- Perform WHOIS lookups for target domains
- Enumerate subdomains using Certificate Transparency logs, DNS brute-force, and web scraping
- Identify IP ranges and ASN ownership
- Scan for exposed services using Shodan/Censys
- Check for cloud storage buckets (S3, Azure Blob, GCS)
- Map CDN and hosting providers
Phase 2: Personnel and Social Intelligence
- Enumerate employees via LinkedIn, company website, and conference speaker lists
- Identify email naming conventions
- Discover personal social media accounts of key targets
- Map organizational hierarchy and reporting structure
- Identify recently hired IT/security personnel
- Check for conference presentations and technical publications
Phase 3: Credential and Data Leak Discovery
- Search breach databases (Have I Been Pwned, DeHashed)
- Check paste sites (Pastebin, GitHub Gists)
- Search GitHub/GitLab for leaked secrets and API keys
- Look for exposed configuration files and backups
- Check for leaked internal documents via Google dorking
Phase 4: Technology Stack Identification
- Analyze job postings for technology mentions
- Use Wappalyzer/BuiltWith for web technology fingerprinting
- Check for exposed admin panels and development environments
- Identify VPN and remote access technologies
- Map cloud services and SaaS applications
Defensive OSINT (Threat Intelligence)
When investigating external threat actors rather than preparing for red team operations, OSINT collection must remain strictly passive (no packets sent to target systems). Use this parallel workflow:
- Scope — Define research questions (e.g., "which threat actor targets our sector?"), identify data sources, set time boundaries
- Gather — Collect data from passive sources only: WHOIS records, passive DNS (SecurityTrails), certificate transparency logs (crt.sh), breach databases (Have I Been Pwned), dark web monitoring, Shodan historical data
- Synthesize — Enrich threat actor profiles with publicly observable indicators (IPs, domains, SSL certs, ASN data). Cross-reference findings with MITRE ATT&CK and known campaign indicators. Produce actionable threat intelligence reports
Key differences from offensive OSINT:
- No active scanning (no Nmap, no direct DNS queries to target)
- Focus on attribution and campaign tracking, not attack surface mapping
- Output is threat intelligence report, not red team recon report
- Emphasis on IOC extraction and enrichment, not exploitation planning
When NOT to Use
- You don't have explicit written authorization to test
- Task is about defense/detection, not offense (use detection skills)
- You need to implement security controls (use implementing-* skills)
- Task requires compliance auditing (use auditing-* skills)
- You're investigating an incident (use incident response skills)
- Target is out of scope for your engagement
- Task is about vulnerability scanning only (use scanning tools)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Exceeding the authorized scope of the engagement
- Leaving persistent access mechanisms without explicit approval
- Causing denial-of-service on production systems during testing
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- All exploited vulnerabilities documented with reproduction steps
- Scope boundaries confirmed — only authorized targets were tested
- Remediation recommendations included for every finding
Tools and Resources
| Tool |
Purpose |
Type |
| Amass |
Subdomain enumeration and network mapping |
Open Source |
| Subfinder |
Passive subdomain discovery |
Open Source |
| theHarvester |
Email, subdomain, and name harvesting |
Open Source |
| Maltego |
Visual link analysis and data correlation |
Commercial |
| SpiderFoot |
Automated OSINT collection |
Open Source |
| Shodan |
Internet-connected device search |
Commercial |
| Censys |
Internet asset discovery |
Commercial |
| Recon-ng |
Web reconnaissance framework |
Open Source |
| SecurityTrails |
Passive DNS historical data |
Commercial |
| crt.sh |
Certificate transparency log search |
Free |
| Have I Been Pwned |
Breached credential search |
Free |
| DomainTools |
WHOIS history and domain intelligence |
Commercial |
| GitDorker |
GitHub secret scanning |
Open Source |
| Photon |
Web crawler for OSINT |
Open Source |
Validation Criteria
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: performing-open-source-intelligence-gathering3description: Use when open Source Intelligence (OSINT) gathering is the first active4 phase of a red team engagement, where operators collect publicly available information5 about the target organization to identify attack s. Use when working with performing6 open source intelligence gathering.7domain: cybersecurity8subdomain: red-teaming9tags:10- red-team11- adversary-simulation12- mitre-attack13- exploitation14- post-exploitation15- osint16- reconnaissance17version: '1.0'18author: oyi7719license: Apache-2.020nist_csf:21- ID.RA-0122- GV.OV-0223- DE.AE-0724category: cybersecurity25metadata:26 source: https://skillmd.com/skills/oyi77/performing-open-source-intelligence-gathering27---2829# Performing Open Source Intelligence Gathering303132> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.3334## Overview3536Open Source Intelligence (OSINT) gathering is the first active phase of a red team engagement, where operators collect publicly available information about the target organization to identify attack surfaces, potential targets for social engineering, technology stacks, and credential exposures. Effective OSINT directly shapes initial access strategies and reduces operational risk.373839## When to Use40**Trigger phrases:**41- "performing open source intelligence gathering"42- "Open Source Intelligence (OSINT) gathering is the first active phase of a red te"434445- When conducting security assessments that involve performing open source intelligence gathering46- When following incident response procedures for related security events47- When performing scheduled security testing or auditing activities48- When validating security controls through hands-on testing4950## Prerequisites5152- Familiarity with red teaming concepts and tools53- Access to a test or lab environment for safe execution54- Python 3.8+ with required dependencies installed55- Appropriate authorization for any testing activities5657## Objectives5859- Enumerate the target organization's external attack surface (domains, IPs, cloud assets)60- Identify employees and their roles for social engineering targeting61- Discover leaked credentials, API keys, and sensitive documents62- Map the organization's technology stack and vendors63- Identify physical locations, office layouts, and access control details64- Build target profiles for spearphishing campaign development6566## Core Concepts6768This section covers core concepts for performing open source intelligence gathering.6970- Ensure all prerequisites are met before proceeding71- Follow the documented workflow steps in sequence72- Record results and any anomalies encountered during this phase73### OSINT Categories7475| Category | Sources | Value |76|----------|---------|-------|77| Domain Intelligence | DNS records, WHOIS, CT logs, subdomain enumeration | Network attack surface |78| Personnel Intelligence | LinkedIn, social media, conference talks, publications | Social engineering targets |79| Credential Intelligence | Breach databases, paste sites, GitHub leaks | Valid credential discovery |80| Technology Intelligence | Job postings, Wappalyzer, Shodan, Censys | Vulnerability identification |81| Physical Intelligence | Google Maps, social media photos, Glassdoor | Physical access planning |82| Document Intelligence | SEC filings, public documents, metadata extraction | Organizational structure |8384### MITRE ATT&CK Mapping8586- **T1595.001** - Active Scanning: Scanning IP Blocks87- **T1595.002** - Active Scanning: Vulnerability Scanning88- **T1592** - Gather Victim Host Information89- **T1589** - Gather Victim Identity Information90- **T1590** - Gather Victim Network Information91- **T1591** - Gather Victim Org Information92- **T1593** - Search Open Websites/Domains93- **T1594** - Search Victim-Owned Websites94- **T1596** - Search Open Technical Databases9596## Workflow9798```python99# Example: IOC detection100import re101102IOC_PATTERNS = {103 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",104 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",105 "hash_md5": r"\b[a-f0-9]{32}\b",106 "hash_sha256": r"\b[a-f0-9]{64}\b",107}108109def extract_iocs(text: str) -> dict:110 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}111```1121131. **Scope and authorize** — confirm written authorization and define target boundaries1142. **Reconnaissance** — enumerate targets, services, and potential attack surfaces1153. **Exploitation** — attempt exploitation of identified vulnerabilities within scope1164. **Post-exploitation** — document access level, lateral movement, and data exposure1175. **Report and remediate** — compile findings with reproduction steps and fix recommendations118### Phase 1: Domain and Network Reconnaissance1191. Perform WHOIS lookups for target domains1202. Enumerate subdomains using Certificate Transparency logs, DNS brute-force, and web scraping1213. Identify IP ranges and ASN ownership1224. Scan for exposed services using Shodan/Censys1235. Check for cloud storage buckets (S3, Azure Blob, GCS)1246. Map CDN and hosting providers125126### Phase 2: Personnel and Social Intelligence1271. Enumerate employees via LinkedIn, company website, and conference speaker lists1282. Identify email naming conventions1293. Discover personal social media accounts of key targets1304. Map organizational hierarchy and reporting structure1315. Identify recently hired IT/security personnel1326. Check for conference presentations and technical publications133134### Phase 3: Credential and Data Leak Discovery1351. Search breach databases (Have I Been Pwned, DeHashed)1362. Check paste sites (Pastebin, GitHub Gists)1373. Search GitHub/GitLab for leaked secrets and API keys1384. Look for exposed configuration files and backups1395. Check for leaked internal documents via Google dorking140141### Phase 4: Technology Stack Identification1421. Analyze job postings for technology mentions1432. Use Wappalyzer/BuiltWith for web technology fingerprinting1443. Check for exposed admin panels and development environments1454. Identify VPN and remote access technologies1465. Map cloud services and SaaS applications147148### Defensive OSINT (Threat Intelligence)149150When investigating external threat actors rather than preparing for red team operations, OSINT collection must remain strictly passive (no packets sent to target systems). Use this parallel workflow:1511521. **Scope** — Define research questions (e.g., "which threat actor targets our sector?"), identify data sources, set time boundaries1532. **Gather** — Collect data from passive sources only: WHOIS records, passive DNS (SecurityTrails), certificate transparency logs (crt.sh), breach databases (Have I Been Pwned), dark web monitoring, Shodan historical data1543. **Synthesize** — Enrich threat actor profiles with publicly observable indicators (IPs, domains, SSL certs, ASN data). Cross-reference findings with MITRE ATT&CK and known campaign indicators. Produce actionable threat intelligence reports155156**Key differences from offensive OSINT:**157- No active scanning (no Nmap, no direct DNS queries to target)158- Focus on attribution and campaign tracking, not attack surface mapping159- Output is threat intelligence report, not red team recon report160- Emphasis on IOC extraction and enrichment, not exploitation planning161162## When NOT to Use163164- You don't have explicit written authorization to test165- Task is about defense/detection, not offense (use detection skills)166- You need to implement security controls (use implementing-* skills)167- Task requires compliance auditing (use auditing-* skills)168- You're investigating an incident (use incident response skills)169- Target is out of scope for your engagement170- Task is about vulnerability scanning only (use scanning tools)171172173## Red Flags174175- Performing actions without explicit written authorization from the asset owner176- Testing against production systems without a defined scope and rules of engagement177- Exceeding the authorized scope of the engagement178- Leaving persistent access mechanisms without explicit approval179- Causing denial-of-service on production systems during testing180181## Verification182183- All steps executed successfully against a test environment before production use184- Output documented with screenshots or logs demonstrating expected behavior185- All exploited vulnerabilities documented with reproduction steps186- Scope boundaries confirmed — only authorized targets were tested187- Remediation recommendations included for every finding188189## Tools and Resources190191| Tool | Purpose | Type |192|------|---------|------|193| Amass | Subdomain enumeration and network mapping | Open Source |194| Subfinder | Passive subdomain discovery | Open Source |195| theHarvester | Email, subdomain, and name harvesting | Open Source |196| Maltego | Visual link analysis and data correlation | Commercial |197| SpiderFoot | Automated OSINT collection | Open Source |198| Shodan | Internet-connected device search | Commercial |199| Censys | Internet asset discovery | Commercial |200| Recon-ng | Web reconnaissance framework | Open Source |201| SecurityTrails | Passive DNS historical data | Commercial |202| crt.sh | Certificate transparency log search | Free |203| Have I Been Pwned | Breached credential search | Free |204| DomainTools | WHOIS history and domain intelligence | Commercial |205| GitDorker | GitHub secret scanning | Open Source |206| Photon | Web crawler for OSINT | Open Source |207208## Validation Criteria209210- [ ] Complete list of target domains and subdomains211- [ ] Employee list with roles and email addresses212- [ ] Technology stack identified213- [ ] Credential leak assessment completed214- [ ] Attack surface map documented215- [ ] OSINT report compiled for engagement team216217## Process2182191. Analyze the task requirements2202. Apply domain expertise2213. Verify output quality222223## Anti-Rationalization Table224225| Rationalization | Reality |226|---|---|227| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |228| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |229| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |