Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
browser-xpi-malware-scanner — A comprehensive browser extension (.xpi) malware scanner which checks for many common malware tricks like:, credential-stealers obfuscation tactics, steganography, base64 payloads, zip-tricks, remote-code execution, polyglot tricks, meta data tricks in an attempt to give the analysist information about where deeper analysis is needed. | Kitploit
工具/GitHubGitHub/ernos/browser-xpi-malware-scanner
Static AnalysisVulnerability AnalysisCode AnalysisForensicsSteganographyMalware AnalysisPapers & ResearchLearning & Education

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →

关于

A comprehensive browser extension (.xpi) malware scanner which checks for many common malware tricks like:, credential-stealers obfuscation tactics, steganography, base64 payloads, zip-tricks, remote-code execution, polyglot tricks, meta data tricks in an attempt to give the analysist information about where deeper analysis is needed.

GitHub
ernos/browser-xpi-malware-scanner

browser-xpi-malware-scanner

查看仓库
84个月前尚未审核
分享

XPI Analyzer — Firefox扩展安全扫描器

一款命令行工具,用于分析Firefox扩展文件(.xpi),检测恶意软件、混淆、隐藏载荷、隐写术以及其他用于绕过扩展审查团队的恶意代码技术。

功能概述

extension-scanner.py 会解压Firefox扩展,并对其内部每个文件执行一系列安全检查,最终生成一份按严重性分级、带有颜色编码的报告。

如何使用本扫描器在Firefox/Mozilla扩展商店中实时发现恶意软件并进行深入分析 – 指南/教程

  • 恶意软件分析:使用browser-xpi-malware-scanner.py在野捕获恶意软件
  • 盗取点击的广告拦截器:深入“Supreme Adblocker for Youtube”
  • 我如何构建了一个浏览器扩展恶意软件扫描器——并用它揭露了一个恶意的“YouTube下载器”

执行的检查项

类别检查内容
权限危险或过于宽泛的权限(nativeMessaging、<all_urls>、debugger、desktopCapture等)
内容安全策略unsafe-inline、unsafe-eval、CSP中的远程脚本源
JavaScript混淆eval()、atob()、Function()构造函数滥用、十六进制转义序列、split/join/reverse重组、编码字符串字面量、带字符串参数的setTimeout
可疑URL硬编码的外部域名,分类为已知恶意(命中黑名单 → HIGH)、未知(未在白名单中 → MEDIUM)、已知安全(白名单中 → 抑制)。运行--update-blocklist可从URLhaus和Peter Lowe的列表刷新域名黑名单。
凭据与密钥硬编码的API密钥、令牌(AWS、GitHub、Slack、Google)、密码、私钥和IP地址
Base64载荷解码嵌入的base64数据块,并扫描其中是否包含可执行文件、脚本和网络代码
PNG隐写检测PNG IEND后追加的数据,并自动解码尾部(base64、zlib、gzip及其组合);解码后的载荷会递归扫描JavaScript混淆、凭据和可疑URL。同时检测未知数据块类型、LSB通道异常以及异常高的像素熵
文件元数据魔数检测可执行文件(.exe、.elf、.dylib)、双扩展名(如photo.png.js)、可疑文件名(keylog、miner、wallet)
多格式文件同时有效于两种格式的文件(如HTML + ZIP)
ZIP技巧路径遍历条目、文件名中的空字节、可能欺骗解析器的重复条目、携带载荷的ZIP注释
远程代码从远程URL加载的后台页面或Service Worker
高熵熵值异常高的文件或字符串字面量(很可能是加密或压缩的载荷)
API滥用浏览器扩展API调用,指示数据窃取或外泄:cookies.getAll({})、tabs.query({})、history.search、键盘监听器、剪贴板读取、scripting.executeScript带动态函数。当数据收集调用与出站网络发送在同一文件中成对出现时,升级为CRITICAL。
隐藏元素动态创建的不可见iframe(display:none、零尺寸)注入到DOM中——静默的联盟营销ping或C2通道。通过new Image().src指向外部URL的追踪像素。

严重性级别

  • CRITICAL — 几乎肯定为恶意;需立即调查
  • HIGH — 高度可疑;需仔细审查
  • MEDIUM — 存在潜在风险;需结合上下文审查
  • LOW — 轻微问题;仅供参考
  • INFO — 元数据(哈希、文件大小等)

安装

前置依赖包

  • Python 3.10+ 是必需的。python3.11、python3.12或python3.13
  • **python3-venv** — 如果使用虚拟环境,则为必需

使用虚拟环境:

root@kitploit:~
sudo apt install python3 python3-venv
git clone https://github.com/ernos/extension-scanner.git
cd extension-scanner

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

