Red Team · Medium
OSINT Graph Methodology

Learn how to map relationships between domains, email addresses, IP addresses, and infrastructure using open source intelligence graph methodology — and understand the security implications for any network that leaves a digital footprint.

Medium Red Team Path ⏱ 20 min read
Learning Progress
0%

Maltego and OSINT Graphs

Maltego is a visual link analysis tool that maps relationships between entities — domains, IPs, email addresses, people, organisations, and infrastructure. It turns raw OSINT data into a visual graph that reveals connections invisible when looking at data sources individually.

In penetration testing, Maltego is used during the reconnaissance phase to build a complete picture of a target's digital footprint before any active scanning begins. A thorough Maltego investigation often surfaces attack vectors that automated scanners miss entirely.

💡Transforms: Maltego queries data sources via "transforms" — automated lookups against DNS, WHOIS, Shodan, HaveIBeenPwned, LinkedIn, and dozens of other sources — all from a single interface.

A Brief History

Maltego was originally developed by Paterva, a South African company, in the mid-2000s. It was initially conceived as a general-purpose link analysis tool — similar to what intelligence agencies had been using for decades to map human networks and financial relationships. The key innovation was automating the data collection layer: instead of an analyst manually researching each connection, Maltego could query dozens of public databases simultaneously and instantly visualize the results.

Over time, it evolved from a niche forensics tool into a mainstream fixture of both offensive security and investigative journalism. Today, Maltego is published by a dedicated company (also called Maltego) and integrates with hundreds of third-party data providers. Law enforcement agencies, corporate intelligence teams, and red teamers all use different flavors of the same core platform.

📌 Non-Technical Analogy

Imagine you're a detective in the 1950s and you've just been handed a single name scrawled on a napkin. You go to the library, the phone book, city records, the newspaper archive — pulling threads until you have a sprawling corkboard covered in index cards connected by red string. Maltego is that corkboard, except instead of spending days in a library, the connections populate in seconds by querying digital public records automatically. The "red string" between cards becomes actual graph edges; the index cards become entities you can click and expand further.

Entity Relationship Mapping

You start with a seed entity (e.g. a domain name) and run transforms against it. Each transform queries external sources and returns related entities, which you can then run further transforms against — expanding the graph iteratively.

OSINT Graph Expansion
Domain → DNS transforms →
  IP Addresses → WHOIS → ASN → Hosting Provider
  Subdomains  → Port scan → Services
  MX Records  → Email addresses → Breached credentials
  NS Records  → Registrar → Other domains (same registrar)

Transform Categories

Transforms are the engine of Maltego. Each one is essentially a scripted query to a specific data source. They fall into a few broad categories:

⚠️Passive vs Active: Most Maltego transforms are entirely passive — they query third-party databases that have already collected the data. This means the target organisation receives no indication it is being researched. A handful of transforms (e.g. direct DNS lookups) do generate traffic that touches the target's infrastructure, and these should be used with care during authorised engagements.

OSINT Investigation in Practice

Example 01Domain to IP mapping

Starting from a domain, DNS lookups reveal the hosting infrastructure — often shared across multiple target-owned domains.

host example-corp.com
example-corp.com has address 104.21.45.67
example-corp.com mail is handled by mail.example-corp.com

dig +short example-corp.com NS
ns1.cloudflare.com  ns2.cloudflare.com

# Reverse DNS on the IP:
dig -x 104.21.45.67
dev.example-corp.com   <-- different subdomain on same IP
Example 02Email address harvesting

Email addresses reveal employee names, naming conventions, and potential phishing targets.

theHarvester -d example-corp.com -b google,linkedin
[email protected]
[email protected]
[email protected]
# Pattern identified: firstname.lastname@
# Can now generate a full employee email list from LinkedIn
Example 03Certificate transparency logs

Every TLS certificate issued is publicly logged. Searching these logs reveals all subdomains ever certificated — including internal and staging systems.

curl "https://crt.sh/?q=%.example-corp.com&output=json" | jq '.[].name_value'
"staging.example-corp.com"
"internal.example-corp.com"
"vpn.example-corp.com"
"jira.example-corp.com"
Example 04Pivoting through infrastructure

Once you find a hosting IP, check what else is hosted there — often revealing related targets or forgotten domains.

curl "https://api.shodan.io/shodan/host/104.21.45.67?key=API_KEY"
Hostnames: ["example-corp.com", "old-corp.com", "dev-internal.com"]
Open ports: [80, 443, 8080, 22]
Software: nginx/1.18.0
# old-corp.com → likely legacy infrastructure → less patched

