AI-driven penetration testing and C2 operations toolkit. Forked from Google Gemini CLI — adds a 40-module security scanner, credential management, DLL templates for privilege escalation, and a system prompt tuned for security engagements.
⚠️ Fork notice: This project extends Google Gemini CLI with security tooling. See FORK.md for the delta from upstream. See ROADMAP.md for future direction.
# 1. Clone and install
git clone https://github.com/n4igme/cancer-cli.git
cd cancer-cli
npm install
# 2. Build all packages
npm run build
# 3. Bundle the chat binary (required for the `cancer` command)
npm run bundle
# 4. Make both commands available globally (optional, but convenient)
npm link
# 5. Run your first scan — dry-run shows attack surface without sending payloads
cancer-scan https://example.com --dry-run
# 6. Full scan
cancer-scan https://example.com --profile normalNote:
npm linkmakescancer-scanandcanceravailable globally. Without it, usenode scripts/cancer-scan.js(scanner) ornode scripts/start.js(chat). To unlink:npm unlink -g @n4igme/cancer-cli
Tip:
scope.jsonin the project root defaults to["*"](all targets allowed). For bug bounties with a limited scope, editscope.jsonfirst.
Cancer CLI is two things in one repo:
Infrastructure for managing sessions, credentials, and pivots across targets
during penetration tests. All via the AI chat interface (cancer command).
Native TypeScript modules (packages/kali-tools/src/scanner/):
| Module | Purpose |
|---|---|
tools/payload-encoder.ts |
PowerShell encoding, reverse shells, file writing, credential stash |
tools/listener.ts |
HTTP callback listener with exfil endpoint |
tools/lpd-exploit.ts |
LPD command injection exploit |
tools/socks5-deployer.ts |
Pure-Java SOCKS5 proxy deployer for distroless targets |
post-exploit/privesc-enum.ts |
Linux privilege escalation enumeration (16+ checks) |
post-exploit/harvest.ts |
Credential harvesting (SSH keys, AWS creds, shadow hashes) |
tools/c2-session/ |
Session and pivot management |
tools/ad-scanner/ |
Active Directory security assessment |
scripts/ directory:
| Tool | Purpose |
|---|---|
cancer-sliver/ |
Sliver C2 client library with pre-compiled protobuf stubs |
cancer-revshell.js |
Reverse shell deployment CLI |
templates/ |
Native x64 DLL templates with Makefile (adduser, flagsearch) |
A 40-module web vulnerability scanner with CVSS 3.1 scoring, MITRE ATT&CK mapping, WAF bypass, and CI-ready output (SARIF).
cancer-scan https://target.com # Full scan
cancer-scan https://target.com --profile aggressive # Deeper scan
cancer-scan https://target.com --dry-run # Show surface, no payloads
cancer-scan --type mobile app.apk # Mobile analysis
cancer-scan --type host 192.168.1.0/24 # Host scan
cancer-scan --proxy http://127.0.0.1:8080 # Via Burp
cancer-scan --module sqli # Single module
cancer-scan -f sarif -o out.sarif.json # CI outputActivate by mentioning "server", "guard", "defend", "protect" in chat. Runs ASSESS → HARDEN → MONITOR workflow.
web(default) — Web application vulnerability scanninghost— Network port scanning + service detectionmobile— APK static analysis + deep link enumerationscode— Source code review patternsprivesc— Post-exploitation privilege escalation checksdesktop— Desktop application analysis
| Profile | Concurrency | Payloads/param | Crawl depth | WAF bypass | Use case |
|---|---|---|---|---|---|
stealth |
1 | 2 | 1 | off | IDs/IPS avoidance, production |
normal |
5 | 5 | 2 | level 1 | Standard scans |
aggressive |
5 | 15 | 3 | level 2 | Staging/testing |
brutal |
10 | no limit | 5 | level 3 | Internal/Lab |
Settings in .cancer/config.json (optional):
{
"proxy": "http://127.0.0.1:8080",
"headers": { "Authorization": "Bearer ..." },
"cookie": "session=abc123",
"exclude": ["logout", "admin"],
"concurrency": 3,
"maxUrls": 200,
"timeout": 10000
}SQLi XSS SSRF SSTI XXE
JWT CSRF LFI CMDi IDOR
CORS GraphQL OAuth NoSQL Upload
Redirect Headers Actuator Auth-Bypass Directory-listing
Subdomain-enum Cloud-infra Mobile-apk Mobile-deeplink NFS
SSH-bruteforce SSH-version Webshell Dirbust Vhost-enum
Login-bruteforce Grep Method-tamper Default-creds Roundcube
Openstamanager Olivetin Craft-CMS Php-deserialization
Subdomain-takeover React-RSC-RCE
cancer-scan https://target.com
cancer-scan https://target.com --profile aggressive
cancer-scan --diff <run1> <run2>
cancer-scan --suppress <stable_id>
cancer-scan --runsEach scan produces a run directory in output/. Findings are identified by
content-hash stable_id — re-scan the same target and only new/different
findings appear.
cancer-scan diff <run_id_1> <run_id_2> # What changed
cancer-scan suppress <stable_id> # Hide a FP
cancer-scan suppress --list # All suppressions
cancer-scan suppress --remove <id> # Unsuppress
cancer-scan runs # Past scansScan a Linux system for privesc vectors:
cancer-privesc target:/path # Local path or SSH remote
cancer-privesc --format json # Machine-readable output
cancer-privesc --thorough # Longer scan, more checksThe scanner can also be invoked programmatically via the post-exploit runner when RCE is confirmed during a scan (auto-chains from CMDi/webshell findings).
# Pipeline: recon → classify → hunt → report
npm run hunt -- --target https://target.com
npm run hunt -- --config my-bounty.json
npm run hunt -- --quick # Fast pass
npm run hunt -- --aggressive # Deep pass# Option 1: Use Ollama locally (no API key needed)
ollama serve
ollama pull qwen2.5-coder:7b
cancer
# Option 2: Use OpenRouter
export OPENROUTER_API_KEY="sk-or-v1-xxxxx"
cancerIn chat mode, tell the agent a target and it orchestrates the full workflow:
reconnaissance → vulnerability classification → exploitation → reporting. The
system prompt (.gemini/system.md) tunes it for security operations.
cancer-scan <target> [options]
Target:
URL, IP, CIDR range, APK file, or directory path
Options:
--type web | host | mobile | scode | privesc | desktop (default: web)
--profile stealth | normal | aggressive | brutal (default: normal)
--module Run only specific module (e.g. sqli, xss)
--exclude Skip specific module(s) by name
--dry-run Show attack surface without sending payloads
--output Output directory (default: output/<run_id>/)
-f, --format plain | json | sarif | md (default: plain)
-o Output file (for json/sarif)
--proxy HTTP proxy (e.g. http://127.0.0.1:8080)
--header Custom header (repeatable)
--cookie Session cookie
--timeout Request timeout in ms (default: 10000)
--concurrency Max concurrent requests (default: 5)
--max-urls Max URLs to crawl (default: 200)
--crawl Crawl depth (default: 2)
--diff Compare two run IDs
--suppress Suppress a finding by stable_id
--runs List all persisted scans
-v, --verbose Verbose output
--version Show version
cancer-privesc <target> [options]
Target:
Local directory path or SSH remote (user@host:/path)
Options:
--format plain | json (default: plain)
--thorough Enable deep checks (default: off)
--output Write results to file
| Symptom | Fix |
|---|---|
npm run build fails |
Node ≥20 required. Check node --version. Try nvm use |
cancer-scan not found |
Run npm link first, or use node scripts/cancer-scan.js |
cancer not working |
Check your provider config. For Ollama: ensure ollama serve is running. For others: verify API key is set. |
| Ollama connection refused | Start Ollama with ollama serve. Check OLLAMA_BASE_URL if using non-default port. |
| Permission denied | Run chmod +x node_modules/.bin/* after install |
| No targets found | Check scope.json — defaults to ["*"] |
| WAF blocking | Use --profile stealth to reduce payload aggression |
| Memory errors | Most type checks require ~4GB+ RAM. Use --max-old-space-size=4096 with Node |
tsc OOM |
Run workspace-specific typecheck: npm run typecheck:kali-tools |
| Linting errors on fork | See FORK.md section on merge conflicts |
Cancer CLI integrates with 65+ Kali Linux tools for advanced operations. Tools are auto-detected on first use if installed on the system.
For a full Kali experience in a container:
docker pull kalilinux/kali-rolling
docker run -it kalilinux/kali-rolling
apt update && apt install -y kali-linux-headlessSee docs/kali-linux-setup.md for details.
AI chat mode uses web search (Tavily, SearXNG, Google) for OSINT during recon. No API key needed for SearXNG (built-in).
Skills extend the agent's capabilities. Activate at runtime:
kali-nmap— Network scanning with Nmapkali-gobuster— Directory bustingkali-sqlmap— SQL injection automationkali-hydra— Network login brute-forcekali-metasploit— Exploit framework integrationkali-wpscan— WordPress vulnerability scanningkali-theharvester— OSINT email/subdomain enumerationcancer-revshell— Reverse shell deploymentcancer-listener— Callback listener setupcancer-socks5— SOCKS5 proxy for distroless targets- And 20+ more Kali skills
packages/
├── cli/ Terminal UI, input processing, tool execution
├── core/ Backend orchestration, AI provider integration
├── kali-tools/ Security scanner (primary value)
│ └── src/scanner/
│ ├── modules/ 40+ vulnerability detection modules
│ ├── post-exploit/ Privesc enum, credential harvesting, GTFOBins
│ ├── tools/ Payload encoder, listener, LPD, SOCKS5, AD scanner
│ └── platforms/ Web, host, mobile, scode scan handlers
├── a2a-server/ Agent-to-agent protocol (candidate for removal)
├── sdk/ Embedding SDK (candidate for removal)
├── devtools/ Network/console inspector (candidate for removal)
├── test-utils/ Shared test fixtures
└── vscode-ide-companion/ VS Code extension (candidate for removal)
scripts/ C2 operations toolkit
├── cancer-scan.js Standalone scanner CLI
├── cancer-privesc.js Privesc automation
├── auto-hunt.mjs Full bug bounty pipeline
├── cancer-sliver/ Sliver C2 client library (Python + protobuf)
└── templates/ Native DLL sources + Makefile
# Install
npm install
# Build all packages
npm run build
# Run tests
npm run test
# Lint
npm run lint
# Typecheck
npm run typecheck
# Full validation (build + lint + test)
npm run preflightSee CONTRIBUTING.md for PR workflow, FORK.md for upstream merge conflicts.
Recon → Discover → Endpoint Import → Hunt → Score → Validate → Suppress → Report
- Recon — Port scan, tech fingerprint, subdomain discovery
- Discover — Crawl endpoints from URLs, JS bundles, forms, sitemaps
- Import — HAR, Burp XML, OpenAPI/Swagger, text, JSONL
- Hunt — 40+ modules each test their vuln class with payloads
- Score — CVSS 3.1 + MITRE ATT&CK + contextual modifiers (EOL, WAF, debug)
- Validate — Anti-inflation gate, evidence quality checks
- Suppress — Cross-run dedup via content-hash stable_id
- Report — Plain text, JSON, SARIF 2.1.0, Markdown
cancer-scan https://target.com --proxy http://127.0.0.1:8080All HTTP traffic routes through the proxy. Also works via config file:
{ "proxy": "http://127.0.0.1:8080" }The scanner exposes a native_scan tool via MCP (Model Context Protocol) for AI
chat clients. Started automatically when the scanner profile requests it.
# Build
docker build -t cancer-cli .
# Run scanner
docker run cancer-cli cancer-scan https://example.com
# Run chat with OpenRouter
docker run -e OPENROUTER_API_KEY=$OPENROUTER_API_KEY cancer-cli
# Run chat with OpenAI-Compatible provider
docker run -e OPENAI_COMPATIBLE_BASE_URL=https://api.groq.com/openai/v1 \
-e OPENAI_COMPATIBLE_API_KEY=$GROQ_API_KEY cancer-cliCancer CLI supports multiple AI providers. Choose one:
| Provider | Required env var(s) | Notes |
|---|---|---|
| Ollama (Local) | OLLAMA_BASE_URL (optional, defaults to localhost) |
No API key needed, runs locally |
| OpenRouter | OPENROUTER_API_KEY |
Multiple models, free tier |
| OpenCode | OPENCODE_API_KEY |
DeepSeek models, free tier |
| OpenAI-Compatible | OPENAI_COMPATIBLE_BASE_URL, OPENAI_COMPATIBLE_API_KEY |
Any OpenAI-compatible API |
# Option 1: Ollama (local, no API key)
ollama serve
ollama pull qwen2.5-coder:7b
cancer
# Option 2: OpenRouter (free models available)
export OPENROUTER_API_KEY="sk-or-v1-xxxxx"
cancer
# Option 3: OpenCode
export OPENCODE_API_KEY="your-key"
cancer
# Option 4: OpenAI-Compatible (e.g., Groq, LM Studio)
export OPENAI_COMPATIBLE_BASE_URL="https://api.groq.com/openai/v1"
export OPENAI_COMPATIBLE_API_KEY="gsk_xxxxx"
cancerSee .env.example for full configuration options.
This project is a fork of Google Gemini CLI, licensed under Apache 2.0. See NOTICE for full attribution and FORK.md for the complete list of modifications.