πŸ” CSCI623 Network Security

Complete Study Guide β€” Paper Exam Prep

DateJune 15, 2026
Time15:00 – 16:15
LocationAUD B1 Β· Seat 4
FormatPaper-based Written

⚠️ Priority topics: Cyber Attacks · Cryptography · VPN · ACL · Firewalls · Labs

Study Roadmap

Use this guide to replace opening PowerPoints manually. Each chapter has full notes, tables, examples, and embedded questions. The Flashcards and Quiz sections provide active recall practice.

ChapterKey TopicsPriority
1 β€” Network Security ConceptsCIA Triad, threats, malware, IDS/IPS, social engineeringMedium
2 β€” Firewall TechnologiesPacket filter, stateful, NGFW, DMZ, Cisco ASA, security levelsHigh
3 β€” CryptographySymmetric, Asymmetric, Hashing, PKI, TLS, Digital SignaturesHigh
4 β€” VPNIPsec, AH, ESP, IKE phases, SSL VPN, GRE, tunnel vs transportHigh
5 β€” ACLStandard, Extended, Named, wildcard masks, placement rulesHigh
6 β€” Cyber AttacksDoS/DDoS, SYN Flood, MITM, ARP, phishing, SQL injection, kill chainHigh
LabsNmap, Deauth, hping3 SYN flood, rockyou, WifiteHigh

Chapter 1: Network Security Concepts

1.1 The CIA Triad

The three foundational security principles every control must address:

PillarDefinitionAttack ExampleControl Example
ConfidentialityOnly authorized parties can read dataEavesdropping, sniffingEncryption, ACLs, VPNs
IntegrityData is not altered without authorizationMITM tampering, hash collisionHashing (SHA-256), digital signatures
AvailabilitySystems/data accessible when neededDoS/DDoS, ransomwareRedundancy, backups, rate limiting
Extra: AAA Framework β€” Authentication (who are you?), Authorization (what can you do?), Accounting (what did you do?). Used by RADIUS/TACACS+.

1.2 Threat Terminology

TermDefinition
ThreatPotential cause of an unwanted event (e.g., an attacker)
VulnerabilityWeakness that can be exploited
ExploitCode or technique that takes advantage of a vulnerability
RiskLikelihood Γ— Impact of a threat materializing
Attack surfaceAll possible entry points for an attacker
Zero-dayUnknown vulnerability with no available patch
CVECommon Vulnerabilities and Exposures β€” public database of known vulnerabilities

1.3 Attacker Types

TypeMotivationSkill Level
Script KiddieCuriosity / bragging rightsLow (uses existing tools)
HacktivistPolitical / ideologicalMedium
CybercriminalFinancial gainMedium–High
Nation-state / APTEspionage, sabotageVery High
Insider ThreatDisgruntled employee / accidentalVariable

1.4 Malware Types

TypeBehaviorExample
VirusAttaches to host file, spreads when file executesILOVEYOU
WormSelf-replicates across network without host fileWannaCry, Morris
TrojanLooks legitimate, hides malicious payloadRemote-access Trojans
RansomwareEncrypts data, demands payment for decryption keyCryptoLocker, NotPetya
RootkitHides itself/other malware at OS or firmware levelSony BMG rootkit
SpywareSilently monitors/steals user dataPegasus, keyloggers
AdwareDisplays unwanted ads, may redirect browserβ€”
Botnet/BotCompromised host controlled by C2 server for attacksMirai (IoT botnet)
Logic BombDormant until trigger condition (date, event)β€”

1.5 Social Engineering

Types

Social engineering exploits human psychology, not technology. No firewall stops a phishing email that convinces the user to enter credentials on a fake site.

1.6 IDS vs IPS

FeatureIDS (Intrusion Detection System)IPS (Intrusion Prevention System)
PositionOut-of-band (passive tap)Inline (in traffic path)
Action on alertLogs and alerts onlyDrops/blocks malicious traffic
Impact on trafficNone (no blocking)Adds latency; can block legitimate traffic (false positive)
Failure modeFail-open (traffic continues)Fail-open or fail-closed (configurable)

Detection Methods

1.7 Defense-in-Depth

Layered security strategy β€” no single control is sufficient. Layers include:

  1. Physical security (locks, badges)
  2. Perimeter (firewall, IPS)
  3. Network (VLANs, ACLs)
  4. Host (antivirus, patch management)
  5. Application (input validation, WAF)
  6. Data (encryption, DLP)
  7. User (training, awareness)

Practice Questions β€” Ch1

Q: Which CIA pillar does a DDoS attack target?
A: Availability
Q: What is the difference between a worm and a virus?
A: A virus requires a host file to spread; a worm self-replicates independently across the network.
Q: IDS is placed _______ while IPS is placed _______ in the network.
A: Out-of-band (passive) / Inline (active)

Chapter 2: Firewall Technologies

2.1 Firewall Overview