What You Need to Know

🕸️
Link Analysis
Visualising relationships between entities reveals patterns and connections that are invisible in raw data — the core value of Maltego.
🔄
Pivoting
Using one discovery to find the next. Email → breach database → password → reused on VPN. Each finding opens new paths.
📋
OSINT Sources
Shodan, crt.sh, HaveIBeenPwned, LinkedIn, WHOIS, Google dorking, GitHub, DNS records. All passive — no target interaction.
🎯
Attack Surface Mapping
The output of OSINT is a map of everything exposed. Every subdomain, employee, IP, and credential is a potential entry point.

Beyond the Basics — Extended OSINT Techniques

Once you understand the fundamentals, Maltego becomes considerably more powerful when you begin combining multiple data sources and running multi-hop investigations. The following techniques represent how professional red teamers and intelligence analysts actually use the tool — not just for collecting facts, but for building a narrative map of an organisation's vulnerabilities.

Supply Chain Reconnaissance

Modern organisations don't exist in isolation. They share data with dozens of vendors, SaaS platforms, and cloud providers. An attacker researching a hardened primary target will often look for a weaker link in the supply chain instead. Maltego excels at mapping these third-party relationships.

ScenarioThe Vendor Pivot

A red team is tasked with assessing a financial institution. The bank has excellent perimeter defenses — modern WAF, MFA on all public-facing systems, and a mature patch cycle. Direct attack looks difficult.

Using Maltego, the team maps the bank's email infrastructure. The MX records reveal a third-party email security vendor. A certificate transparency search for that vendor's domain surfaces a staging environment with an outdated CMS. The staging environment shares authentication with the production platform serving multiple bank clients.

The bank was never directly attacked — the path went through a trusted third party. This class of attack has been responsible for some of the most significant real-world breaches of the past decade.

📌 Non-Technical Analogy

Think of a medieval castle with impenetrable stone walls, a moat, and guards at the gate. An attacker who can't breach the walls directly might instead follow the supply wagons — the merchants and tradespeople who have regular, trusted access. If the baker who delivers bread to the castle every morning has a predictable route and carries a key to a side entrance, the castle's main defenses become irrelevant. Supply chain reconnaissance is exactly this: finding the trusted parties with keys, then compromising them instead.

Infrastructure Correlation

Organisations often use the same hosting provider, certificate authority, or analytics platform across multiple properties. When one of those shared infrastructure elements is identified, it can unlock visibility into a much broader footprint than the target intended to expose.

Google Analytics ID Pivot
# If example-corp.com uses Google Analytics ID: UA-12345678-1
# Search for other domains using the same Analytics ID:
curl "https://publicwww.com/websites/UA-12345678/" 
Found on:
  example-corp.com        ← known target
  corp-internal-tools.io  ← unknown internal tool
  example-corp-staging.net ← staging domain, not indexed

# The same tracking code appears on sites the organisation
# never intended to be discovered through their main domain.

Human Intelligence Graph Building

Maltego's person-centric transforms allow investigators to map individuals across platforms. Starting from a corporate email address, you can trace a person across LinkedIn, GitHub, Twitter, professional publications, and code repositories — building a comprehensive profile that often includes personal email addresses, home locations, and behavioral patterns.

This matters for social engineering and spear phishing scenarios. A convincing phishing email doesn't just use someone's name — it references their job title, recent projects, colleagues' names, and internal jargon. All of that is accessible through OSINT before a single packet is sent to the target.

Example 05The IT Administrator Profile

An email harvest surfaces [email protected]. Running person-centric transforms reveals:

[email protected]
  → LinkedIn: "James Harlow, Senior Network Engineer at Example Corp"
    → GitHub: "jharlow-ec"
      → Public repos: ansible playbooks for internal infrastructure
        → Hardcoded VLAN IDs, internal subnet ranges, server naming convention
    → Twitter: @jh_netsec
      → Posts about "migrating to FortiGate" (firewall brand identified)
      → Retweet about a known FortiGate vulnerability (CVE-XXXX-XXXX)

Without touching a single internal system, an attacker now knows the network engineer's name, internal infrastructure topology details, the firewall product in use, and a likely unpatched CVE — all from a single seed email address and publicly available data.

Autonomous System and BGP Mapping

For large organisations, Maltego can map their entire routable IP space by querying BGP routing data. Autonomous System Numbers (ASNs) are public records that associate IP address blocks with organisations. This can surface entire IP ranges the organisation owns — not just the ones publicly advertised on their website — including data center ranges, cloud provider allocations, and failover infrastructure.

