Back to skill

Security audit

Poly-Mal-Scan_恶意代码扫描器

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real malware-scanning skill, but its MCP scanner can read any file path the service account can access without a clear workspace boundary.

Install only if you are comfortable running it as a local code scanner. If using the MCP server, run it under a low-privilege account, expose it only to trusted clients, restrict scans to an intended workspace, and pin dependency versions before deployment.

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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
detect_mcp_server.py:201
Finding

Unrestricted Local File Scanning and Recursive Path Escape

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:166
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
=0.26" "tree_sitter_language_pack>=1.15" ``` ### Technical Analysis The documented installation command specifies only minimum versions. It permits installation of any future release from the configured Python package index and does not use a lock file, exact versions, package hashes, or an explicitly trusted index. Python packages can execute code during installation and are imported by the scanners at runtime. Consequently, a compromised future release, compromised package-index account, or unexpectedly incompatible update could affect the environment running the Skill. The reviewed package names do not show evidence of typosquatting, and the project does not itself retrieve or execute a remote payload. The risk arises from open-ended supply-chain trust rather than from confirmed malicious dependency behavior. ### Attack Path 1. A user follows the dependency installation instructions. 2. `pip` resolves the newest releases satisfying the minimum-version constraints. 3. A future release is compromised, malicious, or incompatible, or resolution occurs through an untrusted package mirror. 4. Installation or subsequent import executes dependency-controlled code under the privileges of the user running the scanner. 5. That code can access files, environment variables, network resources, and other capabilities available to that account. ### Impact Assessment A compromised dependency could execute arbitrary code with the privileges of the installation or scanner process. The potential scope includes source files submitted for scanning, files readable by the service account, environment variables, and MCP process integrity. The likelihood is lower than for a directly exploitable code defect because exploitation depend ...[truncated 79 chars]
Remediation
View remediation
tree_sitter_language_pack== ``` 2. Maintain a lock file generated from a reviewed dependency set. 3. Require cryptographic hashes, for example through `pip install --require-hashes -r requirements.txt`. 4. Use an explicitly configured trusted package index or an internally controlled package mirror. 5. Verify downloaded artifacts and retain a software bill of materials. 6. Review and test dependency upgrades before updating pins. 7. Install dependencies in an isolated virtual environment and run the scanner as a dedicated low-privilege account. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (137)

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

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

md
MULTI_ENC_TRAITS`(词条推导 ∪ RAW、去重、按 `MIN_TRAIT_LEN=4` 过滤短码防二进制误报)与各结构化规则列表/索引。

### 提取规约(三种语言通用)
- 只收**"看到即可判死"的高确定性指纹**(典型/高危优先);剔易碰撞短串(<4 字节、纯常见英文词)。
- `plain` 明文只收**完整恶意片段**(如 `eval($_POST['p1']`、`nc -e /bin/bash`、`>> ~/.ssh/authorized_keys`),不收 `eval`/`curl`/`system` 这类被 threat_func 覆盖且易误报的裸词。
- 编码特征码写"该编码最终形态"(base64 去 `=`;url/hex/octal/chr/rot13/html)。
- 类别键与对应 `MULTI_ENC_TRAITS` / 规则结构类别一致(别自造拼不上的键)。

### 🔁 持续更新:新规则从哪来
> 使用中**要随时更新规则库**。新来源除各 `特征码来源.md` 已登记的**也可自己找**。加完在对应 `特征码来源.md` 补记"来源/许可/如何提取/已采用对照",保持可追溯。

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · bash_security/bash_categories.json (reported line 25)May include surrounding context.

