Quiz 2

Cyber Crime — Phishing, Malware, Sybil Attacks

2046 words
10 min read
Python Week 1: the first filter for runtime behavior
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)
TypeDescriptionExample
Link PhishingMalicious links disguised as legitimate"Free Netflix! Click here: bit.ly/free-netflix"
Account CloningCopy someone's profile and impersonate themFake CEO asking for gift cards
CatfishingCreate entirely fake identity for long-term deceptionRomance scams
Spear PhishingTargeted 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:
FeatureBenignPhishing
URL domainKnown domainMisspelled (g00gle.com)
UrgencyNone"Act now!", "Limited time!"
GrammarNormalPoor grammar, awkward phrasing
SenderKnown identityRecently created account
RequestNatural conversationPassword, payment info
Python detection example:
python
import 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:
MessageSuspicious URLUrgencySensitive RequestScoreVerdict
"Check out this video"0000.0Benign
"URGENT: Verify at google-login.tk"1.00.20.31.0Phishing
"What time is the meeting?"0000.0Benign

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

TypeMechanismImpact
ClickjackingHidden overlay on "like" buttonUnwanted likes/shares
Drive-by downloadMalicious script runs in browserSilent infection
Social engineering wormsFake messages with malware linksPropagates through friend lists
Browser extensionsMalicious plugins requesting broad permissionsData 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:
StepActionTechnical Detail
1Victim receives message"You look funny in this video" + link
2Clicking link shows fake Flash updateSocial engineering page
3User downloads "Flash Player"Actually Koobface malware
4Malware steals cookiesCan access victim's account
5Sends same message to all friendsUses victim's social graph
6Each friend who clicks repeatsExponential spread
SIR Model for Koobface:
  • S (Susceptible): 1000 users in a network
  • I (Infected): 1 initial victim
  • R (Recovered): Users who installed antivirus
DaySIRR₀
099910
1995505.0
29802004.0
39406003.0
485514502.4
570030002.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

DefenseHow It WorksLimitations
CAPTCHAHuman verification at signupBypassed by captcha farms
Graph-based detectionSybil accounts have few connections to real usersSophisticated bots build trust gradually
Behavioral analysisDetect bot-like posting patternsHard to distinguish from power users
Phone verificationRequire unique phone numbersBurner phones are cheap
Trust networkOnly trust accounts vouched by trusted usersCold 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.
python
import 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

PracticeWhy It Helps
Enable 2FAPrevents account takeover even if password is stolen
Check URL before clickingHover to see real destination
Don't reuse passwordsA compromised site doesn't compromise your social media
Review app permissionsRemove unused third-party app access
Be skeptical of urgent messagesPhishing 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

ConceptDefinitionDefense
PhishingSocial engineering to steal credentialsURL verification, 2FA
Spear PhishingTargeted phishing with personal infoEmail authentication (DMARC)
Account CloningCopying profile to impersonateFriend request verification
ClickjackingHidden UI elements to trick clicksX-Frame-Options header
Drive-by DownloadAutomatic malware installationBrowser isolation
Sybil AttackCreating many fake accountsGraph-based detection
KoobfaceSocial media worm (2008)Antivirus, user awareness
CAPTCHAHuman verification systemRate 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

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.