ASN to IP Block Enumeration
# Organisation's primary IP → WHOIS → ASN
whois 104.21.45.67 | grep -i "asn\|org"
ASN: AS13335
Org: Example Corp Technologies Inc.

# Query all CIDR blocks registered to this ASN:
whois -h whois.radb.net -- '-i origin AS13335'
route: 104.21.44.0/22
route: 198.41.128.0/17
route: 172.64.0.0/13
# Now you have the ENTIRE routable IP space for this organisation.

Vulnerabilities Revealed Through Reconnaissance

The critical insight is this: Maltego doesn't exploit vulnerabilities — it finds them. The tool aggregates public information, but what that information reveals is often a detailed map of exploitable weaknesses. Understanding what types of vulnerabilities OSINT surfaces is essential for both attackers and defenders.

Vulnerability Type How OSINT Surfaces It Severity
Exposed staging/dev environments Certificate transparency logs reveal subdomains like staging.*, dev.*, test.* that are often misconfigured or unpatched High
Credential exposure Breach databases (HaveIBeenPwned, Dehashed) surface employee email/password combinations from historical data breaches High
Secrets in source code GitHub profile pivots from employee emails often reveal public repos containing API keys, internal hostnames, or infrastructure code High
Legacy/orphaned domains Reverse IP lookups and WHOIS pivots reveal domains that are no longer actively maintained — common targets for domain takeover attacks Medium
Technology fingerprinting Shodan/Censys banners, job postings, and social media reveal specific software versions in use — enabling targeted CVE lookup Medium
Organisational structure leakage Email harvesting and LinkedIn mapping expose reporting structures, team compositions, and which individuals hold privileged access roles Medium
VPN/remote access enumeration Certificate transparency often surfaces vpn.*, remote.*, or citrix.* subdomains, identifying the remote access technology in use High
Misconfigured DNS records WHOIS and DNS transforms surface dangling CNAME records, overly permissive SPF records, and missing DMARC policies Low–Med

The Credential Reuse Chain — A Deep Dive

One of the most powerful and frequently underestimated attack paths that OSINT enables is the credential reuse chain. This deserves detailed examination because it turns a seemingly minor exposure (an old LinkedIn breach from 2012) into a current, active threat.

Attack ChainFrom Old Breach to Active VPN Access

Step 1: Email harvest surfaces [email protected]

Step 2: HaveIBeenPwned transform shows this address was in the 2016 LinkedIn breach. The breach database contains a hashed password.

Step 3: The hash is cracked (LinkedIn used unsalted SHA-1 at the time, making this computationally trivial with modern hardware): password is Summer2016!

Step 4: Certificate transparency surfaced vpn.example-corp.com earlier. The VPN login portal is tested with michael.chen / Summer2016!

Step 5: The password has been reused. Michael never updated it after the LinkedIn breach. Access granted to the corporate VPN — and therefore the internal network — without any vulnerability being exploited in example-corp.com itself.

📌 Non-Technical Analogy

Imagine someone used the same key for their house, their car, and their office. Years ago, that key was copied at a hardware store that later experienced a robbery — duplicates were stolen. The person changed their house locks, but forgot about the office. Now, years later, someone with the stolen duplicate tries it in every door they can find. This is credential reuse: the original breach happened somewhere completely unrelated, but because the same secret was reused, it opens doors the attacker was never supposed to reach.

Subdomain Takeover

A particularly interesting vulnerability class exposed by OSINT is subdomain takeover. When an organisation sets up a DNS CNAME record pointing a subdomain to a third-party service (e.g., a Heroku app, GitHub Pages site, or S3 bucket), and then decommissions that service without removing the DNS record, the subdomain becomes "dangling" — pointing to a hostname that no longer exists.

An attacker can register the same hostname on the third-party platform, causing the organisation's subdomain to serve content they control. This is particularly dangerous because the browser trust model considers staging.example-corp.com to be fully trusted by users who trust example-corp.com — even if the content is now served by an attacker.

Dangling CNAME Detection
dig CNAME staging.example-corp.com
staging.example-corp.com. CNAME example-corp.herokudns.com.

curl -I https://example-corp.herokudns.com
HTTP/1.1 404 Not Found
Content-Type: text/html
X-Heroku-Error: No such app

# The CNAME target returns "No such app" — the Heroku app was
# deleted but the DNS record remains. An attacker can now claim
# this Heroku app name and serve content from staging.example-corp.com.

What This Means for Network Security