A firewall is a network security device that monitors and controls incoming/outgoing traffic based on predefined security rules. It establishes a barrier between trusted internal networks and untrusted external networks.

2.2 Firewall Types (Generation)

TypeOSI LayerHow it worksProsCons
Packet Filtering (1st gen)3–4Inspects each packet in isolation: src/dst IP, port, protocolFast, simple, low overheadNo state tracking, easily spoofed, no application awareness
Stateful Inspection (2nd gen)3–4Tracks TCP/UDP connection state table; allows return traffic for established sessionsBetter than packet filter; tracks stateNo application awareness; can't inspect encrypted payloads
Application Layer / Proxy (3rd gen)7Acts as proxy; deep packet inspection of application data (HTTP, FTP, DNS)Can block malicious payloads; URL filteringSlow, complex, must decode each protocol
NGFW (Next-Gen)2–7Stateful + DPI + Application ID + IPS + SSL inspection + user identity + URL filteringComprehensive visibility and controlExpensive, high CPU, complex config

2.3 Stateful Inspection Deep Dive

The firewall maintains a state table (connection tracking table). For each TCP connection:

Example State Table Entry:
Src: 192.168.1.10:54321  Dst: 8.8.8.8:80  Proto: TCP  State: ESTABLISHED

2.4 DMZ (Demilitarized Zone)

A DMZ is a separate network segment that sits between the external (Internet-facing) and internal networks, hosting public-facing services like web servers, mail servers, and DNS servers.

Internet ──── [Firewall Outside] ──── DMZ (Web/Mail/DNS) ──── [Firewall Inside] ──── Internal LAN
Two-firewall DMZ: One firewall between Internet and DMZ, another between DMZ and LAN β€” more secure but more expensive.

2.5 Cisco ASA (Adaptive Security Appliance)

Security Levels

ASA assigns a security level (0–100) to each interface:

LevelInterface NameTrustDefault behavior
100InsideMost trustedTraffic flows out freely
0OutsideLeast trustedTraffic blocked inbound by default
1–99DMZ (custom)IntermediateDepends on level difference
Rule: Traffic flows freely from higher security level to lower (inside β†’ outside). Traffic from lower to higher is blocked unless explicitly permitted by an ACL.

Key ASA Commands

! Enter privileged exec mode
enable

! Enter global configuration mode
configure terminal

! Configure interface
interface GigabitEthernet0/0
  nameif outside
  security-level 0
  ip address 203.0.113.1 255.255.255.0
  no shutdown

interface GigabitEthernet0/1
  nameif inside
  security-level 100
  ip address 192.168.1.1 255.255.255.0
  no shutdown

interface GigabitEthernet0/2
  nameif dmz
  security-level 50
  ip address 172.16.1.1 255.255.255.0
  no shutdown

! NAT β€” inside to outside
nat (inside,outside) dynamic interface

! Access list β€” permit HTTP from outside to DMZ web server
access-list OUTSIDE_IN permit tcp any host 172.16.1.10 eq 80
access-group OUTSIDE_IN in interface outside

! Show commands
show interface
show running-config
show access-list
show conn           (connection table)

ASA NAT Types

NAT TypeDescriptionUse Case
Dynamic NATOne-to-one mapping from poolMultiple internals β†’ multiple public IPs
Dynamic PAT (overload)Many-to-one, different port numbersMost common; home routers
Static NATFixed one-to-one mappingServers accessible from outside (DMZ)
Identity NATNo address translationVPN traffic (bypass NAT for IPsec)

2.6 NGFW Features

2.7 Firewall Deployment Modes

ModeLayerHas IP?Best for
Routed mode3 (default)Yes β€” each interface has IPStandard deployment, can route between subnets
Transparent mode2 (bridge)No (uses management IP only)Drop-in between existing segments without re-IP

Practice Questions β€” Ch2

Q: An ASA interface with security level 0 is called what?
A: Outside (least trusted)
Q: What does a stateful firewall track that a packet filter does not?
A: Connection state β€” it maintains a state table of active sessions and allows return traffic automatically.
Q: Where are public-facing servers (web, mail, DNS) typically placed?
A: In the DMZ
Q: Which firewall generation operates at Layer 7 and can inspect application data?
A: Application-layer firewall (proxy firewall) and NGFW

Chapter 3: Cryptography

3.1 Cryptography Fundamentals

TermDefinition
PlaintextOriginal readable data
CiphertextEncrypted unreadable data
EncryptionConverting plaintext β†’ ciphertext using a key and algorithm
DecryptionConverting ciphertext β†’ plaintext using a key and algorithm
KeySecret value that controls the encryption/decryption process
Algorithm (Cipher)Mathematical function for encryption

3.2 Symmetric Encryption

Same key used for encryption and decryption. Fast, used for bulk data.

Key Management Problem

The key must be securely shared before communication begins. With N parties, you need N(N-1)/2 keys.

