经 AI Skill Hub 精选评估,Offsec-AI 获评「强烈推荐」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
Offsec-AI 是一款基于 Python 开发的开源工具,专注于 offensive-security、network-reconnaissance、python3 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Offsec-AI 是一款基于 Python 开发的开源工具,专注于 offensive-security、network-reconnaissance、python3 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install offsec-ai
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install offsec-ai
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/Htunn/offsec-ai
cd offsec-ai
pip install -e .
# 验证安装
python -c "import offsec_ai; print('安装成功')"
# 命令行使用
offsec-ai --help
# 基本用法
offsec-ai input_file -o output_file
# Python 代码中调用
import offsec_ai
# 示例
result = offsec_ai.process("input")
print(result)
# offsec-ai 配置文件示例(config.yml) app: name: "offsec-ai" debug: false log_level: "INFO" # 运行时指定配置文件 offsec-ai --config config.yml # 或通过环境变量配置 export OFFSEC_AI_API_KEY="your-key" export OFFSEC_AI_OUTPUT_DIR="./output"
██████╗ ███████╗███████╗███████╗███╗ ██╗███████╗██╗██╗ ██╗███████╗
██╔═══██╗██╔════╝██╔════╝██╔════╝████╗ ██║██╔════╝██║██║ ██║██╔════╝
██║ ██║█████╗ █████╗ █████╗ ██╔██╗ ██║███████╗██║██║ ██║█████╗
██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║╚██╗██║╚════██║██║╚██╗ ██╔╝██╔══╝
╚██████╔╝██║ ██║ ███████╗██║ ╚████║███████║██║ ╚████╔╝ ███████╗
╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚══════╝-AI
Offensive-Security Toolkit · AI/LLM · MCP · A2A · Postman · Blockchain · Red-Team
<p align="center"> <a href="https://github.com/Htunn/offensive-ai/actions/workflows/test.yml"><img src="https://github.com/Htunn/offensive-ai/actions/workflows/test.yml/badge.svg?branch=develop" alt="Test and Build"/></a> <a href="https://github.com/Htunn/offensive-ai/actions/workflows/publish.yml"><img src="https://github.com/Htunn/offensive-ai/actions/workflows/publish.yml/badge.svg" alt="Publish to PyPI"/></a> <a href="https://github.com/Htunn/offensive-ai/actions/workflows/docker.yml"><img src="https://github.com/Htunn/offensive-ai/actions/workflows/docker.yml/badge.svg" alt="Docker Build"/></a> <a href="https://github.com/Htunn/offensive-ai/actions/workflows/codeql.yml"><img src="https://github.com/Htunn/offensive-ai/actions/workflows/codeql.yml/badge.svg" alt="CodeQL"/></a> </p>
<p align="center"> <a href="https://pypi.org/project/offensive-ai/"><img src="https://img.shields.io/pypi/v/offensive-ai" alt="PyPI Version"/></a> <a href="https://pepy.tech/project/offensive-ai"><img src="https://static.pepy.tech/badge/offensive-ai" alt="PyPI Download"/></a> <a href="https://pypi.org/project/offensive-ai/"><img src="https://img.shields.io/pypi/pyversions/offensive-ai" alt="Python Version"/></a> <a href="https://hub.docker.com/r/htunnthuthu/offensive-ai"><img src="https://img.shields.io/docker/pulls/htunnthuthu/offensive-ai" alt="Docker Pulls"/></a> <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"/></a> </p>
Offensive-security toolkit for authorized red-team engagements.
offensive-ai is a Python library and CLI that combines classic network reconnaissance with modern AI/LLM security testing. It probes live AI/LLM endpoints for the OWASP LLM Top 10, scans and actively attacks Model Context Protocol (MCP) servers for known CVEs, and performs full-stack infrastructure security assessments.
Legal Notice: Active attack features (mcp-attack,openclaw-attack,k8s-attack,auth-attack,a2a-attack,postman-attack,blockchain-attack, deep mode, andagent's attack tools with--i-have-authorization) require explicit confirmation of authorization. Only use against systems you own or have explicit written permission to test.
---
offensive-ai ai-owasp-scan https://api.example.com/v1/chat/completions --llm-judge ```
offensive-ai openclaw-attack 192.168.1.10 --i-have-authorization
```bash
```bash docker run --rm htunnthuthu/offensive-ai:latest --help
██████╗ ███████╗███████╗███████╗███╗ ██╗███████╗██╗██╗ ██╗███████╗
██╔═══██╗██╔════╝██╔════╝██╔════╝████╗ ██║██╔════╝██║██║ ██║██╔════╝
██║ ██║█████╗ █████╗ █████╗ ██╔██╗ ██║███████╗██║██║ ██║█████╗
██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║╚██╗██║╚════██║██║╚██╗ ██╔╝██╔══╝
╚██████╔╝██║ ██║ ███████╗██║ ╚████║███████║██║ ╚████╔╝ ███████╗
╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚══════╝-AI
Offensive-Security Toolkit · AI/LLM · MCP · A2A · Postman · Blockchain · Red-Team
```bash
```bash
```bash
```bash
```bash
```bash
```bash
```bash
| CVE | Severity | Description |
|---|---|---|
| CVE-2019-3778 | CRITICAL | Spring Security OAuth — open redirect via malformed redirect_uri |
| CVE-2017-11427 | HIGH | SAML XSW — Shibboleth/OneLogin signature wrapping |
| CVE-2018-0489 | HIGH | SAML XSW — Shibboleth SP unsigned assertion acceptance |
| CVE-2023-41900 | HIGH | Keycloak — session fixation via OIDC back-channel logout |
| AUTH-ADV-PKCE | HIGH | Missing PKCE enables authorization code interception |
| AUTH-ADV-IMPLICIT | HIGH | Implicit flow exposes tokens in browser history |
| AUTH-ADV-STATE | HIGH | Missing state parameter enables CSRF on authorization code |
| AUTH-ADV-ALGNONE | CRITICAL | alg=none JWT accepted — authentication bypass |
pip install "offensive-ai[ai]" ```
offensive-ai postman-scan collection.json -T https://api.example.com
offensive-ai postman-scan collection.json -e env.json -T https://api.example.com
Install the [ai] extra and set an API key to enable smarter semantic detection:
pip install "offensive-ai[ai]"
export GEMINI_API_KEY="AIza..." # Google Gemini (1st priority)
export ANTHROPIC_API_KEY="sk-ant-..." # or Anthropic (2nd priority)
export OPENAI_API_KEY="sk-..." # or OpenAI (3rd priority)
If multiple keys are set, Gemini is used first, then Anthropic, then OpenAI. Without the extra, detection falls back to rule-based pattern matching.
---
offensive-ai openclaw-scan 192.168.1.10
offensive-ai k8s-scan 127.0.0.1 --port 8001 --llm-judge offensive-ai k8s-attack 192.168.1.100 --i-have-authorization --mode deep offensive-ai k8s-attack 127.0.0.1 --port 8001 --i-have-authorization --llm-judge
import asyncio
from offensive_ai import LLMOwaspScanner, MCPScanner, MCPAttacker, AuthorizationRequired
from offensive_ai import AuthScanner, AuthAttacker, AuthProtocol
from offensive_ai import A2AScanner, A2AAttacker
from offensive_ai import PostmanScanner, PostmanAttacker
async def main():
# Postman collection security scan
pm = PostmanScanner(
collection_path="collection.json",
environment_path="env.json",
target_override="https://api.example.com",
)
pm_result = await pm.scan()
print(f"Endpoints: {pm_result.endpoints_scanned} Vulns: {len(pm_result.all_vulns)} Critical: {pm_result.has_critical}")
# A2A agent security scan
a2a = A2AScanner("https://agent.example.com")
a2a_result = await a2a.scan()
print(f"Agent: {a2a_result.agent_card.name} Skills: {len(a2a_result.agent_card.skills)}")
print(f"Auth: {a2a_result.auth_posture.auth_type} Unauthed: {a2a_result.auth_posture.unauthenticated_access}")
print(f"Vulnerabilities: {len(a2a_result.all_vulns)} Critical: {a2a_result.has_critical}")
# Auth protocol scan (OIDC / OAuth2 / SAML)
auth = AuthScanner("https://accounts.google.com")
auth_result = await auth.scan()
print(f"Protocol: {auth_result.protocol.value} Provider: {auth_result.provider_info.name}")
print(f"Vulnerabilities: {len(auth_result.all_vulns)}")
# SAML scan
saml = AuthScanner("https://mocksaml.com/api/saml/metadata", protocol="saml")
saml_result = await saml.scan()
print(f"SAML issuer: {saml_result.provider_info.issuer}")
# Auth attack (requires explicit authorization)
attacker = AuthAttacker(authorized=True)
report = await attacker.attack(
target="https://auth.example.com",
mode="safe",
)
print(f"Attacks run: {report.attacks_run}, triggered: {report.attacks_triggered}")
# AI OWASP scan
scanner = LLMOwaspScanner("https://api.example.com/v1/chat/completions")
result = await scanner.scan()
print(f"Grade: {result.overall_grade} Score: {result.total_score}")
for cat_id, cat in result.categories.items():
if cat.findings:
print(f" {cat_id}: {len(cat.findings)} finding(s) — grade {cat.grade}")
# MCP scan
mcp = MCPScanner("https://mcp.example.com/mcp")
mcp_result = await mcp.scan()
print(f"MCP vulnerabilities: {len(mcp_result.vulnerabilities)}")
# MCP attack (requires explicit authorization)
try:
attacker = MCPAttacker(authorized=True) # must be True
report = await attacker.attack(
target="https://mcp.example.com/mcp",
transport="http",
mode="safe",
)
print(f"Attacks run: {report.attacks_run}, triggered: {len(report.triggered_results)}")
except AuthorizationRequired:
print("Provide authorized=True to unlock attack mode")
asyncio.run(main())
---
import asyncio
from offensive_ai import A2AScanner, A2AAttacker, A2AVulnSeverity
from offensive_ai.core.llm_judge import LLMJudge
from offensive_ai.exceptions import AuthorizationRequired
async def main():
# Optional LLM judge
judge = LLMJudge.from_env() # reads GEMINI_API_KEY / ANTHROPIC_API_KEY / OPENAI_API_KEY
# Passive scan
scanner = A2AScanner(
target="https://agent.example.com",
port=None, # override port (optional)
headers={}, # extra HTTP headers
timeout=15.0,
verify_tls=True,
judge=judge, # None = rule-based only
)
result = await scanner.scan()
print(f"Agent : {result.agent_card.name} v{result.agent_card.version}")
print(f"Provider : {result.agent_card.provider_organization}")
print(f"Skills : {len(result.agent_card.skills)}")
print(f"Auth type : {result.auth_posture.auth_type}")
print(f"Unauthed access: {result.auth_posture.unauthenticated_access}")
print(f"Push webhooks : {result.agent_card.capabilities.push_notifications}")
print(f"Card signed : {result.agent_card.is_signed}")
print(f"Vulnerabilities: {len(result.all_vulns)} Critical: {result.has_critical}")
for vuln in result.all_vulns:
print(f" [{vuln.severity.value}] {vuln.vuln_id}: {vuln.title}")
if vuln.evidence:
print(f" Evidence: {vuln.evidence[:80]}")
if vuln.llm_reasoning:
print(f" LLM ({vuln.llm_confidence:.0%}): {vuln.llm_reasoning[:100]}")
# Authorized active attack
try:
attacker = A2AAttacker(authorized=True, judge=judge)
report = await attacker.attack(
target="https://agent.example.com",
mode="deep", # "safe" | "deep"
scan_result=result, # guides SSRF probe (push_notifications check)
)
print(f"Attacks run : {report.attacks_run}")
print(f"Attacks triggered: {report.attacks_triggered}")
for r in report.successful_attacks:
print(f" [{r.severity.value}] {r.attack_id} ({r.attack_type}): {r.title}")
if r.evidence:
print(f" Evidence: {r.evidence[:80]}")
except AuthorizationRequired:
print("Pass authorized=True to unlock attack mode")
asyncio.run(main())
---
offensive-ai postman-scan collection.json
offensive-ai postman-attack collection.json \ --i-have-authorization --mode deep \ -T https://api.example.com -e env.json --llm-judge
import asyncio
from offensive_ai import PostmanScanner, PostmanAttacker, PostmanVulnSeverity
from offensive_ai.core.llm_judge import LLMJudge
from offensive_ai.exceptions import AuthorizationRequired
async def main():
judge = LLMJudge.from_env() # reads GEMINI_API_KEY / ANTHROPIC_API_KEY / OPENAI_API_KEY
# Passive scan
scanner = PostmanScanner(
collection_path="collection.json",
environment_path="env.json", # optional
target_override="https://api.example.com",
headers={"X-Custom-Header": "value"},
timeout=10.0,
verify_tls=True,
max_endpoints=50,
judge=judge,
)
result = await scanner.scan()
print(f"Collection : {result.collection_name}")
print(f"Endpoints scanned: {result.endpoints_scanned}")
print(f"Vulnerabilities : {len(result.all_vulns)} Critical: {result.has_critical}")
for vuln in result.all_vulns:
print(f" [{vuln.severity.value}] {vuln.check_id}: {vuln.title}")
if vuln.evidence:
print(f" Evidence: {vuln.evidence[:80]}")
if vuln.llm_reasoning:
print(f" LLM ({vuln.llm_confidence:.0%}): {vuln.llm_reasoning[:100]}")
# Authorized active attack
try:
attacker = PostmanAttacker(authorized=True, judge=judge)
report = await attacker.attack(
collection_path="collection.json",
environment_path="env.json",
target_override="https://api.example.com",
mode="deep", # "safe" | "deep"
)
print(f"Attacks run : {report.attacks_run}")
print(f"Attacks triggered: {len(report.successful_attacks)}")
if report.exploit_chain_summary:
print(f"Exploit chain : {report.exploit_chain_summary}")
for r in report.successful_attacks:
print(f" [{r.severity.value}] {r.attack_id} ({r.attack_type}): {r.title}")
except AuthorizationRequired:
print("Pass authorized=True to unlock attack mode")
asyncio.run(main())
---
offensive-ai ai-owasp-scan https://api.example.com/v1/chat/completions
offensive-ai ai-owasp-scan https://chat.example.com/api/chat --api-format generic
import asyncio
from offensive_ai import LLMOwaspScanner, LLMScanMode, LLMJudge
async def main():
# Optional: enable LLM judge for smarter detection
judge = LLMJudge.from_env() # reads OPENAI_API_KEY / ANTHROPIC_API_KEY
scanner = LLMOwaspScanner(
endpoint="https://api.example.com/v1/chat/completions",
mode=LLMScanMode.DEEP,
categories=["LLM01", "LLM02", "LLM07"],
api_format="openai",
headers={"Authorization": "Bearer sk-..."},
judge=judge, # None = rule-based only
)
result = await scanner.scan()
print(f"Grade: {result.overall_grade} ({result.total_score} pts)")
for cat_id, cat in result.categories.items():
if cat.findings:
print(f"\n{cat_id}: {cat.category_name}")
for finding in cat.findings:
print(f" [{finding.severity.value}] {finding.title}")
print(f" Evidence: {finding.evidence[:80]}...")
asyncio.run(main())
offensive-ai mcp-scan https://mcp.example.com/mcp
import asyncio
from offensive_ai import MCPScanner, MCPTransport
async def main():
# HTTP transport
scanner = MCPScanner(
target="https://mcp.example.com/mcp",
transport=MCPTransport.HTTP,
headers={"Authorization": "Bearer token"},
judge=LLMJudge.from_env(), # optional: enriches MEDIUM/LOW findings
)
result = await scanner.scan()
print(f"Server: {result.server_info.name} v{result.server_info.version}")
print(f"Tools: {len(result.tools)}, Resources: {len(result.resources)}")
print(f"Vulnerabilities: {len(result.vulnerabilities)}")
for vuln in result.vulnerabilities:
print(f" [{vuln.severity.value}] {vuln.title}: {vuln.description}")
# Stdio transport
scanner = MCPScanner(
target="stdio://local",
transport=MCPTransport.STDIO,
cmd=["npx", "@example/mcp-server"],
)
result = await scanner.scan()
asyncio.run(main())
---
import asyncio
from offensive_ai import MCPAttacker, MCPScanner, AuthorizationRequired
async def main():
# Authorization is enforced at instantiation
try:
bad = MCPAttacker() # raises AuthorizationRequired
except AuthorizationRequired:
pass
attacker = MCPAttacker(authorized=True)
# Optional: use scan result to guide attacks
scanner = MCPScanner("https://mcp.example.com/mcp")
scan_result = await scanner.scan()
report = await attacker.attack(
target="https://mcp.example.com/mcp",
transport="http",
mode="deep",
scan_result=scan_result,
)
print(f"Attacks run: {report.attacks_run}")
print(f"Triggered: {len(report.triggered_results)}")
for r in report.triggered_results:
print(f" [{r.severity.value}] {r.title}")
asyncio.run(main())
---
import asyncio
from offensive_ai import AuthScanner, AuthAttacker, AuthProtocol, LLMJudge
from offensive_ai.exceptions import AuthorizationRequired
async def main():
# Optional LLM judge
judge = LLMJudge.from_env() # reads GEMINI_API_KEY / ANTHROPIC_API_KEY / OPENAI_API_KEY
# --- Passive scan (OIDC/OAuth2 auto-detect) ---
scanner = AuthScanner(
target="https://accounts.google.com",
protocol="auto", # "auto" | "oidc" | "oauth2" | "saml"
judge=judge, # None = rule-based only
timeout=15.0,
verify_tls=True,
)
result = await scanner.scan()
print(f"Protocol : {result.protocol.value}")
print(f"Provider : {result.provider_info.name}")
print(f"Issuer : {result.provider_info.issuer}")
print(f"PKCE req : {result.provider_info.pkce_required}")
print(f"Implicit : {result.provider_info.implicit_flow_enabled}")
for vuln in result.all_vulns:
print(f" [{vuln.severity.value}] {vuln.vuln_id}: {vuln.title}")
if vuln.cve_id:
print(f" CVE: {vuln.cve_id}")
# --- Passive SAML scan ---
saml_scanner = AuthScanner(
target="https://mocksaml.com/api/saml/metadata",
protocol="saml",
)
saml_result = await saml_scanner.scan()
print(f"SAML entityID : {saml_result.provider_info.issuer}")
print(f"Signing certs : {saml_result.provider_info.raw.get('signing_cert_count', 0)}")
# --- Authorized active attack ---
try:
attacker = AuthAttacker(authorized=True)
report = await attacker.attack(
target="https://auth.example.com",
mode="safe", # "safe" | "deep"
judge=judge,
)
print(f"Attacks run : {report.attacks_run}")
print(f"Attacks triggered: {report.attacks_triggered}")
for r in report.triggered_results:
print(f" [{r.severity.value}] {r.title}")
print(f" Evidence: {r.evidence[:80]}...")
except AuthorizationRequired:
print("Pass authorized=True to unlock attack mode")
asyncio.run(main())
See auth.md for the full guide including CVE detail, remediation advice, and SAML testing tips.
---
import asyncio
from offensive_ai.core.openclaw_scanner import OpenClawScanner
from offensive_ai.core.openclaw_attacker import OpenClawAttacker
from offensive_ai.exceptions import AuthorizationRequired
async def main():
# Passive scan
scanner = OpenClawScanner(
target="192.168.1.10",
port=18789,
use_tls=False,
)
result = await scanner.scan()
print(f"OpenClaw detected : {result.openclaw_detected}")
print(f"Version : {result.version}")
print(f"Unauthenticated : {result.unauthenticated_access}")
print(f"Vulnerabilities : {len(result.vulnerabilities)}")
for v in result.vulnerabilities:
print(f" [{v.severity}] {v.advisory_id}: {v.title}")
# Authorized active attack
try:
attacker = OpenClawAttacker(authorized=True)
report = await attacker.attack(
target="192.168.1.10",
port=18789,
mode="safe", # "safe" | "deep"
)
print(f"Attacks triggered : {len(report.triggered_results)}")
for r in report.triggered_results:
print(f" [{r.severity}] {r.title}")
except AuthorizationRequired as exc:
print(exc)
asyncio.run(main())
See openclaw.md for the full guide including remediation advice.
---
import asyncio
from offensive_ai.core.k8s_scanner import K8sScanner
from offensive_ai.core.k8s_attacker import K8sAttacker
from offensive_ai.core.llm_judge import LLMJudge
from offensive_ai.exceptions import AuthorizationRequired
async def main():
# Optional LLM judge — auto-detects OPENAI/ANTHROPIC/GEMINI key from env
judge = LLMJudge() # rule-based fallback when no key is set
# Passive scan
scanner = K8sScanner(
target="192.168.1.100",
ports=[6443, 10250, 2379],
judge=judge,
)
result = await scanner.scan()
print(f"Kubernetes detected : {result.is_kubernetes}")
print(f"Version : {result.server_info.git_version}")
print(f"Exposed components : {[c.component.value for c in result.exposed_components]}")
print(f"OWASP coverage : {result.owasp_coverage}")
print(f"Vulnerabilities : {len(result.vulnerabilities)}")
for v in result.vulnerabilities:
print(f" [{v.severity.value}] {v.owasp_id} {v.vuln_id}: {v.title}")
if v.llm_reasoning:
print(f" LLM: {v.llm_reasoning}")
# Authorized active attack
try:
attacker = K8sAttacker(authorized=True, judge=judge)
report = await attacker.attack(
target="192.168.1.100",
mode="safe", # "safe" | "deep"
scan_result=result, # guides attack selection
)
print(f"Attacks run : {len(report.attack_results)}")
print(f"Succeeded : {len(report.successful_attacks)}")
for r in report.successful_attacks:
print(f" [{r.severity.value}] {r.owasp_id} {r.attack_id}: {r.description}")
except AuthorizationRequired as exc:
print(exc)
asyncio.run(main())
See k8s.md for the full guide including OWASP K8s Top 10 mapping, CVE database, attack sequences, and remediation advice.
---
| Component | Default Ports | Key Probes |
|---|---|---|
| kube-apiserver | 6443, 443, 8080 | /version, /healthz, /api, anon /api/v1/secrets//pods, SelfSubjectAccessReview |
| kubelet | 10250 (rw), 10255 (ro) | /pods, /runningpods, /stats/summary, /spec; /exec /run (attack) |
| etcd | 2379, 2380 | /version, /health, v2/v3 keys |
| scheduler / controller-mgr | 10259 / 10257 | /healthz, /metrics |
| kube-proxy / cAdvisor | 10249 / 4194 | /healthz, metrics |
| Dashboard | 8001, 30000–32767 | UI accessibility, auth posture |
offensive-ai k8s-scan 192.168.1.100
offsec-ai 是一个集成了 AI/LLM 能力的进攻性安全工具包(Offensive-Security Toolkit)。该项目结合了 Red-Team 渗透测试思维与最新的 MCP 协议,旨在通过大语言模型增强安全扫描与攻击模拟的智能化程度,为开发者和安全从业者提供高效的自动化安全评估手段。
本项目具备强大的 AI 驱动安全能力,支持通过 LLM 进行智能化的语义检测与漏洞判定。核心功能涵盖了���对 OWASP 标准的 AI 扫描、基于 MCP 协议的扫描任务,以及模拟真实攻击场景的 Red-Team 攻击模块。此外,它还支持对 Kubernetes (K8s) 环境进行深度探测与攻击模拟。
运行本项目需要 Python 3.12 或更高版本。若需启用 LLM judge 功能(用于更智能的语义检测),必须配置相应的 API 密钥,支持 OPENAI_API_KEY、ANTHROPIC_API_KEY 或 GEMINI_API_KEY。详细的依赖列表请参考项目中的 requirements.txt 文件。
用户可以通过多种方式进行安装。推荐使用 Docker 进行快速部署,通过 `docker run` 命令即可运行相关扫描任务。若需在本地 Python 环境中使用,可以通过 pip 安装基础版,或使用 `pip install "offsec-ai[ai]"` 来安装包含 AI 功能扩展包的完整版本。
项目提供了灵活的 CLI 命令行界面。用户可以通过命令行执行各类扫描任务,例如使用 `ai-owasp-scan` 进行 AI 驱动的 OWASP 扫描,或使用 `mcp-scan` 进行 MCP 协议扫描。在执行涉及主动攻击的操作时,请务必添加 `--i-have-authorization` 标志以明确授权。
项目支持通过环境变量配置 LLM judge 引擎。你可以设置 GEMINI_API_KEY、ANTHROPIC_API_KEY 或 OPENAI_API_KEY。系统会按照优先级自动选择:首选 Gemini,其次是 Anthropic,最后是 OpenAI。通过配置这些 Key,可以实现更精准的漏洞语义识别。
offsec-ai 提供了丰富的 Python API 供开发者集成。你可以通过异步编程方式调用 LLMOwaspScanner、MCPScanner 或 AuthScanner 等核心类。此外,项目也支持通过 kubectl proxy 将 K8s API server 映射到本地,从而实现对集群环境的安全扫描与攻击模拟。
项目模块化设计清晰,涵盖了对 kube-apiserver、kubelet 等 Kubernetes 组件的探测能力。工作流支持从被动扫描(Passive scan)指纹与配置错误,到主动探测关键端口(如 6443, 10250)及敏感路径(如 /api/v1/secrets),最终实现全方位的组件表面分析。
功能齐全的网络安全重构工具
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:Offsec-AI 的核心功能完整,质量优秀。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | offsec-ai |
| 原始描述 | 开源AI工具:offsec-ai is a Python library and CLI that combines classic network reconnaissan。⭐12 · Python |
| Topics | offensive-securitynetwork-reconnaissancepython3 |
| GitHub | https://github.com/Htunn/offsec-ai |
| License | MIT |
| 语言 | Python |
收录时间:2026-07-04 · 更新时间:2026-07-04 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。