Cyber Crime — Phishing, Malware, Sybil Attacks
2046 words
10 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Cyber Crime — Phishing, Malware, Sybil Attacks ## 🎯 Learning Objectives - Identify different types of phishing attacks on social media - Explain how malware propagates through social networks - Analyze Sybil attacks and their impact on network trust - Design defense mechanisms against social media cyber crimes -...

Cyber Crime — Phishing, Malware, Sybil Attacks
🎯 Learning Objectives
- Identify different types of phishing attacks on social media
- Explain how malware propagates through social networks
- Analyze Sybil attacks and their impact on network trust
- Design defense mechanisms against social media cyber crimes
- Evaluate real-world case studies of social media attacks
1. Phishing in Social Media
1.1 Intuition
Phishing is like a con artist calling your grandmother pretending to be you in trouble — they're impersonating someone trustworthy to steal information. On social media, phishing is amplified by the network effect: people trust messages from friends, so a compromised account can phish thousands through fake posts and messages.
1.2 Types of Social Media Phishing
(Diagram)
| Type | Description | Example |
|---|---|---|
| Link Phishing | Malicious links disguised as legitimate | "Free Netflix! Click here: bit.ly/free-netflix" |
| Account Cloning | Copy someone's profile and impersonate them | Fake CEO asking for gift cards |
| Catfishing | Create entirely fake identity for long-term deception | Romance scams |
| Spear Phishing | Targeted phishing using personal information | "Hi [name], I saw your post about [interest]..." |
1.3 Anatomy of a Phishing Attack
(Diagram)
1.4 Detection Features
Phishing posts and messages share common traits:
| Feature | Benign | Phishing |
|---|---|---|
| URL domain | Known domain | Misspelled (g00gle.com) |
| Urgency | None | "Act now!", "Limited time!" |
| Grammar | Normal | Poor grammar, awkward phrasing |
| Sender | Known identity | Recently created account |
| Request | Natural conversation | Password, payment info |
Python detection example:
pythonimport re from urllib.parse import urlparse def check_phishing_indicators(message): flags = [] scores = { 'suspicious_url': 0, 'urgency_language': 0, 'sensitive_request': 0 } # 1. Check for suspicious URLs urls = re.findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+])+', message) for url in urls: parsed = urlparse(url) domain = parsed.netloc.lower() # Check for common tricks if 'google' in domain and 'google.com' not in domain: scores['suspicious_url'] += 0.6 flags.append(f"Suspicious domain: {domain}") if any(tld in domain for tld in ['.tk', '.ml', '.ga', '.cf']): scores['suspicious_url'] += 0.4 # 2. Check urgency language urgency_words = ['urgent', 'immediately', 'act now', 'limited time', 'account suspended', 'verify now', 'click here'] for word in urgency_words: if word in message.lower(): scores['urgency_language'] += 0.2 flags.append(f"Urgency language: '{word}'") # 3. Check for sensitive requests sensitive = ['password', 'credit card', 'ssn', 'social security', 'login', 'bank account', 'verify your account'] for word in sensitive: if word in message.lower(): scores['sensitive_request'] += 0.3 flags.append(f"Sensitive request: '{word}'") total_score = sum(scores.values()) is_phishing = total_score >= 0.5 return { 'is_phishing': is_phishing, 'confidence': min(total_score, 1.0), 'flags': flags, 'detail_scores': scores } # Test messages = [ "Hey, check out this cool video! https://youtube.com/watch?v=abc", "URGENT: Your account will be suspended! Verify now at http://google-login.tk", "What time is the meeting tomorrow?" ] for msg in messages: result = check_phishing_indicators(msg) print(f"Phishing: {result['is_phishing']} (confidence: {result['confidence']:.2f})")
Tracing Table:
| Message | Suspicious URL | Urgency | Sensitive Request | Score | Verdict |
|---|---|---|---|---|---|
| "Check out this video" | 0 | 0 | 0 | 0.0 | Benign |
| "URGENT: Verify at google-login.tk" | 1.0 | 0.2 | 0.3 | 1.0 | Phishing |
| "What time is the meeting?" | 0 | 0 | 0 | 0.0 | Benign |
2. Malware Propagation
2.1 Intuition
Malware on social media spreads like a biological virus — someone clicks a malicious link, their account is compromised, and the malware uses their account to send more malicious links to all their friends. The social graph becomes the transmission vector.
2.2 Propagation Model
(Diagram)
2.3 Types of Social Media Malware
| Type | Mechanism | Impact |
|---|---|---|
| Clickjacking | Hidden overlay on "like" button | Unwanted likes/shares |
| Drive-by download | Malicious script runs in browser | Silent infection |
| Social engineering worms | Fake messages with malware links | Propagates through friend lists |
| Browser extensions | Malicious plugins requesting broad permissions | Data theft |
2.4 Worked Example: Koobface Worm
Koobface (2008-2012) was one of the first major social media worms. It targeted Facebook and Twitter users.
Propagation Steps:
| Step | Action | Technical Detail |
|---|---|---|
| 1 | Victim receives message | "You look funny in this video" + link |
| 2 | Clicking link shows fake Flash update | Social engineering page |
| 3 | User downloads "Flash Player" | Actually Koobface malware |
| 4 | Malware steals cookies | Can access victim's account |
| 5 | Sends same message to all friends | Uses victim's social graph |
| 6 | Each friend who clicks repeats | Exponential spread |
SIR Model for Koobface:
- S (Susceptible): 1000 users in a network
- I (Infected): 1 initial victim
- R (Recovered): Users who installed antivirus
| Day | S | I | R | R₀ |
|---|---|---|---|---|
| 0 | 999 | 1 | 0 | — |
| 1 | 995 | 5 | 0 | 5.0 |
| 2 | 980 | 20 | 0 | 4.0 |
| 3 | 940 | 60 | 0 | 3.0 |
| 4 | 855 | 145 | 0 | 2.4 |
| 5 | 700 | 300 | 0 | 2.1 |
Cumulative infected after 5 days: 300 users from a single initial infection.
3. Sybil Attacks
3.1 Intuition
A Sybil attack is when one person creates thousands of fake accounts to gain disproportionate influence. Imagine a town meeting where one person shows up with 1000 fake ballot cards — they can swing any vote. On social media, Sybil accounts can artificially inflate trends, spread propaganda, or manipulate recommendation algorithms.
3.2 The Attack Model
(Diagram)
3.3 Sybil Defense Mechanisms
| Defense | How It Works | Limitations |
|---|---|---|
| CAPTCHA | Human verification at signup | Bypassed by captcha farms |
| Graph-based detection | Sybil accounts have few connections to real users | Sophisticated bots build trust gradually |
| Behavioral analysis | Detect bot-like posting patterns | Hard to distinguish from power users |
| Phone verification | Require unique phone numbers | Burner phones are cheap |
| Trust network | Only trust accounts vouched by trusted users | Cold start problem for new users |
3.4 Graph-Based Sybil Detection
Key insight: Sybil accounts form dense clusters (Sybil region) with few edges to the honest region.
pythonimport networkx as nx import random def detect_sybil_nodes(graph, honest_seeds, beta=0.5): """ Detect Sybil nodes using random walk approach. Honest seeds are known legitimate users. """ sybil_scores = {} for node in graph.nodes(): # Run short random walks from honest seeds walks = 100 sybil_count = 0 for _ in range(walks): current = random.choice(honest_seeds) for step in range(10): # walk length if current == node: sybil_count += 1 break neighbors = list(graph.neighbors(current)) if not neighbors: break current = random.choice(neighbors) sybil_scores[node] = sybil_count / walks # Nodes rarely reached from honest seeds are likely Sybil return [n for n, s in sybil_scores.items() if s < beta]
4. Defense Strategies
4.1 Multi-Layer Defense
(Diagram)
4.2 Best Practices for Social Media Users
| Practice | Why It Helps |
|---|---|
| Enable 2FA | Prevents account takeover even if password is stolen |
| Check URL before clicking | Hover to see real destination |
| Don't reuse passwords | A compromised site doesn't compromise your social media |
| Review app permissions | Remove unused third-party app access |
| Be skeptical of urgent messages | Phishing relies on panic |
5. Common Pitfalls
Pitfall 1: Assuming Phishing is Obvious
The mistake: "I would never fall for a phishing attack — the spelling is always bad."
Why students make it: They've seen obvious phishing examples (broken English, Nigerian prince scams).
How to catch it: Modern spear phishing uses perfect grammar, personal information from your social media, and convincingly cloned sender identities.
Correct approach: Be skeptical of any unsolicited message requesting action, even if it looks perfect. Verify through a separate channel.
Pitfall 2: Underestimating Sybil Attack Reach
The mistake: "A few thousand fake accounts can't affect a platform with millions of users."
Why students make it: Thinking proportionally — 1000 bots among 1M users is only 0.1%.
How to catch it: Sybil accounts don't need to be a large percentage — they just need to coordinate. 1000 bots can all engage with the same post simultaneously, tricking algorithms into promoting it.
Correct approach: Consider coordinated behavior, not just raw numbers. A small, well-coordinated bot network can amplify content by orders of magnitude.
Pitfall 3: Ignoring the Human Element
The mistake: Building purely technical defenses without considering social engineering.
Why students make it: CS education focuses on technical solutions.
How to catch it: Real-world breaches often succeed because of human error, not technical failures. The best firewall can't stop a user from typing their password into a fake login page.
Correct approach: Combine technical controls (URL filtering, anomaly detection) with user education (security awareness training, simulated phishing tests).
6. Key Concepts Reference
| Concept | Definition | Defense |
|---|---|---|
| Phishing | Social engineering to steal credentials | URL verification, 2FA |
| Spear Phishing | Targeted phishing with personal info | Email authentication (DMARC) |
| Account Cloning | Copying profile to impersonate | Friend request verification |
| Clickjacking | Hidden UI elements to trick clicks | X-Frame-Options header |
| Drive-by Download | Automatic malware installation | Browser isolation |
| Sybil Attack | Creating many fake accounts | Graph-based detection |
| Koobface | Social media worm (2008) | Antivirus, user awareness |
| CAPTCHA | Human verification system | Rate limiting, proof-of-work |
7. 📝 Practice Questions
Q1: A message says "Your Facebook account has been compromised. Click here to secure it: faceb00k-security.com/login". What type of attack is this?Answer: This is a link phishing attack using URL typosquatting. "faceb00k" uses a zero instead of 'o' to create a lookalike domain. The urgency ("compromised") and call to action (click to secure) are classic phishing triggers. The attacker hopes the user won't notice the misspelled domain. Q2: How does account cloning differ from a Sybil attack?Answer: Account cloning targets a specific existing user by copying their profile information (photos, bio, friends) and sending friend requests to their connections. It's precision impersonation. A Sybil attack creates many fake accounts from scratch (not copying anyone) to manipulate the network at scale. Cloning is for targeted fraud; Sybil attacks are for algorithmic manipulation. Q3: In the Koobface worm, why was the social graph so effective for propagation?Answer: The social graph is effective because of trust: people are far more likely to click a link sent by a friend than by a stranger. By compromising a user's account, Koobface inherited their trust network. Each infected user became a new attack vector to their entire friend list, creating exponential propagation. This is the same mechanism that makes social media phishing so dangerous — trust is the transmission vector. Q4: A new social network has 10,000 users. An attacker creates 2,000 Sybil accounts. What percentage of the network is controlled by the attacker?Answer: Percentage = 2000 / (10000 + 2000) × 100 = 2000/12000 × 100 = 16.67%. With 16.67% of accounts under their control, the attacker can significantly influence trending topics, voting systems, and recommendation algorithms, especially during coordinated actions. Q5: Compare CAPTCHA with graph-based Sybil detection.Answer: CAPTCHA is a preventive control applied at account creation — it's hard to bypass but can be outsourced to captcha-solving farms ($0.001 per solve). Graph-based detection is a detective control that works post-creation — it's free to run but sophisticated Sybils can evade it by slowly building legitimate-looking connections. Best practice is to use both: CAPTCHA for initial filtering, graph analysis for ongoing monitoring. Q6: Why might a legitimate URL shortener (like bit.ly) be used in phishing attacks?Answer: URL shorteners mask the destination URL. A bit.ly link could redirect to any website, and the victim can't verify the destination before clicking. This makes it harder for automated filters to detect malicious URLs. Additionally, shorteners are commonly used in legitimate social media posts (due to character limits), so blocking them entirely isn't feasible. Q7: What behavioral patterns might distinguish a Sybil bot from a real user?Answer: Sybil bots often exhibit: (1) regular posting frequency (every exactly 30 min), (2) similar content across accounts (retweeting the same content), (3) rapid friend-request activity after creation, (4) primarily following accounts that follow back, (5) no real conversational engagement (replies are generic), (6) activity 24/7 with no sleep cycle, (7) accounts created in batches with similar timestamps. Q8: Explain the concept of "trust transitivity" in phishing defense.Answer: Trust transitivity means: if A trusts B, and B trusts C, should A trust C? In social media defense, this concept is used for Sybil detection — you trust accounts that are connected through chains of trust from known-honest users. However, transitivity has limits: A might not want to trust C just because B does. Graph-based detection algorithms (like SybilGuard) use this principle, assuming Sybil accounts can't form many trust edges to honest users. Q9: A clickjacking attack hides a "Like" button under a "Play Video" button. How does this work technically?Answer: The attacker creates a transparent iframe containing the target website's Like button, positioned exactly over the "Play Video" button that the user sees. When the user clicks what they think is a play button, they actually click the invisible Like button underneath. This is prevented by the X-Frame-Options HTTP header (set to DENY or SAMEORIGIN) which prevents your site from being embedded in iframes on other domains. Q10: What is the most effective single defense against social media account takeover?Answer: Two-Factor Authentication (2FA), particularly using an authenticator app (TOTP) or hardware key (FIDO2). Even if a phishing attack steals the user's password, the attacker cannot log in without the second factor. 2FA stops the vast majority of automated account takeover attacks. SMS-based 2FA is better than nothing but vulnerable to SIM-swapping attacks.
8. 🔗 Cross-References
- Week 5 - Case Studies: Real-world cyber crime cases
- Week 6 - Fake News: Malware and misinformation overlap
- Week 8 - Privacy: Anonymity vs. accountability
- BSCS4022 (OS): Access control, security fundamentals Join Discord PreviousWeb TrackingNextCryptography Basics