Back to skill

Security audit

Apktool

Security checks for vulnerabilities and agentic risk

Overview

This APK reverse-engineering skill is mostly coherent, but its install instructions include unverified downloads into system-wide executable paths.

Review the install steps before enabling this skill. Prefer package-manager installs, avoid running whole network-download scripts as root, verify release checksums or signatures where available, and consider user-local installs instead of writing to /opt or /usr/local/bin. The skill appears useful for legitimate APK analysis, but its manual installation paths deserve careful review.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Warning
Location
SKILL.md:31
Finding

Unverified JADX Archive Installed into System-Wide Executable Paths

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/install.md:63
Finding

Manual Apktool Installation Trusts Unverified Executable Artifacts

Content
View full analysis
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Warning
Location
references/install.md:99
Finding

Automated Apktool Installer Executes an Unverified Installation Workflow with Root Privileges

Content
View full analysis
/dev/null; then echo "❌ Java 未安装,请先安装 Java" exit 1 fi # 创建目录 sudo mkdir -p ${INSTALL_DIR} cd ${INSTALL_DIR} # 下载文件 echo "📥 下载 Apktool..." sudo wget -q --show-progress -O apktool.jar \ https://github.com/iBotPeaches/Apktool/releases/download/v${APKTOOL_VERSION}/apktool_${APKTOOL_VERSION}.jar sudo wget -q --show-progress -O apktool \ https://github.com/iBotPeaches/Apktool/releases/download/v${APKTOOL_VERSION}/apktool_${APKTOOL_VERSION} # 设置权限 sudo chmod +x apktool # 创建链接 sudo ln -sf ${INSTALL_DIR}/apktool /usr/local/bin/apktool echo "✅ Apktool 安装完成!" apktool --version ``` The guide then instructs users to execute the installer as follows: ```bash chmod +x install-apktool.sh sudo ./install-apktool.sh ``` ### Technical Analysis The installer retrieves executable components without checksum or signature verification and is explicitly launched using `sudo`. Once run this way, the whole script—including external command resolution, downloads, directory changes, file writes, and the final version check—operates in a root execution context. The script also redundantly invokes `sudo` internally. Running an entire network-enabled installation script as root exceeds the privilege required for downloading and verifying artifacts. Only the final installation into protected system directories needs elevation. `set -e` provides limited failure handling but does not enable undefined-variable detection or pipeline failure handling. Variables such as `${INSTALL_DIR}` are not quoted, although their current values are hardcoded and therefore do not pr ...[truncated 1342 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (41)

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/troubleshooting.md (reported line 109)May include surrounding context.

❌ 问题:权限不足

症状:

bash
$ apktool d app.apk
Error: Unable to create directory

原因: 输出目录权限不足

解决方案:

bash
# 1. 使用有权限的目录
apktool d app.apk -o ~/tmp/app_decompiled

# 2. 或修改目录权限
sudo chown -R $USER:$USER /opt/apktool

# 3. 或在用户目录安装
mkdir -p ~/bin/apktool
cp apktool.jar ~/bin/apktool/
echo 'alias apktool="java -jar ~/bin/apktool/apktool.jar"' >> ~/.bashrc
source ~/.bashrc

反编译问题

❌ 问题:反编译失败 "Unknown version"

症状:

bash
$ apktool d app.apk
I: Using Apktool 3.0.1 on app.apk
W: Unknown version. Code might not work properly.
Exception in thread "main" brut.androlib.AndrolibException

原因: APK 使用了较新版本的资源表格式

解决方案:

bash
# 1. 更新 Apktool 到最新版本
# 参考 install.md 更新

# 2. 尝试不使用资源解码
apktool d app.apk -r -o app_output

# 3. 安装框架文件

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

The raw rm -rf cleanup command is destructive and presented without a warning, confirmation guidance, or a safer alternative. Even though the target is a build directory, users may adapt the command incorrectly or run it from the wrong context, causing unintended data loss.

Content

Scanner excerpt · references/troubleshooting.md (reported line 239)May include surrounding context.

md
# 从备份恢复未修改的资源

# 4. 清理后重新编译
rm -rf app_folder/build
apktool b app_folder -o app.apk

# 5. 检查 AndroidManifest.xml 格式

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

Deleting all APK files from the local Apktool framework directory is a destructive action that can remove cached framework state and any manually installed files. In context this is troubleshooting, but without backup or validation guidance it can still cause avoidable data loss or user confusion.

Content

Scanner excerpt · references/troubleshooting.md (reported line 340)May include surrounding context.

md
apktool empty-framework-dir -f

# 3. 或手动删除
rm ~/.local/share/apktool/framework/*.apk

# 4. 重新安装
apktool if framework-res.apk

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file’s user-facing description and instructions are written entirely in Chinese, including the title, labels, and usage guidance. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless the skill offers a language choice or clearly documents a region-specific justification, which this file does not.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 27)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 28)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 40)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 64)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 76)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 83)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 136)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 184)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 205)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 234)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 246)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 249)May include surrounding context.

bash
# 安装 Java(如未安装)
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 31)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 112)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 123)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/install.md (reported line 126)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/troubleshooting.md (reported line 37)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/troubleshooting.md (reported line 70)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/troubleshooting.md (reported line 72)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/troubleshooting.md (reported line 75)May include surrounding context.

md
sudo apt-get install -y openjdk-11-jdk

# 安装 Apktool
sudo apt-get install -y apktool

# 验证安装
apktool --version

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/install.md (reported line 64)May include surrounding context.

bash
# 创建安装目录
sudo mkdir -p /opt/apktool
cd /opt/apktool

# 下载最新版本的 wrapper 脚本和 jar 文件

Static analysis

No suspicious patterns detected.