Understanding Maltego and OSINT methodology is not just an offensive skill — it is foundational to defensive security. An organisation cannot protect what it doesn't know exists, and OSINT is often how defenders discover their own unknown exposures. This section examines the security implications from both perspectives.

The Attack Surface You Don't Know About

Every organisation's "official" asset inventory is incomplete. IT departments know about the servers they provision and the domains they register — but the reality of a growing organisation is that shadow IT, forgotten infrastructure, and historical decisions create a much larger actual attack surface.

What organisations think they expose

Corporate website, public API endpoints, email server, known VPN gateway, listed office IP ranges.

What OSINT actually reveals

Staging servers from 3 years ago still running, a subsidiary's domain with a dangling CNAME, a departed employee's GitHub with internal API keys, an acquired company's legacy infrastructure, a marketing team's forgotten cloud bucket.

🔴Key Insight: The most dangerous assets in an organisation's footprint are the ones no one is actively monitoring — because no one remembers they exist. OSINT finds them before the attacker does, if defenders run it proactively.

The DNS Trust Problem

DNS is fundamental infrastructure, and OSINT exposes it comprehensively. From a network security standpoint, the information Maltego surfaces about an organisation's DNS configuration has several specific implications:

Implications for Infrastructure Design

The data that OSINT collects suggests several concrete implications for how infrastructure should be designed and managed:

HypotheticalThe Merger Scenario

CompanyA acquires CompanyB. The IT team focuses on integrating Active Directory, migrating email, and connecting the networks. Six months later, a red team runs Maltego on the merged organisation. They discover that CompanyB's old web application server — app.companybtech.com — is still running on a cloud instance that was never decommissioned. It's running a three-year-old version of a framework with known RCE vulnerabilities. The server has a VPN tunnel to the now-merged internal network as a remnant of the migration period. The instance exists in neither company's current asset register because it predates the acquisition.

The certificate transparency log had the subdomain. Shodan had the open port and banner. WHOIS had the registration that linked it to the corporate parent. A five-minute Maltego graph connected all of it. The server itself was never directly searched for — it was discovered by following edges in a graph.

Social Engineering Attack Surface

Network security tends to focus on technical controls — firewalls, IDS/IPS, patch management. But Maltego exposes something those tools can't address: the human attack surface. People are consistently the most exploitable element in any organisation's security posture, and OSINT enables extremely targeted social engineering.

A convincing pretext doesn't require hacking anything. It requires knowing enough about the target to sound credible. OSINT provides:

With this information, an attacker can craft a spear phishing email or phone call that sounds indistinguishable from internal communication — referencing real project names, real colleagues, and real technologies. No exploit required.

📌 Non-Technical Analogy

A con artist walks into a business they've never visited before. Before they arrived, they spent an hour reading the company's LinkedIn page, the CEO's Twitter, and the receptionist's public Facebook photos (which happened to show the office interior and employee name badges at the holiday party). When they walk up to the desk and say "Hi, I'm here from IT support — Sarah from accounting asked me to come look at her machine, she said she's been having issues since the network upgrade last Thursday" — they're drawing entirely on public information. They know Sarah works there, that there was a network upgrade (mentioned in a LinkedIn post), and that IT support visits are normal. The deception works not because of technical skill, but because of reconnaissance.

The Defensive Perspective — Red Team as Blue Team Intelligence

The most effective defensive use of Maltego is to run it against your own organisation before an attacker does. This is sometimes called "attack surface management" or "external exposure assessment," and it has become a core practice in mature security programs.

Defensive OSINT Actions

Continuous asset discovery: Automate periodic OSINT sweeps to detect new subdomains, IP blocks, and domain registrations associated with your organisation.

Credential monitoring: Subscribe to breach notification services and monitor for employee email addresses appearing in new data dumps.

GitHub scanning: Regularly scan public repositories for commits containing internal hostnames, API keys, or connection strings.

Infrastructure Hardening Responses

DMARC + DKIM + SPF: Ensure all email domains have strict policies to prevent spoofing of your domain in phishing attacks.

Certificate discipline: Audit CT logs regularly; retire certificates for systems that are decommissioned.

DNS hygiene: Remove dangling CNAMEs, disable zone transfers, and audit reverse DNS records for internal hostname leakage.

Best Practice: Organisations with mature security programs treat their own external OSINT footprint as a metric. They track the number of exposed subdomains, credentials in breach databases, and public GitHub secrets over time — and set targets for reduction. The question isn't "are we exposed?" — it's "how much, and are we improving?"

Broader Scenarios and Ethical Dimensions