可选包

  • **python3-numpy** — 推荐用于隐写分析,系统级安装(否则使用pip install -r requirements.txt)
  • pillow:推荐用于隐写分析
  • numpy:推荐用于隐写分析
    ```bash
    pip install pillow numpy
    #Ubuntu系统级安装:
    sudo apt install python3-pillow python3-numpy
root@kitploit:~
git clone https://github.com/ernos/extension-scanner.git
cd extension-scanner
chmod +x extension-scanner.py
mkdir -p ~/.local/share/bin
ln -s $PWD/extension-scanner.py ~/.local/share/bin/extension-scanner


# 用于LSB隐写分析(可选但推荐)
pip install pillow numpy

# 选项1. 仅当前用户:
# 启用bash补全,简化使用(TAB自动补全命令)
mkdir -p ~/.local/share/bash-completion/completions
cp extension-scanner-completions ~/.local/share/bash-completion/completions
echo "source ~/.local/share/bash-completion/completions/extension-scanner-completions" >> ~/.bashrc

# 选项2. 为所有用户全局启用补全(应从.bashrc自动加载)
cp extension-scanner-completions /usr/share/bash-completion/completions

如果未安装Pillow/NumPy,工具仍可运行——仅跳过LSB和像素熵检查,并打印一条警告信息。


用法

root@kitploit:~
usage: xpiscanner [-h] [--update-blocklist] [--min-severity {CRITICAL,HIGH,MEDIUM,LOW,INFO}] [--json] [--compact] [-v] [-m] [--scans CHECK [CHECK ...]]
                  [targets ...]

Firefox Extension Scanner - Scans XPI files for security risks and malware indicators

positional arguments:
  targets               One or more XPI files or directories containing XPIs to analyze

options:
  -h, --help            show this help message and exit
  --update-blocklist, --update, -u
                        Fetch fresh domain blocklists from URLhaus and Peter Lowe's list, merge with the bundled snapshot, and saves to
                        /home/peb/projects/Firefox-Extensions/extension-scanner/blocklist.json. Exits after updating.
  --min-severity {CRITICAL,HIGH,MEDIUM,LOW,INFO}
                        Minimum severity to display (CRITICAL, HIGH, MEDIUM, LOW, INFO; default: INFO)
  --json                Output results as JSON instead of formatted text
  --compact, -c         Print each finding on 1-2 lines instead of the default 3-line format
  -v, --verbose         Enable verbose output: show additional context for findings
  -m, --manifest        Show full extension manifest for each target
  --scans, -s CHECK [CHECK ...]
                        Limit analysis to specific check types. Choices: anti-analysis, api-abuse, credentials, cross-file,
                        file-meta, hidden-elements, obfuscation, payloads, permissions, polyglot, remote-code,
                        signatures, steganography, time-bomb, zip-tricks. Omit to run all checks (default).

    extension-scanner.py — Analyze Firefox (and other browsers) extension XPI files for security risks and malware indicators.

    Read README.md for information on how to interpret findings, limitations, and best practices for use.  
    This tool is intended for security researchers, analysts, and advanced users who want to perform a 
    comprehensive static analysis of browser extensions. It should work well for other browsers as well, 
    but this has only been tested on firefox.

Usage:
    python3 extension-scanner.py [OPTIONS] targets...

Targets can be individual .xpi files or directories containing .xpi files. Use glob patterns (e.g. *.xpi) for convenience.

Available check types:
    permissions               Dangerous/broad manifest permissions and CSP issues
    remote-code               Background pages or service workers loaded from remote URLs
    obfuscation               eval/atob/encoding tricks, suspicious URLs, high-entropy strings
    payloads                  Base64-encoded blobs decoded and scanned for executables/scripts
    steganography             PNG appended data (auto-decoded via base64/zlib/gzip), unknown chunks, LSB channel analysis
    credentials               Hardcoded API keys, tokens, passwords, private keys, IP addresses
    file-meta                 Magic bytes, double extensions, suspicious filenames, file entropy
    polyglot                  Files valid in two formats simultaneously (e.g. HTML+ZIP)
    zip-tricks                Path traversal, null bytes, duplicate entries, ZIP comments
    cross-file                HTML class tokens cross-referenced against JS localStorage keys
    signatures                Known strings from confirmed malicious extension families (qingcaila, YTMP4, etc.)
    api-abuse                 Browser API calls indicating data theft or exfiltration (cookies, tabs, history, keylogger, clipboard, executeScript)
    hidden-elements           Invisible iframes, zero-dimension element injection, tracking pixels (new Image().src)
    time-bomb                 Long-delay setTimeout, Date.now() gates, localStorage install-date checks, Math.random() gates
    anti-analysis             navigator.webdriver, zero-size window, bare debugger statement, performance.now() timing

Examples:
    python3 extension-scanner.py extension.xpi
    python3 extension-scanner.py *.xpi
    python3 extension-scanner.py /path/to/extensions/
    python3 extension-scanner.py a.xpi b.xpi --min-severity HIGH
    python3 extension-scanner.py ext.xpi --scans obfuscation payloads
    python3 extension-scanner.py ext.xpi --s steganography zip-tricks file-meta
    python3 extension-scanner.py ext.xpi --verbose
    python3 extension-scanner.py --update-blocklist
    python3 extension-scanner.py --manifest

Tips:
    - Make sure to source scanner-completions.sh from your .bashrc or .zshrc to enable tab completion for --scans categories and target file paths.
    - Use --min-severity to focus on the most critical findings first.
    - Use --scans to limit the analysis to specific categories of checks if you're looking for something specific or want to speed up the scan.
    - Review the full manifest with --manifest for context on permissions, content scripts, and other extension metadata that can help interpret findings.
    - Regularly update the blocklist with --update-blocklist to ensure the latest malicious domains are included in the checks.

Credits:
    Developed by Ernos @ https://www.yourdev.net
    Email: max at yourdev.net
    GitHub: https://www.github.com/ernos/extension-scanner

选项



阅读输出

root@kitploit:~
════════════════════════════════════════════════════════════════════════════
  XPI ANALYZER — example.xpi
════════════════════════════════════════════════════════════════════════════
  Overall verdict: HIGH RISK

  Findings: 1 CRITICAL  3 HIGH  2 MEDIUM  1 LOW

  ── CRITICAL ────────────────────────────────────────────────────────────
  [CRITICAL ] [JS_OBFUSCATION] content.js
           eval() call — can execute arbitrary code from strings
           Evidence: var x = eval(atob("dmFyIGE9MTs…"))

  ── HIGH ────────────────────────────────────────────────────────────────
  [HIGH     ] [PERMISSION] manifest.json
           Dangerous permission: 'nativeMessaging' — Can spawn native OS …
           Evidence: permissions: ['nativeMessaging', 'storage', '<all_urls>']
  …

当分析多个文件时,各个报告之后会打印一个对比表格,将所有扩展并排显示。


退出码

码含义
0无CRITICAL或HIGH发现
1至少一个HIGH发现
2至少一个CRITICAL发现

这使得它易于在CI管道或Shell脚本中使用:

root@kitploit:~
python3 extension-scanner.py extension.xpi --min-severity HIGH
if [ $? -eq 2 ]; then echo "CRITICAL issues found!"; fi

局限性

  • 仅静态分析。 该工具不执行任何代码。动态技术(运行时获取的载荷、服务端多态性)不会被捕获。
  • LSB隐写启发式规则在某些自然有噪声或高度压缩的图像上会产生误报。
  • 混淆模式侧重于常见技术;自定义或新颖的打包器可能不会触发警告。
  • 白名单域名(Google API、Mozilla、W3C)不会在URL检查中被标记。合法的扩展如果调用了其他受信任的CDN,可能显示为HIGH发现。
  • 该工具不会将文件提交给任何外部服务。所有分析均在本地完成。

作者

Maximilian Cornett

联系方式

https://www.yourdev.net https://www.github.com/ernos

许可证

GNU General Public License - 本工具仅用于安全研究和防御性分析。

下载工具
定时炸弹setTimeout/setInterval延迟≥5分钟;Date.now()算术门控;localStorage安装日期检查,在首次运行数天后激活行为;Math.random()阈值门控,仅在部分页面加载时触发。
反分析navigator.webdriver检查;零宽/高窗口比较;裸debugger语句;performance.now()算术用于基于计时的沙箱检测。
标志描述
--update-blocklist从URLhaus和Peter Lowe的广告/恶意服务器列表获取最新的域名名单,与捆绑的快照合并,并保存到脚本旁边的blocklist.json。更新后退出。
targets一个或多个.xpi文件或目录
--min-severity过滤输出:CRITICAL、HIGH、MEDIUM、LOW、INFO(默认:INFO)
--json以JSON文档而非可读报告形式输出发现
--verbose 或 -v打印manifest.json内容,并包含可疑模式周围5行左右的代码
--checks仅扫描指定的检查类别(见下文)
可用的检查类别类别中的检查描述
permissions危险/宽泛的清单权限和CSP问题
remote-code从远程URL加载的后台页面或Service Worker
obfuscationeval/atob/编码技巧、可疑URL、高熵字符串
payloads解码Base64编码的数据块并扫描可执行文件/脚本
steganographyPNG追加数据、未知数据块、LSB通道分析
credentials硬编码的API密钥、令牌、密码、私钥、IP地址
file-meta魔数、双扩展名、可疑文件名、文件熵
polyglot同时有效于两种格式的文件(如HTML+ZIP)
zip-tricks路径遍历、空字节、重复条目、ZIP注释
cross-fileHTML类令牌与JS localStorage键的交叉引用
api-abuse指示数据窃取或外泄的浏览器API调用(cookies、tabs、history、键盘、剪贴板)。当数据收集+网络发送出现在同一文件中时升级为CRITICAL。
hidden-elements不可见iframe注入和追踪像素。当iframe隐藏并追加到DOM时升级为HIGH。
time-bomb长延迟setTimeout、Date.now()算术门控、localStorage安装日期、Math.random()阈值。
anti-analysisnavigator.webdriver、零尺寸窗口、裸debugger语句、performance.now()算术。