json
{
  "恶意函数": [
    "eval",
    "exec",
    "source",
    ".",
    "trap",
    "enable",
    "builtin",
    "command",
    "alias",
    "declare -f",
    "typeset -f"
  ],
  "恶意命令": [
    "chmod u+s",
    "chmod 4755",
    "useradd -u 0",
    "usermod -aG sudo",
    "iptables -F",
    "rm -rf /",
    "dd if=/dev/urandom of=/dev/sda",
    "mkfs",
    "systemctl stop firewalld",
    "nc -e /bin/bash",
    "base64 -d | bash",
    "curl | bash",
    "wget | sh",
    "kill -9",
    "nmap",
    "arpspoof",
    "sshpass",
    "StrictHostKeyChecking=no"
  ],
  "恶意变量": [
    "LD_PRELOAD",
    "LD_LIBRARY_PATH",
    "LD_AUDIT",
    "BASH_ENV",
    "ENV=",
    "IFS=",
    "PATH=",
    "HISTFILE=/dev/null",
    "PROMPT_COMMAND"
  ],
  "恶意文件写入": [
    "authorized_keys",
    ".bashrc",
    "/etc/crontab",
    "/etc/cron.",
    "/etc/ld.so.preload",
    "/etc/passwd",
    "/etc/shadow",
    "ssh_config",
    "systemd/system",
    "/etc/profile.d",
    "rc.local"
  ]

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · bash_security/bash_raw_traits.json (reported line 31)May include surrounding context.

json
"trap \"",
      "enable -f",
      "command -v ",
      "alias "
    ],
    "base64": [
      "ZXZhbCg",
      "ZXZhbCA"
    ]
  },
  "恶意命令": {
    "plain": [
      "chmod u+s",
      "chmod 4755",
      "useradd -u 0",
      "usermod -aG sudo",
      "iptables -F",
      "rm -rf /",
      "dd if=/dev/urandom of=/dev/sda",
      "mkfs.ext4 /dev/",
      "systemctl stop firewalld",
      "nc -e /bin/bash",
      "base64 -d | bash",
      "curl | bash",
      "wget | sh",
      "kill -9 ",
      "nmap -sn",
      "arpspoof -i",
      "sshpass -p",
      "StrictHostKeyChecking=no",
      ":(){ :|:& };:",
      ":|:&"
    ],
    "base64": [
      "Y2htb2QgdStz",
      "dXNlcmFkZCAtdSAw",
      "aXB0YWJsZXMgLUY",
      "cm0gLXJmIC8"
    ]
  },
  "恶意变量": {
    "plain": [
      "LD_PRELOAD=",
      "export LD_PRELOAD",
      "export LD_LIBRARY_PATH=/tmp",
      "BASH_ENV=",
      "export BASH_ENV",
      "export PATH=/tmp",
      "IFS='",
      "HISTFILE=/dev/null",
      "PR

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 17)May include surrounding context.

md
��,
  剔除易与正常代码碰撞的短串(长度 < 4 字节、纯常见英文词等)。
- 编码形式写入 `bash_raw_traits.json` 时必须是"该编码下的最终形态"
  (base64 去 `=` 填充 / url / hex / octal / chr / rot13 / html 等)。
- **plain 明文指纹**:直接以明文子串参与匹配,命中即判死。
  只收完整的高确定性调用/注入片段(如 `nc -e /bin/bash`、`>> ~/.ssh/authorized_keys`),
  不收 `eval`、`curl` 这类被 threat_func / 正常运维覆盖且易误报的纯词条。
- 类别键必须与 `bash_detect_rules.py` 的 `MULTI_ENC_TRAITS` 类别一致:
  `恶意函数执行` / `恶意命令` / `恶意变量` / `恶意文件写入` / `自我复制` /
  `反弹Shell` / `代码解密/混淆还原` / `网络外带/SSRF` / `权限维持/常驻`。

---

## 来源 1:MITRE ATT&CK(攻击行为分类与级别/参考来源)【已采用】

- **地址**:https://attack.mitre.org/techniques/enterprise/
- **许可**:�

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

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

md
`\\b(?:eval|system|...)\\s*\\(` —— 认"函数名+左括号"
  2. 超全局:        `\\$_()(...)\\[\\s*['\"]?\\w+['\"]?\\]`
  3. 溯源:          取参数里的 $var → 在 lines_upto 里找 `$var = ...;` → 查赋值串含超全局 → 级别+1
  4. 特征码:        MULTI_ENC_TRAITS 子串匹配(plain/base64/url/hex/octal/chr/rot13/html)

正则组件的三大盲点(已实测确认):
  A. eval($_POST['c']) 直接作参数 → find_php_variables 匹配不到 $var(已是超全局) → 溯源空 → 危险级别不+1
  B. $x="sys";$y="tem";eval($x.$y) → 命中 eval 但看不出拼接成危险函数双段
  C. $f="system";$f($a)            → 动态函数名 $f(...) 正则 \\b(...) 匹配不到 → 完全漏报

AST 归一化目标:
  经 tree-sitter 解析生成一份"等效但暴露更多行为特点"的 PHP 文本:
  1. 常量折叠     : $x="sys" 解析为字面量
  2. 变量解析     : 全文件赋值表替换参数里的 $var(递归到叶子)
  3. 动态函数名   : $f=

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · php_security/php_ast_normalize.py (reported line 13)May include surrounding context.

python
`\\b(?:eval|system|...)\\s*\\(` —— 认"函数名+左括号"
  2. 超全局:        `\\$_()(...)\\[\\s*['\"]?\\w+['\"]?\\]`
  3. 溯源:          取参数里的 $var → 在 lines_upto 里找 `$var = ...;` → 查赋值串含超全局 → 级别+1
  4. 特征码:        MULTI_ENC_TRAITS 子串匹配(plain/base64/url/hex/octal/chr/rot13/html)

正则组件的三大盲点(已实测确认):
  A. eval($_POST['c']) 直接作参数 → find_php_variables 匹配不到 $var(已是超全局) → 溯源空 → 危险级别不+1
  B. $x="sys";$y="tem";eval($x.$y) → 命中 eval 但看不出拼接成危险函数双段
  C. $f="system";$f($a)            → 动态函数名 $f(...) 正则 \\b(...) 匹配不到 → 完全漏报

AST 归一化目标:
  经 tree-sitter 解析生成一份"等效但暴露更多行为特点"的 PHP 文本:
  1. 常量折叠     : $x="sys" 解析为字面量
  2. 变量解析     : 全文件赋值表替换参数里的 $var(递归到叶子)
  3. 动态函数名   : $f=

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

Critical
Category
YARA Match
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · php_security/php_ast_normalize.py (reported line 23)May include surrounding context.

python
��但暴露更多行为特点"的 PHP 文本:
  1. 常量折叠     : $x="sys" 解析为字面量
  2. 变量解析     : 全文件赋值表替换参数里的 $var(递归到叶子)
  3. 动态函数名   : $f="system";$f(...) → system(...)
  4. 拼接折叠     : eval($x.$y) 若 $x="s" $y="ystem" → eval(system) 并在旁标注
  5. 污点链摊平   : $a=$_POST; $d=str_rot13($a); eval($d) → eval(str_rot13($_POST...)) 供溯源+1

输出: 归一化文本(供 phpdect.py 扫描/或后续 AST 特征识别)。

本文件职责(2026-09-01 重构):
  作为 纯翻译函数库 供 phpdect.py import 调用:
    - normalize(file_path) / normalize_source(src_bytes) → 返回归一化等效 PHP 文本;
    - 只做 AST 解析 + 归一化翻译(常量折叠/变量解析/动态函数名/拼接折叠/污点摊平/编码还原),
      不包含任何"是否判定为恶意/威胁级别"的研判逻辑;
    - 最终安全研判由调用方 phpdect.py 负责(威胁函数/特征码/逻辑规则)。

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · php_security/raw_traits.json (reported line 4)May include surrounding context.

json
{
  "恶意函数执行": {
    "plain": [
      "eval($_POST['p1']",
      "system($_POST['command']",
      "shell_exec($_POST['command']",
      "exec($_POST['command']",
      "passthru($_POST['command']",
      "popen($_POST['command']",
      "assert($_POST[c",
      "shell_exec($_POST[baba]",
      "shell_exec($_POST[liz0]",
      "passthru($_POST['cmd']",
      "include($_POST['p2']",
      "@include($_POST['test2_file']",
      "@unserialize($_COOKIE['f']",
      "unserialize($_COOKIE[\"$sess_cookie\"]"
    ],
    "base64": [
      "ZXZhbCgkX1BPU1RbJ2MnXSk7"
    ]
  },
  "网络外带/SSRF": {
    "base64": [
      "ZXZpbC5jb20="

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

Critical
Category
YARA Match
Confidence
85% confidence
Finding

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

Content

Scanner excerpt · php_security/特征码来源.md (reported line 17)May include surrounding context.

md
�先),
  剔除易与正常代码碰撞的短串(长度 < 4 字节、纯常见英文词等)。
- 编码形式写入 `raw_traits.json` 时必须是"该编码下的最终形态"
  (base64 去 `=` 填充 / url / hex / octal / chr / rot13 / html 等)。
- **plain 明文指纹**:直接以明文子串参与匹配,命中即判死。
  只收完整的高确定性调用/注入片段(如 `eval($_POST['p1']`、`system($_POST['command']`),
  不收 `eval`、`system` 这类被 threat_func 覆盖且易误报的纯函数名词条。
- 类别键必须与 `detect_rules.py` 的 `MULTI_ENC_TRAITS` 类别一致:
  `恶意函数执行` / `网络外带/SSRF` / `自我复制` / `代码解密/混淆还原` / `敏感输入源` / `权限维持/常驻`。

---

## 来源 1:tennc/webshell(PHP 真实 webshell 样本库)【已采用】

- **地址**:https://github.com/tennc/webshell
- **分支**:master
- **许可**:MIT(自由、开源、免费)
- **规模**:约 10.7k stars�

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a Bash/PHP/JS malicious-code scanning detector with operational features like MCP integration and rule maintenance. The supplied code instead serves as an AST inspection/debugging tool for Bash only. It reads a file, builds a tree-sitter parse tree, and prints traversal output for parser validation and structural observation. The module docstring even states that it is only a first step and does not yet perform any malicious judgment. This is a material description-behavior mismatch because the primary purpose is parser/AST visualization rather than security scanning or detection.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code only determines whether a file can be parsed as php, javascript, html, css, sql, json, or vue, and marks very short unparsable content as no_code. It does not inspect for malicious patterns, webshell behavior, signatures, or detection rules, nor does it expose MCP-related functionality. This is a materially different primary purpose from the declared multilingual malicious code/webshell scanner, so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a security scanning/detection skill for malicious code and webshells across multiple languages, with MCP integration and rule-management capabilities. The supplied code chunk is much narrower: it reads a JS file, uses tree-sitter to parse it into an AST, and prints node types/positions/text for inspection. The docstring even states this is an initial JS-side AST-building step and '暂不做任何恶意判定' (does not yet make any malicious judgment). While AST construction could be a supporting component of a future scanner, this chunk by itself does not implement the declared detector behavior, making the description materially inaccurate for the provided code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is a malware/webshell scanner and detector for multiple languages with MCP integration and evolving rules. The supplied code instead implements a standalone PHP AST inspection script: it reads one PHP file, parses it using tree-sitter, and prints node types/positions/text for debugging and parser exploration. The file docstring explicitly states it is only the first step toward later analysis and '暂不做任何恶意判定' (does not perform any malicious judgment yet). This is a materially different primary purpose from active scanning/detection, so the description does not accurately represent the actual code behavior.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **Bash**:`bash_threatening_funcs.json`/`bash_categories.json`/`bash_raw_traits.json`,另按类别拆 `bash_malicious_commands.json`、`bash_malicious_variables.json`、`bas

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/bash_ast_normalize.py (reported line 13)May include surrounding context.

python
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/bash_raw_traits.json (reported line 71)May include surrounding context.

json
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 17)May include surrounding context.

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 50)May include surrounding context.

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 89)May include surrounding context.

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 126)May include surrounding context.

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bash_security/特征码来源.md (reported line 183)May include surrounding context.

md
3. 拼接/变量折叠: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):

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 · bash_security/bash_ast_normalize.py (reported line 13)May include surrounding context.

python
�: user@$ip / /tmp:$PATH                        —— 真实字符串被打散在变量与字面量之间
  4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):
  1. 常量折叠     : x="sy"; y="stem" 解析为字面量
  2. 变量解析     : 全文件赋值表替换参数/命令名里的 $var(递归到叶子)
  3. 动态命令名   : cmd="system"; $cmd /etc/shadow → system /etc/shadow
  4. 拼接折叠     : /tmp:$PATH 若 PATH=/usr/bin → /tmp:/usr/bin; "a$b" → "ab"
  5. 命令替换摊平 : echo $(whoami) → echo $(whoami) 并把内层命�

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · bash_security/bash_ast_normalize.py (reported line 14)May include surrounding context.

python
4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):
  1. 常量折叠     : x="sy"; y="stem" 解析为字面量

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · bash_security/bash_categories.json (reported line 21)May include surrounding context.

json
4. 管道解码执行:  base64 -d x | bash / printf '\\x..'          —— 解码后直接执行,绕过字符串匹配
  5. PATH 劫持:     export PATH=/tmp:$PATH                       —— 让恶意程序优先于系统命令被执行
  6. 权限/后门:     chmod u+s / useradd -u 0 / echo key >> ~/.ssh/authorized_keys
  7. 持久化/破坏:   crontab / systemctl / rm -rf / iptables -F

与 PHP/JS 版相同的归一化目标(把源码翻译成"正则组件好认"的等效 Bash 文本):
  1. 常量折叠     : x="sy"; y="stem" 解析为字面量

Static analysis

Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution, suspicious.env_credential_access (+1 more)

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
js_security/js_logic_engine.py:128

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
js_security/js_ast_normalize.py:18

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
js_security/js_common.py:76

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
js_security/js_detect_rules.py:68

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
js_security/js_logic_engine.py:127

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
php_security/detect_rules.py:65

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
php_security/logic_engine.py:81

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
php_security/php_ast_normalize.py:13

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
js_security/js_threat_func_dect.py:6

Potential obfuscated payload detected.

Warn
Code
suspicious.obfuscated_code
Location
php_security/detect_rules.py:43