KunLun-M — 开源静态代码分析,支持PHP、Nodejs/JavaScript、Python、Golang、Java和C/C++,支持基于AST的语义扫描和一键AI代理集成(OpenClaw、Codex、Claude等)。
概览
是一个开源的静态代码安全分析系统。它从源代码构建AST图,并进行污点分析以检测漏洞。 - : PHP / JavaScript / TypeScript / Python / Java / Go / Ruby / Rust / C / C++ / C# / Kotlin / Lua / Solidity - 构建完整的程序图(调用图、数据流、AST 结构)用于污点追踪 - 三种模式 - :与 Codex / Claude Code / Hermes 等一键集成。 控制台模式提供交互式REPL,支持图遍历: 在图REPL中,使用g作为Joern风格图查询的入口: 完整的API参考请参见docs/graph-traversal.md。 网页模式包括:- 任务管理、项目总览、扫描结果 - :交互式Cytoscape.js图可视化(4种布局)- :认证令牌的REST API 用于自动化 在Kunlun_M/settings.py 配置API_TOKEN以实现API认证。 导出完整项目(数据库记录 + 图表文件)作为可移植.tar.gz:
概述(AI 翻译)
中文 |英语
崑仑
昆仑镜是一个开源静态代码安全分析系统。它从源代码构建AST图,并进行污染分析以检测漏洞。
- 14 种语言:PHP / JavaScript / TypeScript / Python / Java / Go / Ruby / Rust / C / C++ / C# / Kotlin / Lua / Solidity
- **AST 图引擎:构建完整的程序图(调用图、数据流、AST 结构)用于污染跟踪
- CLI / 控制台 / 网页 三种模式
- 内置AI代理技能:一键集成Codex/Claude Code/Hermes等。
快速启动
CLI 命令
核心指令
| 指挥 | 描述 |
|---|---|
init |
初始化/迁移数据库 |
reset |
重置数据库(清除扫描数据,TaintChain,遗留ResultFlow,工作区) |
scan -t |
扫描目标(文件、目录或归档) |
console |
带图形 REPL 的交互式控制台 |
web [-p 9999] |
带API的网页仪表盘 |
analyze |
AST图二级分析 |
export-project -p |
导出项目到可移动档案 |
import-project -f |
从档案导入项目 |
export-neo4j -p |
导出AST图至Neo4j |
扫描参数
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
中文 | English
KunLun-M
KunLun-M(昆仑镜) is an open-source static code security analysis system. It builds an AST graph from source code and performs taint analysis to detect vulnerabilities.
- 14 languages: PHP / JavaScript / TypeScript / Python / Java / Go / Ruby / Rust / C / C++ / C# / Kotlin / Lua / Solidity
- AST graph engine: Builds a full program graph (call graph, data flow, AST structure) for taint tracking
- CLI / Console / Web three modes
- Built-in AI Agent skill: One-click integration with Codex / Claude Code / Hermes etc.
Quick Start
# Install
git clone https://github.com/LoRexxar/Kunlun-M.git && cd Kunlun-M
pip install -r requirements.txt
cp Kunlun_M/settings.py.bak Kunlun_M/settings.py
# Init database
python kunlun.py init
# Scan
python kunlun.py scan -t /path/to/project
# Scan with specific language
python kunlun.py scan -t /path/to/project -lan php
# Export HTML report
python kunlun.py scan -t /path/to/project -f html -o report.html
# Web dashboard
python kunlun.py web -p 9999
CLI Commands
python kunlun.py [args]
Core Commands
| Command | Description |
|---|---|
init |
Initialize / migrate database |
reset |
Reset database (clear scan data, TaintChain, legacy ResultFlow, workspace) |
scan -t |
Scan target (file, directory, or archive) |
console |
Interactive console with graph REPL |
web [-p 9999] |
Web dashboard with API |
analyze |
AST graph secondary analysis |
export-project -p |
Export project to portable archive |
import-project -f |
Import project from archive |
export-neo4j -p |
Export AST graph to Neo4j |
Scan Parameters
| Parameter | Description |
|---|---|
-t/--target |
Target file/directory (required) |
-lan/--language |
Language (php/javascript/python/java/go/ruby/rust/c/cpp/csharp/kotlin/lua/solidity) |
-r/--rule |
Specific rules (comma-separated CVI IDs, e.g. 1000,1001) |
-f/--format |
Output format: csv (default) / json / md / html / xml |
-o/--output |
Output file path |
-tp/--tamper |
Apply tamper (e.g. wordpress) |
-b/--blackpath |
Exclude paths (e.g. vendor,node_modules) |
--without-vendor |
Skip SCA (vendor vulnerability) scan |
--no-cache |
Force rebuild graph (no cache) |
-d/--debug |
Debug mode |
Other Commands
| Command | Description |
|---|---|
export |
Export rules & tampers from database to files |
generate rule |
Generate rule template file |
generate tamper |
Generate tamper template file |
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add lorexxar/kunlun-m