AlgorithmKey SizeBlock SizeStatusNotes
DES56-bit effective64-bit❌ BrokenVulnerable to brute force (exhausted in <24h)
3DES (Triple DES)112 or 168-bit64-bit⚠️ DeprecatedApply DES three times: E-D-E with 3 keys
AES128, 192, 256-bit128-bitβœ… Current standardAdopted by NIST 2001; used in WPA2, TLS, IPsec
RC4Variable (40–2048 bit)Stream cipher❌ BrokenUsed in WEP, SSL (both broken)
Blowfish32–448-bit64-bit⚠️ OlderFast, public domain

Block Cipher Modes

ModeNameNotes
ECBElectronic CodebookSame block β†’ same ciphertext; DO NOT USE for images/structured data
CBCCipher Block ChainingEach block XOR'd with previous ciphertext; needs IV. Most common.
CTRCounter ModeTurns block cipher into stream cipher; parallelizable
GCMGalois/Counter ModeAuthenticated encryption (confidentiality + integrity); used in TLS 1.3

3.3 Asymmetric Encryption (Public-Key Cryptography)

Uses a mathematically linked key pair: public key (share freely) + private key (keep secret).

AlgorithmKey SizeBased OnUse Case
RSA2048–4096 bitFactoring large primesKey exchange, digital signatures, PKI
Diffie-Hellman (DH)2048+ bitDiscrete logarithmKey exchange only (no encryption/signing directly); IKE Phase 1
ECC (Elliptic Curve)256–521 bitElliptic curve discrete logSmaller keys, same security as RSA; TLS, mobile
DSA1024–3072 bitDiscrete logarithmDigital signatures only (not encryption)
DH vs RSA: DH is used to negotiate a shared secret (key agreement). RSA can both sign and encrypt. DH alone does not authenticate β€” it's combined with RSA/certificates in TLS/IKE for authentication.

3.4 Hashing

A one-way function that produces a fixed-size digest (fingerprint) from any input. Cannot be reversed.

Properties of a Good Hash

AlgorithmOutput SizeStatusNotes
MD5128-bit (32 hex)❌ Broken (collisions)Still used for checksums, NOT security
SHA-1160-bit (40 hex)❌ DeprecatedCollisions found in 2017 (SHAttered)
SHA-256256-bit (64 hex)βœ… Current standardPart of SHA-2 family; Bitcoin, TLS, IPsec
SHA-3224–512 bitβœ… ApprovedDifferent design from SHA-2; Keccak algorithm
HMACDepends on hashβœ… Used widelyHash + shared secret key β†’ authentication + integrity

Hash Use Cases

3.5 Digital Signatures

Process for authenticating data origin and ensuring integrity:

  1. Sender computes hash of the message
  2. Sender encrypts the hash with their private key β†’ this is the digital signature
  3. Sender sends message + digital signature
  4. Receiver decrypts signature using sender's public key β†’ recovers hash
  5. Receiver hashes the received message independently
  6. If both hashes match β†’ message is authentic and unmodified
Digital signatures provide: Authentication (came from key owner), Integrity (not tampered), Non-repudiation (cannot deny sending).

3.6 PKI (Public Key Infrastructure)

PKI is the framework of policies, procedures, and technologies for managing digital certificates and public keys.

Components

