OSINT Techniques: Chapter 4 - Facebook OSINT
An exhaustive breakdown of Chapter 4 of Michael Bazzell's 'Open Source Intelligence Techniques', analyzing Facebook Graph architecture, numeric UID extraction, mobile endpoint exploitation, and interaction network mapping.
Welcome to our fourth chapter analysis covering “Open Source Intelligence Techniques: Resources for Searching and Analyzing Online Information” (Sixth Edition) by Michael Bazzell.
With billions of active accounts worldwide, Facebook represents one of the dense repositories of personal relationships, photographic timelines, location check-ins, and behavioral affiliations on Earth. However, conducting open source intelligence on Facebook presents unique operational obstacles: aggressive anti-scraping countermeasures, dynamic algorithmic feeds, client-side React obfuscation, and frequent privacy interface redesigns.
In Chapter 4: Facebook OSINT, Bazzell strips away the front-end interface to examine Facebook’s underlying data model: The Facebook Social Graph. While Facebook officially deprecated its original natural-language Graph Search, the fundamental relational database remains intact. In this comprehensive guide, we dissect modern Graph traversal, numeric User ID (UID) extraction, mobile endpoint exploitation via mbasic, and automated profile exfiltration.
Key Takeaways
- The Immutability of Numeric UIDs: Vanity URLs (
facebook.com/john.doe) can be modified at will, but Facebook’s underlying 64-bit numeric User ID (entity_id/ UID) is permanent and immutable, serving as the definitive anchor across investigations. - The Power of Mobile Endpoints (mbasic): The legacy mobile interface (
mbasic.facebook.com) strips modern React JavaScript, disables aggressive browser fingerprinting scripts, and presents raw HTML tables ideal for automated scraping and friend list extraction. - Graph Relational Triangulation: Even when a target’s profile is locked to strict “Friends Only” privacy, their digital footprint leaks through public comments on commercial pages, public group memberships, and photos uploaded and tagged by third parties.
- Algorithmic Shadowban Avoidance: Scraping Facebook via automated Python scripts without authentic session cookies or residential proxy rotation results in immediate account checkpoints and phone verification blocks.
Architectural & Investigative Workflow
The following flowchart illustrates the Facebook intelligence collection methodology:
flowchart TD
subgraph Identity_Resolution["Phase 1: Identifier Resolution"]
Vanity["Target Profile Vanity URL (e.g. facebook.com/target.user)"] --> ResolveUID["Numeric UID Extraction (Source HTML / OpenGraph)"]
ResolveUID --> ImmutableUID["Canonical 64-Bit Numeric UID (e.g. 100001234567890)"]
end
subgraph Mobile_Bypass["Phase 2: Mobile Interface Exploitation"]
ImmutableUID --> Mbasic["Access via mbasic.facebook.com/profile.php?id=UID"]
Mbasic --> Friends["Extract Complete Friend List & Mutual Graph"]
Mbasic --> Groups["Extract Public & Closed Group Affiliations"]
Mbasic --> Bio["Extract Education, Work, Family Relations"]
end
subgraph Graph_Triangulation["Phase 3: Relational & Interaction Triangulation"]
ImmutableUID --> TaggedPhotos["Query Photos Tagged by Third-Party Friends"]
ImmutableUID --> LikedPages["Extract Liked Fan Pages & Corporate Brands"]
ImmutableUID --> PublicEvents["Query Historical Event RSVPs & Check-Ins"]
end
subgraph Synthesis["Phase 4: Target Dossier Synthesis"]
Friends --> CrossRef["Cross-Platform Linkage (Instagram / LinkedIn)"]
TaggedPhotos --> CrossRef
Groups --> CrossRef
end
Technical Breakdown & Investigative Mechanics
1. The Social Graph Architecture & Numeric UID Resolution
Facebook organizes all entities (users, photos, posts, groups, pages, comments) as nodes in a giant relational graph connected by directional edges. While users interact with customizable vanity handles, internal APIs operate strictly on 64-bit integer User IDs (UIDs).
Methods for Resolving Numeric UIDs
When provided with a target vanity URL (https://www.facebook.com/target_person), an analyst must extract the underlying UID:
- Inspecting OpenGraph Meta Tags:
View page source and search for the OpenGraph metadata tags:
1 2
<meta property="al:android:url" content="fb://profile/100001234567890" /> <meta property="al:ios:url" content="fb://profile/100001234567890" />
- Searching Page Source for Entity Tokens:
Execute a text search inside the raw DOM source for:
"entity_id":""userID":""actorID":"
- Graph API Profile Photo Query:
Navigating directly to:
1
https://graph.facebook.com/target_person/picture?type=large
Will issue an HTTP 302 redirect whose destination URL contains the underlying numeric user ID within the CDN URL string.
2. Exploiting Legacy Mobile Endpoints (mbasic.facebook.com)
The desktop version of Facebook (www.facebook.com) is a massive Single Page Application (SPA) built with React, Relay, and GraphQL. It employs aggressive client-side anti-scraping monitors that track mouse movements and execute heavy obfuscated scripts.
In contrast, mbasic.facebook.com was engineered for low-bandwidth 2G mobile devices:
- Delivers zero client-side JavaScript.
- Renders all data as simple, parseable HTML tables (
<table>,<tr>,<td>). - Completely bypasses heavy browser fingerprinting checks.
- Loads at 10x the speed of the desktop portal.
1
2
# Example curl request to inspect a target profile via mbasic using an active session cookie
curl -s -A "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36" -b "c_user=1000987654321; xs=28%3Axxxxxxxxxx;" "https://mbasic.facebook.com/profile.php?id=100001234567890" | grep -o '<title>[^<]*</title>'
Key mbasic URL Navigation Endpoints:
- Friends List:
https://mbasic.facebook.com/profile.php?id=[UID]&v=friends - Mutual Friends:
https://mbasic.facebook.com/profile.php?id=[UID]&v=friends&mutual=1 - Timeline Photos:
https://mbasic.facebook.com/profile.php?id=[UID]&v=photos - About / Bio Details:
https://mbasic.facebook.com/profile.php?id=[UID]&v=info
3. Automated Facebook Profile Scraper (Python CLI)
The following Python script demonstrates how to authenticate with a dedicated sock-puppet session and extract a target’s friend roster cleanly from mbasic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
import time
import sys
HEADERS = {
"User-Agent": "Mozilla/5.0 (Linux; Android 12; Mobile) AppleWebKit/537.36"
}
def extract_friends(uid, cookies):
url = f"https://mbasic.facebook.com/profile.php?id={uid}&v=friends"
friends_list = []
with requests.Session() as s:
s.cookies.update(cookies)
while url:
print(f"[*] Fetching page: {url}")
response = s.get(url, headers=HEADERS)
if "login.php" in response.url:
print("[-] Error: Session expired or invalid cookies!")
sys.exit(1)
soup = BeautifulSoup(response.text, "html.parser")
# Extract friend profile links and display names
for a_tag in soup.select("table a[href*='profile.php'], table a[href*='/']"):
name = a_tag.get_text(strip=True)
href = a_tag.get("href")
if name and href and not href.startswith("#"):
friends_list.append((name, href))
# Locate pagination link (See More Friends)
more_link = soup.find("a", string=lambda t: t and "See More" in t)
if more_link and "href" in more_link.attrs:
url = "https://mbasic.facebook.com" + more_link["href"]
time.sleep(2.5) # OpSec rate-limiting jitter
else:
url = None
return friends_list
if __name__ == "__main__":
mock_cookies = {"c_user": "1000999888777", "xs": "mock_session_secret"}
target_uid = "100001234567890"
print(f"[*] Initiating OSINT extraction for UID: {target_uid}")
4. Triangulating Locked Profiles
When a target utilizes Facebook’s locked-profile mode (common in specific geographic regions), direct timeline access is restricted. Investigators deploy indirect triangulation:
- Tag Search via Friend Aggregators: If the target’s spouse, sibling, or close colleague has an open profile, reviewing the relative’s albums frequently reveals tagged pictures of the target containing physical residences, vehicle license plates, or workplace badges.
- Public Group Participation: Groups centered around specific hobbies, local neighborhood watches, or specialized technical topics index all member posts publicly. A user commenting inside a public group has zero privacy protection, regardless of their personal profile lock status.
- Historical Event RSVPs: Searching for the target’s UID in public event listings reveals historical attendance at conferences, political rallies, and social gatherings.
Real-World Case Scenario
Case Study: Unmasking an Anonymous Harassment Campaign
A corporate executive was targeted by an anonymous Facebook account posting defamatory allegations across local community groups. The account used a pseudonym and an anime profile picture, with all personal information set to private.
An OSINT analyst resolved the account’s vanity URL to an underlying numeric UID (
100011984210345). Navigating throughmbasic.facebook.com, the analyst inspected the account’s historical public comments on community boards.The analyst noticed the pseudonym had commented on a local high school alumni reunion page five years prior: “Can’t wait to see the Class of 2008!”
Cross-referencing the 2008 yearbook roster with the account’s mutual friend cluster (which contained four individuals with the same uncommon surname) allowed the investigator to identify the perpetrator as a disgruntled former contractor within six hours.
Defensive Countermeasures & OpSec Recommendations
For individuals and organizations seeking to lock down their Facebook attack surface:
- Enable Profile Locking: In supported countries, activate the “Lock Your Profile” feature to restrict full-size profile photo views, stories, and historical posts strictly to mutual friends.
- Disable Search Engine Indexing: Navigate to Settings > Privacy > Do you want search engines outside of Facebook to link to your profile? and set this toggle to No.
- Sanitize Past Public Posts: Use the “Limit Past Posts” utility in privacy settings to convert all historical public or “Friends of Friends” updates to “Friends Only” with a single click.
Conclusion & Next Steps
Chapter 4 illustrates that Facebook’s immense relational graph can be traversed systematically using numeric identifiers and lightweight mobile endpoints. By pivoting through mutual connections, public group interactions, and tagged assets, an investigator can bypass interface restrictions.
In Chapter 5: Twitter / X OSINT, we explore real-time intelligence gathering, mastering advanced temporal search queries, geospatial radius bounding, and extracting client-source metadata.
Practical Facebook Entity Resolution & Social Graph Cheat-Sheet
| Investigation Step | Methodology / Command | Analytical Outcome |
|---|---|---|
| Resolve Numeric Graph ID | curl -s 'https://www.facebook.com/vanity_name' | grep -o 'entity_id=[0-9]*' |
Extracts permanent immutable Facebook entity ID bypassing future vanity URL changes |
| High-Res Profile Picture | https://graph.facebook.com/<Numeric_ID>/picture?type=large&width=720&height=720 |
Fetches maximum resolution uncompressed profile photo for facial biometric analysis |
| Exact Keyword Search | https://www.facebook.com/search/posts/?q=%22exact+phrase%22 |
Queries public status updates containing target phrases or threat indicators |
| Public Video Metadata | yt-dlp --dump-json 'https://www.facebook.com/watch/?v=<Video_ID>' |
Extracts exact server upload timestamp, duration, uploader ID, and audio stream |
| Mutual Friends Graph Probe | https://www.facebook.com/browse/mutual_friends/?uid=<ID1>&node=<ID2> |
Isolates intersecting mutual associations across separate operational target accounts |
Authoritative References & Verified Investigative Sources
- Michael Bazzell, IntelTechniques: Facebook Toolchain and Search Architectures. https://inteltechniques.com/tools/Facebook.html.
- Meta for Developers: Graph API Overview and Object Node Architecture. https://developers.facebook.com/docs/graph-api/overview.
- Bellingcat: Investigating Social Media Networks and Public Facebook Groups. https://www.bellingcat.com/resources/.
- SANS Institute: Finding Answers with Social Media Intelligence and Graph Analysis. https://www.sans.org/blog/.
- Electronic Frontier Foundation (EFF): Protecting Yourself Against Social Media Tracking and Correlation. https://www.eff.org/.
Author: Abdulrahman M. Fathi (0x3bdo) • Cyber Security Engineer & Penetration Tester