Lab 08: Common Attack Vectors

🎯 Objective

Understand the most common attack vectors including phishing, man-in-the-middle (MITM), denial of service (DoS), and port scanning. Demonstrate port scanning on localhost to understand what attackers look for during reconnaissance.

📚 Background

An attack vector is the path or means by which an attacker gains unauthorized access to a system. Understanding attack vectors is fundamental to defense — you can't protect against attacks you don't understand. The most common vectors in real-world incidents are: phishing (52% of breaches per Verizon DBIR), exploitation of vulnerabilities, credential theft/brute force, and supply chain compromises.

Phishing exploits human psychology rather than technical vulnerabilities. Attackers craft convincing emails/websites that trick users into revealing credentials or installing malware. Spear phishing targets specific individuals with personalized content. Whaling targets executives. Vishing uses voice calls. Smishing uses SMS.

Man-in-the-Middle (MITM) attacks position the attacker between two communicating parties — intercepting, potentially modifying, and relaying communications. Attackers use ARP poisoning (on LANs), rogue Wi-Fi access points, DNS spoofing, or BGP hijacking. TLS/HTTPS defeats MITM when properly implemented.

Denial of Service (DoS) attacks overwhelm a target's resources — bandwidth, CPU, memory, or connection tables — making it unavailable to legitimate users. Distributed DoS (DDoS) uses botnets of thousands of compromised machines. Amplification attacks (DNS, NTP, memcached) achieve large traffic with small packets.

⏱️ Estimated Time

40 minutes

📋 Prerequisites

  • Labs 1-7 completed

  • Docker with innozverse-cybersec image

🛠️ Tools Used

  • nmap — Port scanning demonstration

  • python3 — Attack simulation concepts

  • curl — HTTP reconnaissance

🔬 Lab Instructions

Step 1: Port Scanning — What Attackers See First

📸 Verified Output:

💡 What this means: An attacker's first step is always reconnaissance — finding what ports are open. Open ports reveal running services that may have vulnerabilities. Port 8080 shows a web server; port 9090 shows some service. Closed ports are actively rejected. A real attacker would then probe each open service for version information and known vulnerabilities.

Step 2: Service Version Detection

📸 Verified Output:

💡 What this means: Version detection revealed "SimpleHTTPServer 0.6 (Python 3.10.12)" — now an attacker knows exactly what's running and can search for CVEs affecting this version. Banner grabbing like this is why security professionals recommend hiding server version information (use server_tokens off in nginx, remove X-Powered-By headers).

Step 3: Phishing Attack Anatomy

📸 Verified Output:

💡 What this means: Domain homoglyphs (paypa1.com vs paypal.com) are a classic trick — hard to spot at a glance. Urgency and fear are psychological triggers. In 2022, Twilio and Cloudflare were targeted by a sophisticated phishing campaign that stole 2FA codes in real time.

Step 4: MITM Attack Concept

📸 Verified Output:

💡 What this means: ARP poisoning is effective on local networks (coffee shop Wi-Fi, hotel networks). Tools like Ettercap and arpspoof automate this. The critical defense is HTTPS — even with traffic flowing through the attacker, they see only encrypted ciphertext they can't decrypt without the server's private key.

Step 5: DoS Attack Simulation Concept

📸 Verified Output:

💡 What this means: The 2018 GitHub DDoS (1.35 Tbps) exploited memcached servers for amplification — a 203-byte request triggered a 100MB response sent to the victim. Amplification factor of 51,000x! The defense was Akamai Prolexic (DDoS scrubbing service) that absorbed the traffic. Modern DDoS attacks are measured in terabits.

Step 6: SQL Injection Preview

📸 Verified Output:

💡 What this means: The '-- in the username closes the string and comments out the rest of the query, bypassing the password check entirely. This is one of the most common attack vectors — the 2009 Heartland Payment Systems breach (130 million credit cards stolen) used SQL injection. Defense: parameterized queries, input validation, WAF.

Step 7: Cross-Site Scripting (XSS) Attack Vector

📸 Verified Output:

💡 What this means: XSS lets attackers inject JavaScript into web pages viewed by other users. The injected script runs in the victim's browser context — it can steal session cookies, keylog passwords, redirect users, or silently perform actions. The British Airways breach (2018, 500,000 customers affected) was a JavaScript skimmer injected via XSS. Defense: output encoding, Content Security Policy (CSP).

Step 8: Credential Stuffing Attack

📸 Verified Output:

💡 What this means: Even a 0.1% success rate is profitable for attackers testing 1 billion credentials — that's 1 million compromised accounts. haveibeenpwned.com has over 12 billion compromised credentials. Defenses: unique passwords (use a password manager), MFA (makes stolen passwords useless), rate limiting login attempts, bot detection.

Step 9: Social Engineering — Pretexting

📸 Verified Output:

💡 What this means: The 2020 Twitter hack used vishing — attackers called Twitter employees posing as the IT department, obtained VPN credentials, and then hijacked accounts of Obama, Biden, and Musk to run a Bitcoin scam. Technical controls alone can't defend against social engineering — human awareness training is essential.

Step 10: Attack Kill Chain

📸 Verified Output:

💡 What this means: The Kill Chain model shows that an attack must progress through all 7 stages — disrupting ANY stage defeats the attack. This is why defense-in-depth (multiple security layers) is effective: even if perimeter defense fails, endpoint detection catches the installation stage; even if that fails, network monitoring catches C2 communications.

✅ Verification

📸 Verified Output:

🚨 Common Mistakes

  • Thinking technical defenses alone are enough: Social engineering bypasses all technical controls. Train your users.

  • Ignoring the kill chain stages: Attackers can be stopped at any stage. Don't assume perimeter defense is sufficient — implement defense-in-depth.

  • Underestimating phishing: It's the #1 attack vector. Sophisticated spear phishing emails can fool even technical users.

📝 Summary

  • Attack vectors range from technical exploits (SQL injection, XSS) to human exploitation (phishing, social engineering) — defense requires both technical controls and security awareness

  • The Cyber Kill Chain shows attacks happen in stages; disrupting any stage defeats the attack; defense-in-depth covers multiple stages

  • Port scanning is the attacker's first step — understanding what information you expose externally helps prioritize defenses

  • MITM attacks are defeated by TLS/HTTPS; credential stuffing by unique passwords and MFA; DoS by rate limiting and CDN/scrubbing

🔗 Further Reading

Last updated