ComponentRole
CA (Certificate Authority)Issues and signs digital certificates (e.g., DigiCert, Let's Encrypt)
RA (Registration Authority)Verifies identity before CA issues certificate
Digital Certificate (X.509)Binds public key to an entity; signed by CA
CRL (Certificate Revocation List)List of revoked certificates
OCSPOnline Certificate Status Protocol β€” real-time revocation check

X.509 Certificate Contents

Chain of Trust

Root CA β†’ Intermediate CA β†’ End-entity Certificate. Browser trusts root CAs in built-in trust store.

3.7 TLS (Transport Layer Security)

TLS secures communications over TCP. Successor to SSL (SSL is deprecated).

TLS 1.2 Handshake

  1. ClientHello β€” Client sends supported cipher suites, TLS version, random nonce
  2. ServerHello β€” Server selects cipher suite, sends its certificate (with public key)
  3. Certificate Verify β€” Client verifies server certificate via PKI chain
  4. Key Exchange β€” Client generates pre-master secret, encrypts with server public key (RSA) or DH key exchange
  5. Session Keys Derived β€” Both sides derive symmetric session keys from pre-master secret + nonces
  6. Finished β€” Both send Finished message encrypted with session key to confirm
TLS 1.3 (2018): Only forward-secret cipher suites, removed RSA key exchange (uses only DH/ECDH), 1-RTT handshake (vs 2-RTT in 1.2), removed MD5/SHA-1/RC4.

Cipher Suite Notation

TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
β”‚    β”‚     β”‚       β”‚       β”‚      β”‚
β”‚    β”‚     β”‚       β”‚       β”‚      └─ Hash (HMAC)
β”‚    β”‚     β”‚       β”‚       └─ Mode
β”‚    β”‚     β”‚       └─ Bulk encryption algorithm + key size
β”‚    β”‚     └─ Authentication (certificate type)
β”‚    └─ Key Exchange (ECDHE = Elliptic Curve Diffie-Hellman Ephemeral)
└─ Protocol

3.8 Symmetric vs Asymmetric Summary

FeatureSymmetricAsymmetric
KeysOne shared keyKey pair (public + private)
SpeedFast (1000x faster)Slow
Key distributionDifficult (must share secret)Easy (public key is public)
Use caseBulk data encryptionKey exchange, digital signatures, authentication
ExamplesAES, 3DES, DESRSA, DH, ECC
In TLSSession data encryptionKey exchange + certificate authentication

Practice Questions β€” Ch3

Q: Why is asymmetric encryption not used to encrypt bulk data?
A: It is much slower than symmetric encryption. Asymmetric is used only for key exchange and authentication; the session data is encrypted with symmetric AES.
Q: What makes SHA-256 different from MD5?
A: SHA-256 produces a 256-bit output and is collision-resistant; MD5 (128-bit) has known collisions and is broken for security use.
Q: What is the purpose of a CA in PKI?
A: A CA issues and digitally signs certificates, binding a public key to an identity, creating a chain of trust.
Q: In a digital signature, the sender signs with their ______ key.
A: Private key

Chapter 4: VPN (Virtual Private Networks)

4.1 VPN Overview

A VPN creates an encrypted tunnel over a public network (Internet), allowing remote hosts to communicate as if on the same private network.

VPN TypeUse CaseProtocol
Site-to-SiteConnect two office networks permanentlyIPsec
Remote AccessIndividual users connect to corporate networkSSL VPN, IPsec with client
ExtranetConnect to partner/supplier networkIPsec

4.2 IPsec (Internet Protocol Security)

IPsec is a suite of protocols that provides authentication, integrity, and confidentiality at the IP layer (Layer 3).

IPsec Protocols

ProtocolPurposeProvidesHeader added?
AH (Authentication Header)Integrity + AuthenticationAuthentication, anti-replay, no encryptionYes β€” IP Protocol 51
ESP (Encapsulating Security Payload)Encryption + optional AuthConfidentiality, integrity, authenticationYes β€” IP Protocol 50
AH does NOT encrypt data β€” it only authenticates. ESP provides both encryption and authentication. In practice, ESP is almost always used over AH because it provides confidentiality.

IPsec Modes

ModeWhat's protectedOriginal IP headerUse case
Transport ModeOnly the payload (data)Preserved (visible)End-to-end between hosts (e.g., L2TP/IPsec client)
Tunnel ModeEntire original IP packetEncapsulated (hidden)Site-to-site VPN between gateways
Transport Mode:  [Original IP Header | ESP Header | Payload | ESP Trailer | ESP Auth]
Tunnel Mode:     [New IP Header | ESP Header | Original IP Header | Payload | ESP Trailer | ESP Auth]

4.3 IKE (Internet Key Exchange)

IKE is the protocol that negotiates and establishes IPsec SAs (Security Associations). Uses UDP port 500 (IKEv1) or UDP 500/4500 (IKEv2).

IKE Phase 1 β€” Management Tunnel

Goal: Establish a secure, authenticated channel (ISAKMP SA) to protect Phase 2 negotiation.

IKE Phase 2 β€” Data Tunnel (IPsec SA)

Goal: Establish the actual IPsec SA for data encryption. Uses the Phase 1 tunnel for protection.

Memory trick: Phase 1 = Protect the negotiation. Phase 2 = Protect the data.

Security Association (SA)

An SA is a one-directional logical connection that defines: protocol (ESP/AH), key, SPI (Security Parameter Index), encryption/hash algorithm. Identified by: (SPI, destination IP, protocol).

4.4 Site-to-Site IPsec VPN Configuration (Cisco IOS)

! Step 1: ISAKMP Policy (Phase 1)
crypto isakmp policy 10
  encr aes 256
  hash sha256
  authentication pre-share
  group 14
  lifetime 86400

crypto isakmp key MY_SECRET_KEY address 203.0.113.2

! Step 2: IPsec Transform Set (Phase 2)
crypto ipsec transform-set MY_SET esp-aes 256 esp-sha256-hmac
  mode tunnel

! Step 3: Crypto Map
crypto map MY_MAP 10 ipsec-isakmp
  set peer 203.0.113.2
  set transform-set MY_SET
  match address VPN_ACL

! Step 4: ACL to define interesting traffic
ip access-list extended VPN_ACL
  permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255

! Step 5: Apply to interface
interface Serial0/0
  crypto map MY_MAP

4.5 SSL/TLS VPN

Operates at Layer 4–7. Uses standard HTTPS (port 443) so it works through most firewalls without special configuration.

FeatureSSL VPNIPsec VPN
Layer4–7 (Application/Transport)3 (Network)
Port443 (HTTPS)UDP 500, 4500; ESP (IP 50)
NAT traversalExcellent (no issues)Requires NAT-T (UDP 4500)
Client requiredBrowser or thin clientVPN client software required
Use caseRemote workers, BYODSite-to-site, full-tunnel remote access

4.6 GRE (Generic Routing Encapsulation)

GRE encapsulates any Layer 3 protocol inside IP. It is NOT encrypted by itself β€” used with IPsec for GRE-over-IPsec tunnels.

! GRE Tunnel Configuration
interface Tunnel0
  ip address 10.0.0.1 255.255.255.252
  tunnel source Serial0/0
  tunnel destination 203.0.113.2

4.7 L2TP (Layer 2 Tunneling Protocol)

L2TP encapsulates PPP frames at Layer 2. Like GRE, it provides no encryption by itself β€” always combined with IPsec (L2TP/IPsec) for security.

4.8 VPN Protocol Comparison

ProtocolLayerEncrypts?AuthenticationPortCommon Use
IPsec3Yes (ESP)PSK, CertificatesUDP 500, 4500Site-to-site, enterprise
SSL/TLS VPN4–7YesCertificateTCP 443Remote access, BYOD
GRE3NoNoneIP Proto 47Tunnel for routing protocols
L2TP2NoPPP authUDP 1701Used with IPsec
OpenVPN3–4YesCertificateUDP/TCP 1194Open-source remote access

Practice Questions β€” Ch4

Q: What is the difference between AH and ESP in IPsec?
A: AH provides authentication and integrity only (no encryption). ESP provides confidentiality, integrity, and authentication. AH uses IP Protocol 51; ESP uses Protocol 50.
Q: What occurs in IKE Phase 1 vs Phase 2?
A: Phase 1 establishes the ISAKMP SA (management tunnel) using DH key exchange. Phase 2 (Quick Mode) establishes the IPsec SA that actually protects the VPN data.
Q: In tunnel mode, what is encapsulated?
A: The entire original IP packet (header + payload) is encapsulated inside a new IP packet.
Q: Why is GRE often used with IPsec?
A: GRE provides the tunnel structure and supports routing protocols, but has no encryption. IPsec adds encryption and authentication to secure the GRE tunnel.

Chapter 5: Access Control Lists (ACL)

5.1 ACL Overview

An ACL is an ordered list of permit/deny statements applied to a router interface to filter traffic based on packet attributes. Processed top-down; stops at first match.

Implicit Deny: Every ACL ends with an invisible deny any any β€” any traffic not explicitly permitted is denied.

5.2 ACL Types

TypeNumber RangeFilters onPlacement
Standard (numbered)1–99, 1300–1999Source IP onlyClose to destination
Extended (numbered)100–199, 2000–2699Src IP, Dst IP, Protocol, PortClose to source
NamedAny nameStandard or ExtendedSame rules as above
Why placement matters: Standard ACL only matches on source IP β€” place near destination so traffic from that source can still reach other destinations. Extended ACL can filter specifically β€” place near source to drop unwanted traffic early (save bandwidth).

5.3 Wildcard Masks

Wildcard masks are the inverse of subnet masks. Used in ACLs to define address ranges.

SubnetSubnet MaskWildcard MaskMatches
192.168.1.0/24255.255.255.00.0.0.255192.168.1.0–192.168.1.255
192.168.1.0/25255.255.255.1280.0.0.127192.168.1.0–192.168.1.127
10.0.0.0/8255.0.0.00.255.255.25510.x.x.x
Any hostβ€”255.255.255.255Keyword: any
Specific hostβ€”0.0.0.0Keyword: host x.x.x.x
Formula: Wildcard = 255.255.255.255 – Subnet Mask
Example: 255.255.255.255 – 255.255.255.0 = 0.0.0.255

5.4 Standard ACL Syntax

! Numbered Standard
access-list 10 permit 192.168.1.0 0.0.0.255
access-list 10 deny   host 10.0.0.5
access-list 10 permit any

! Named Standard
ip access-list standard BLOCK_HOST
  deny   host 192.168.2.100
  permit any

! Apply to interface
interface GigabitEthernet0/1
  ip access-group 10 in      ! Filter inbound traffic
  ip access-group 10 out     ! Filter outbound traffic

5.5 Extended ACL Syntax

! Syntax:
access-list [number] [permit|deny] [protocol] [src] [src-wildcard] [dst] [dst-wildcard] [operator] [port]

! Examples:
! Deny FTP from 192.168.1.0/24 to any
access-list 100 deny tcp 192.168.1.0 0.0.0.255 any eq 21

! Permit HTTP from any to DMZ web server
access-list 100 permit tcp any host 172.16.1.10 eq 80

! Permit HTTPS from any to DMZ web server
access-list 100 permit tcp any host 172.16.1.10 eq 443

! Permit ICMP (ping) from 10.0.0.0/8 to anywhere
access-list 100 permit icmp 10.0.0.0 0.255.255.255 any

! Implicit deny all (already there, but can be explicit)
access-list 100 deny ip any any log

! Named Extended
ip access-list extended SECURE_TRAFFIC
  permit tcp 192.168.1.0 0.0.0.255 host 10.0.0.1 eq 443
  permit icmp 192.168.1.0 0.0.0.255 any
  deny   ip any any log

5.6 Port Numbers to Know

PortProtocolService
20TCPFTP Data
21TCPFTP Control
22TCPSSH
23TCPTelnet
25TCPSMTP (email)
53TCP/UDPDNS
80TCPHTTP
110TCPPOP3
143TCPIMAP
443TCPHTTPS / SSL/TLS
500UDPIKE (IPsec)
3389TCPRDP

5.7 ACL Operators

OperatorMeaningExample
eqEqual to porteq 80 (HTTP)
neqNot equalneq 23
ltLess thanlt 1024 (well-known ports)
gtGreater thangt 1023 (ephemeral)
rangeRange of portsrange 20 21 (FTP)

5.8 Verification Commands

show access-lists                  ! Show all ACLs with hit counts
show ip access-lists               ! Show IP ACLs only
show running-config | include access  ! Find ACL in config
show ip interface GigabitEthernet0/1  ! Show which ACLs applied to interface

Practice Questions β€” Ch5

Q: A standard ACL should be placed close to the ______.
A: Destination (because standard ACLs only match on source IP β€” if placed near source, they could block traffic to other destinations)
Q: What wildcard mask would match the network 192.168.5.0/26?
A: 0.0.0.63 (255.255.255.255 βˆ’ 255.255.255.192 = 0.0.0.63)
Q: Write an extended ACL statement to deny Telnet (TCP/23) from any source to any destination.
A: access-list 100 deny tcp any any eq 23
Q: What happens to traffic that doesn't match any ACL entry?
A: It is dropped by the implicit deny any any at the end of every ACL.

Chapter 6: Cyber Attacks

6.1 DoS and DDoS

Denial of Service (DoS)

Attack from a single source that exhausts target resources (bandwidth, CPU, memory, connections), making services unavailable.

Distributed DoS (DDoS)

Coordinated attack from multiple compromised hosts (botnet). Much harder to block because traffic comes from many IPs.

DoS Attack Types

TypeMethodTarget
VolumetricFlood bandwidth with traffic (UDP flood, ICMP flood)Network bandwidth
ProtocolExploit protocol weaknesses (SYN Flood, ping of death, Smurf)Network equipment / servers
Application LayerFlood with legitimate-looking requests (HTTP GET flood, slowloris)Web server resources

6.2 SYN Flood Attack

Exploits the TCP 3-way handshake:

  1. Attacker sends many SYN packets with spoofed source IPs
  2. Server responds with SYN-ACK and holds a half-open connection in memory
  3. Attacker never sends the final ACK
  4. Server's connection table fills up β†’ legitimate connections refused
Countermeasures:

Lab Command (hping3)

# Basic SYN flood
hping3 --flood -S -p 80 192.168.1.1

# Full lab attack:
hping3 -c 15000 -d 120 -S -w 64 -p 80 --flood --rand-source 192.168.1.159
# -c 15000  = 15000 packets
# -d 120    = data size 120 bytes
# -S        = SYN flag
# -w 64     = window size 64
# -p 80     = target port 80
# --flood   = send as fast as possible
# --rand-source = randomize source IP (spoofing)

# Wireshark filter to detect:
tcp.flags.syn==1 and tcp.flags.ack==0

6.3 MITM (Man-in-the-Middle) Attack

Attacker secretly intercepts and possibly alters communications between two parties who believe they are communicating directly.

MITM Techniques

6.4 ARP Spoofing

ARP (Address Resolution Protocol) is stateless β€” hosts accept ARP replies even without sending requests.

  1. Attacker sends gratuitous ARP: "IP 192.168.1.1 is at [attacker's MAC]"
  2. Victim updates its ARP cache
  3. Victim's traffic to 192.168.1.1 goes to attacker
  4. Attacker can inspect/modify and forward

Defenses

6.5 Password Attacks

Attack TypeMethodDefense
Brute ForceTry every possible combinationAccount lockout, long passwords
Dictionary AttackTry words from a wordlist (e.g., rockyou.txt)Complex passwords not in dictionaries
Rainbow TablePrecomputed hash lookup tableSalting passwords (makes rainbow tables useless)
Credential StuffingUse leaked username/password pairs from breachesUnique passwords, MFA
Password SprayingTry one common password against many accountsBlock after X failures, MFA

rockyou.txt

6.6 Web Application Attacks

SQL Injection

Injecting malicious SQL code into user input fields to manipulate database queries.

Normal query:  SELECT * FROM users WHERE username='admin' AND password='pass'
Injected:      SELECT * FROM users WHERE username='admin' --' AND password=''
Result: '--' comments out the password check β†’ logs in as admin

Defense: Parameterized queries / prepared statements, input validation, WAF.

XSS (Cross-Site Scripting)

Injecting malicious JavaScript into web pages viewed by other users.

Impact: Cookie theft, session hijacking, redirecting users to malicious sites.

Defense: Input sanitization, Content Security Policy (CSP), HttpOnly cookies.

CSRF (Cross-Site Request Forgery)

Tricks authenticated user's browser into sending unauthorized requests to a trusted site.

Defense: CSRF tokens, SameSite cookies, re-authentication for sensitive actions.

6.7 Wireless Attacks

De-Authentication Attack

IEEE 802.11 management frames (including deauth) are unauthenticated by default. Attacker sends forged deauthentication frames to force client to disconnect.

# Step 1: Enable monitor mode
airmon-ng start wlan0
# Creates wlan0mon interface

# Step 2: Find target network
airodump-ng wlan0mon
# Shows BSSID (AP MAC), SSID, channel, clients

# Step 3: Deauthentication attack (send 100 deauth frames)
aireplay-ng -0 100 -a [AP_BSSID] -c [CLIENT_MAC] wlan0mon
# -0 = deauth attack
# 100 = number of frames (0 = continuous)
# -a = AP MAC address
# -c = client MAC address

# Detection in Wireshark:
# Filter: wlan.fc.type_subtype == 0x0c
# Deauth frames are subtype 12 (0x0c)

WPA Handshake Attack (Wifite)

Capture the WPA 4-way handshake, then crack the password offline using dictionary attack.

# Automated with Wifite:
wifite --wpa --dict /usr/share/wordlists/rockyou.txt --kill

# Manual process:
# 1. airmon-ng start wlan0
# 2. airodump-ng --bssid [AP_MAC] -c [channel] -w capture wlan0mon
# 3. aireplay-ng -0 5 -a [AP_MAC] wlan0mon  (force reconnect to capture handshake)
# 4. aircrack-ng capture-01.cap -w rockyou.txt  (offline crack)

Key Terms

TermDefinition
SSIDService Set Identifier β€” human-readable network name
BSSIDBasic SSID β€” MAC address of the AP
ESSIDExtended SSID β€” used when multiple APs share the same SSID
WPA Handshake4-way handshake between client and AP that proves both know the PSK; captured for offline cracking

6.8 Cyber Kill Chain (Lockheed Martin)

PhaseNameDescriptionExample
1ReconnaissanceResearch the targetNmap scanning, OSINT
2WeaponizationCreate malware payloadEmbed exploit in Word document
3DeliveryTransmit weapon to targetPhishing email, USB drop
4ExploitationExploit vulnerability on targetExecute malicious macro
5InstallationInstall malware/backdoorDrop RAT, create scheduled task
6C2 (Command & Control)Establish communication channelBeacon to C2 server
7Actions on ObjectivesAccomplish goalData exfiltration, ransomware deployment

Practice Questions β€” Ch6

Q: What makes a DDoS harder to defend against than a DoS?
A: DDoS uses a botnet (many source IPs), making it impossible to simply block a single source IP.
Q: Why does a SYN flood use spoofed source IPs?
A: To prevent the real ACK from completing the handshake (keeping connections half-open) and to prevent the server's SYN-ACK from reaching the attacker, avoiding detection.
Q: What Wireshark filter detects de-authentication frames?
A: wlan.fc.type_subtype == 0x0c
Q: What is the 6th phase of the Cyber Kill Chain?
A: Command and Control (C2) β€” establish communication channel back to attacker.

πŸ§ͺ Lab Reference

Lab 3.1 β€” rockyou.txt Wordlist

DetailValue
Source2009 RockYou.com data breach
Size14,341,564 unique passwords
Path in Kali/usr/share/wordlists/rockyou.txt.gz
Decompressgzip -d /usr/share/wordlists/rockyou.txt.gz
# Use with aircrack-ng
aircrack-ng handshake.cap -w /usr/share/wordlists/rockyou.txt

# Use with hashcat (WPA)
hashcat -m 2500 handshake.hccapx /usr/share/wordlists/rockyou.txt

# Use with John the Ripper
john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt

Lab 4.2 β€” Nmap Scanning

CommandFlagDescription
Ping scan-snHost discovery only (no port scan). Also called "ping scan".
SYN scan (stealth)-sSHalf-open scan. Sends SYN, receives SYN-ACK, sends RST (doesn't complete handshake). Requires root.
Connect scan-sTFull TCP connect. Doesn't require root but more detectable.
UDP scan-sUScan UDP ports (slower)
Version detection-sVDetect service version running on open ports
OS detection-ODetect target OS (requires root)
Aggressive-AEnables OS detection + version + scripts + traceroute
Output to file-oN fileSave output in normal format. (-oX = XML, -oA = all formats)
Scan all ports-p-Scan all 65535 ports
Fast scan-FScan only top 100 common ports
Timing-T0 to -T5T0=paranoid (slow, stealthy), T3=default, T5=insane (fast, detectable)
# Common examples:
nmap -sn 192.168.1.0/24            # Discover live hosts
nmap -sS -p 1-1000 192.168.1.1     # Stealth scan ports 1-1000
nmap -A 192.168.1.1                # Aggressive scan
nmap -sV -p 22,80,443 10.0.0.1    # Version detect on specific ports
nmap -oN output.txt 192.168.1.0/24 # Save results
Zenmap = Official GUI for Nmap. Provides topology view and profile-based scanning.

Lab 5.3 β€” TCP SYN Flood with hping3

# hping3 SYN flood β€” basic
hping3 --flood -S -p 445 192.168.1.1
# --flood: no delay between packets
# -S: set SYN flag
# -p 445: target port 445 (SMB)

# Full lab attack:
hping3 -c 15000 -d 120 -S -w 64 -p 80 --flood --rand-source 192.168.1.159
# -c 15000:     send 15000 packets
# -d 120:       data payload 120 bytes
# -S:           SYN flag
# -w 64:        TCP window size 64
# -p 80:        target port 80 (HTTP)
# --flood:      saturate link, no delays
# --rand-source: randomize source IP (simulate DDoS, evade IP-based blocks)
# 192.168.1.159: target IP

# Wireshark filter to detect SYN flood:
tcp.flags.syn==1 and tcp.flags.ack==0
# This shows only SYN packets without ACK (half-open connections)
hping3 FlagMeaning
-SSet SYN flag
-ASet ACK flag
-FSet FIN flag
-RSet RST flag
-PSet PUSH flag
-cPacket count
-dData size (bytes)
-pDestination port
--floodMax speed, no stats
--rand-sourceRandom source IP

Lab 6.1 β€” De-Authentication Attack

# Aircrack-ng suite commands:

# Step 1: Check wireless interfaces
iwconfig

# Step 2: Kill conflicting processes
airmon-ng check kill

# Step 3: Enable monitor mode
airmon-ng start wlan0
# Creates: wlan0mon

# Step 4: Scan for networks
airodump-ng wlan0mon
# Shows: BSSID, PWR, CH, ESSID, connected clients

# Step 5: Focus on target network
airodump-ng --bssid AA:BB:CC:DD:EE:FF -c 6 wlan0mon

# Step 6: Send deauth frames
aireplay-ng -0 100 -a AA:BB:CC:DD:EE:FF -c 11:22:33:44:55:66 wlan0mon
# -0 100: deauth attack, 100 frames
# -a: Access Point (AP) MAC = BSSID
# -c: Client MAC address
# Use -0 0 for continuous attack

# Detection:
# Wireshark filter: wlan.fc.type_subtype == 0x0c
# Deauth frame = management frame (type 0), subtype 12 (0x0c = 12 decimal)
TermDefinition
BSSIDMAC address of the Access Point
SSIDHuman-readable network name ("MyWiFi")
ESSIDExtended SSID (same SSID across multiple APs in a network)
Monitor modeWireless card mode that captures all frames (not just those addressed to it)
Managed modeNormal client mode β€” only processes frames addressed to its MAC

Lab 6.3 β€” WPA Handshake Attack (Wifite)

# Automated attack
wifite --wpa --dict /usr/share/wordlists/rockyou.txt --kill

# What Wifite does automatically:
# 1. Enables monitor mode (airmon-ng)
# 2. Scans for WPA networks (airodump-ng)
# 3. Sends deauth to capture handshake (aireplay-ng)
# 4. Captures WPA 4-way handshake
# 5. Cracks offline with aircrack-ng using provided wordlist

# Manual equivalent:
airmon-ng start wlan0
airodump-ng --bssid [AP] -c [CH] -w capture wlan0mon
aireplay-ng -0 5 -a [AP] wlan0mon
aircrack-ng capture-01.cap -w /usr/share/wordlists/rockyou.txt
The WPA 4-way handshake does NOT transmit the password. It transmits a cryptographic proof (MIC) that both sides know the PSK. Cracking works by testing dictionary words to find which produces the matching MIC.

Shell Commands Reference

# Network information
ifconfig / ip addr         # Show IP addresses
iwconfig                   # Wireless interface info
netstat -an                # Active connections
route                      # Routing table

# File operations
ls -la                     # List files with permissions
cat /etc/passwd            # Read file
grep -r "pattern" /dir     # Search recursively
find / -name "file.txt"    # Find file

# Process management
ps aux                     # List processes
kill -9 [PID]              # Force kill process
service [name] start/stop  # Manage services

# Network tools
ping [host]                # ICMP test
traceroute [host]          # Trace route
nslookup [domain]          # DNS lookup
nc -lvp 4444              # Netcat listener

πŸƒ Flashcards Loading...

Click any card to flip it. Filter by topic below.

πŸ“ Practice Quiz

Select answers and submit to see your score. Explanations shown after submission.