Maltego and OSINT methodology extend well beyond traditional penetration testing. Understanding the full breadth of legitimate use cases — and the ethical boundaries that govern them — is essential for any security professional.

Legitimate Use Cases Beyond Pentesting

Legal and Ethical Boundaries

Because OSINT operates on publicly available data, it occupies a legally complex space. The information being queried is public — but the act of aggregating, analysing, and acting on it can cross legal and ethical lines depending on context.

🔴Critical Boundary: Running OSINT transforms that generate traffic directly against a target system — even "passive" DNS lookups that query the target's own nameservers — constitutes active reconnaissance. In a professional engagement, this requires written authorisation. Without it, it may violate the Computer Fraud and Abuse Act (US), the Computer Misuse Act (UK), or equivalent legislation in other jurisdictions.

The ethical framework for OSINT research generally breaks down along two axes:

Ethical DilemmaThe Employee Profile Problem

A security team running a red team engagement has explicit written permission to assess example-corp.com. In the course of mapping the attack surface, they build detailed profiles of individual employees — home addresses inferred from LinkedIn check-ins, family members identified through Facebook, personal email addresses found in breach databases.

This information could dramatically enhance the social engineering component of the assessment. But it raises a genuine ethical question: the employees of example-corp.com are not the authorised targets — the organisation's security posture is. Using personal data about private individuals — even when that data is technically public — may exceed the ethical and legal scope of the engagement, even with corporate authorisation.

Professional penetration testing firms address this by defining explicit rules of engagement that govern what categories of data are in scope. Personal data about individual employees that is not directly relevant to the technical assessment (home addresses, family information, personal social media) is typically excluded.

The Aggregation Problem

One of the most important concepts in OSINT ethics — and one with significant implications for network security policy — is the aggregation problem. Each individual piece of data collected by Maltego may be entirely public and seemingly innocuous. But when combined, they create something more sensitive than any individual piece.

📌 Non-Technical Analogy

Your name is public. Your employer is public (it's on LinkedIn). Your general neighbourhood is public (you mentioned your city in a tweet). Your car make and model is public (it's in a photo you posted). Your daily commute timing is somewhat inferrable from when you post on social media. Individually, none of these facts is sensitive. Aggregated together, they tell someone exactly where to find you, what vehicle you'll be in, and when you'll be there. This is the aggregation problem: the privacy violation doesn't exist in any single data point, but emerges from their combination. Maltego is, essentially, an aggregation engine — and that is precisely what makes it powerful and concerning in equal measure.

Reducing Your Organisation's OSINT Footprint

Security controls that address the vulnerabilities OSINT reveals fall into three categories: reduce what's exposed, monitor what can't be removed, and build resilience against what's discovered.

Reduce Exposure

Monitor What Remains

Build Resilience

💡Practitioner Insight: The security teams most resistant to OSINT-driven attacks aren't necessarily the ones that have locked down every data point. They're the ones that assume an attacker already has everything they can find publicly — and have built their defenses to account for it. Threat modeling from the perspective of "what could an attacker do with what's already public?" is a more realistic starting point than trying to achieve perfect information hygiene.

Core Concepts Summary

🕸️
Link Analysis
Visualising relationships between entities reveals patterns and connections invisible in raw data — the core value proposition of Maltego over traditional list-based OSINT.
🔄
Pivoting
Using one discovery to find the next. Email → breach → password → VPN. Each finding is a new seed entity. Attack paths emerge from following the graph.
📋
OSINT Sources
Shodan, crt.sh, HaveIBeenPwned, LinkedIn, WHOIS, Google dorking, GitHub, BGP data, passive DNS. All passive — no target interaction. All legal to query.
🎯
Attack Surface Mapping
The output of OSINT is a map of everything exposed. Every subdomain, employee, IP, credential, and vendor relationship is a potential entry point.
🧩
Aggregation Problem
Individual public data points are innocuous. Combined, they create detailed profiles. The privacy and security risk emerges from combination, not from any single piece.
🔗
Supply Chain Risk
A hardened primary target may be reachable via trusted third parties with weaker security. OSINT maps vendor relationships, enabling supply-chain pivot strategies.
🏷️
Subdomain Takeover
Dangling CNAME records pointing to decommissioned third-party services allow attackers to claim those hostnames, serving malicious content from trusted subdomains.
🔑
Credential Reuse
Breach databases contain historical passwords. When employees reuse passwords across personal and corporate accounts, historical breaches become current access paths.
Ready to put it into practice?
Proceed to the Lab

You've covered the theory. Now apply it hands-on in the simulated environment.

Start Lab — Maltego OSINT
← Return to all labs