Automate cybersecurity through specialized LLMs β from pentesting to SOC analysis.
π Website Β· π API Docs Β· π Business Proposal Β· π Report Bug Β· β¨ Request Feature
Hancock is CyberViser's AI-powered cybersecurity agent, fine-tuned on Mistral 7B using:
- MITRE ATT&CK β TTPs, tactics, procedures
- NVD/CVE β Real vulnerability data
- Pentest Knowledge Base β Recon, exploitation, post-exploitation
It operates in nine specialist modes and exposes a clean REST API.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β βββ βββ ββββββ ββββ βββ βββββββ βββββββ ββββββββββ β
β βββ ββββββββββββββββ βββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββ ββββββ βββ ββββββ βββ β
β βββββββββββββββββββββββββββββ βββ ββββββ βββββ
β βββ ββββββ ββββββ ββββββββββββββββββββββββββββββββββββ
β βββ ββββββ ββββββ βββββ βββββββ βββββββ βββββββ β
β CyberViser β Pentest + SOC Specialist β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Features
- Quick Start
- API Reference
- CLI Commands
- Environment Variables
- OSINT Geolocation Intelligence
- Security Tool Integrations
- Client SDKs
- Monitoring & Observability
- Deployment
- Fuzzing & Security Testing
- CI/CD Pipelines
- Hugging Face Spaces
- Fine-Tuning
- Roadmap
- Contributing
- License
| Mode | Description | Status |
|---|---|---|
| π΄ Pentest Specialist | Recon, exploitation, CVE analysis, PTES reporting | β Live |
| π΅ SOC Analyst | Alert triage, SIEM queries, PICERL IR, Sigma/YARA | β Live |
| β‘ Auto | Context-aware switching between pentest + SOC | β Live |
| π» Code | Security code: YARA, KQL, SPL, Sigma, Python, Bash | β Live |
| π CISO | Compliance, risk reporting, board summaries, gap analysis | β Live |
| π Sigma | Sigma detection rule authoring with ATT&CK tagging | β Live |
| π¦ YARA | YARA malware detection rule authoring | β Live |
| π IOC | Threat intelligence enrichment for IOCs | β Live |
| π OSINT | IP/domain geolocation, infrastructure mapping, predictive analytics | β Live |
| π GraphQL Security | GraphQL auth/authz testing, IDOR detection, JWT security | β Live |
git clone https://github.com/cyberviser/Hancock.git
cd Hancock
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtcp .env.example .env
# Edit .env and add your NVIDIA API key
# Get one free at: https://build.nvidia.comexport NVIDIA_API_KEY="nvapi-..."
python hancock_agent.pypython hancock_agent.py --server --port 5000# v2 dataset (pentest + SOC):
python hancock_pipeline.py --phase all
# v3 dataset (+ CISA KEV + Atomic Red Team + GitHub Advisories):
python hancock_pipeline.py --phase 3python hancock_finetune.pyStart the server: python hancock_agent.py --server
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Agent status and capabilities |
GET |
/metrics |
Prometheus-compatible request counters |
GET |
/v1/agents |
All agent system prompts and defaults |
POST |
/v1/chat |
Conversational AI with history + streaming |
POST |
/v1/ask |
Single-shot question |
POST |
/v1/triage |
SOC alert triage + MITRE ATT&CK mapping |
POST |
/v1/hunt |
Threat hunting query generator (Splunk/Elastic/Sentinel) |
POST |
/v1/respond |
PICERL incident response playbook |
POST |
/v1/code |
Security code generation (YARA/Sigma/KQL/SPL) |
POST |
/v1/ciso |
CISO advisory: risk, compliance, board reports, gap analysis |
POST |
/v1/sigma |
Sigma detection rule generator |
POST |
/v1/yara |
YARA malware detection rule generator |
POST |
/v1/ioc |
IOC threat intelligence enrichment |
POST |
/v1/geolocate |
OSINT geolocation for IPs/domains |
POST |
/v1/predict-locations |
Predict future threat infrastructure locations |
POST |
/v1/map-infrastructure |
Map and cluster threat infrastructure geographically |
POST |
/v1/webhook |
Ingest alerts from Splunk/Elastic/Sentinel/CrowdStrike |
Alert Triage:
curl -X POST http://localhost:5000/v1/triage \
-H "Content-Type: application/json" \
-d '{"alert": "Mimikatz detected on DC01 at 03:14 UTC"}'Threat Hunting (Splunk):
curl -X POST http://localhost:5000/v1/hunt \
-H "Content-Type: application/json" \
-d '{"target": "lateral movement via PsExec", "siem": "splunk"}'Sigma Rule Generation:
curl -X POST http://localhost:5000/v1/sigma \
-H "Content-Type: application/json" \
-d '{"description": "Detect LSASS memory dump", "logsource": "windows sysmon", "technique": "T1003.001"}'YARA Rule Generation:
curl -X POST http://localhost:5000/v1/yara \
-H "Content-Type: application/json" \
-d '{"description": "Cobalt Strike beacon default HTTP profile", "file_type": "PE"}'IOC Enrichment:
curl -X POST http://localhost:5000/v1/ioc \
-H "Content-Type: application/json" \
-d '{"indicator": "185.220.101.35", "type": "ip"}'OSINT Geolocation:
curl -X POST http://localhost:5000/v1/geolocate \
-H "Content-Type: application/json" \
-d '{"indicators": ["185.220.101.35", "evil.example.com"]}'Predict Threat Infrastructure Locations:
curl -X POST http://localhost:5000/v1/predict-locations \
-H "Content-Type: application/json" \
-d '{"indicators": ["185.220.101.35", "45.33.32.156"], "campaign": "APT29-infra"}'Map Threat Infrastructure:
curl -X POST http://localhost:5000/v1/map-infrastructure \
-H "Content-Type: application/json" \
-d '{"indicators": ["185.220.101.35", "45.33.32.156", "93.184.216.34"]}'GraphQL Security Testing:
# Generate GraphQL security knowledge base
python collectors/graphql_security_kb.py
# Run GraphQL security tests (requires authorization)
python collectors/graphql_security_tester.py \
--url https://api.example.com/graphql \
--token <jwt-token> \
--verbose \
--report graphql_security_report.jsonCISO Board Summary:
curl -X POST http://localhost:5000/v1/ciso \
-H "Content-Type: application/json" \
-d '{"question": "Summarise top 5 risks for the board", "output": "board-summary", "context": "50-person SaaS, AWS"}'Incident Response Playbook:
curl -X POST http://localhost:5000/v1/respond \
-H "Content-Type: application/json" \
-d '{"incident": "ransomware"}'π Full OpenAPI 3.1.0 spec:
docs/openapi.yamlΒ· Interactive API Docs
/mode pentest β switch to Pentest Specialist
/mode soc β switch to SOC Analyst
/mode auto β combined persona (default)
/mode code β security code (Qwen Coder 32B)
/mode ciso β CISO strategy & compliance
/mode sigma β Sigma detection rule authoring
/mode yara β YARA malware detection rule authoring
/mode ioc β IOC threat intelligence enrichment
/mode osint β OSINT geolocation intelligence analyst
/clear β clear conversation history
/history β show history
/model <id> β switch NVIDIA NIM model
/exit β quit
Copy .env.example to .env and configure:
cp .env.example .env| Variable | Description | Default |
|---|---|---|
HANCOCK_LLM_BACKEND |
Backend engine: ollama | nvidia | openai |
ollama |
OLLAMA_BASE_URL |
Ollama server URL | http://localhost:11434 |
OLLAMA_MODEL |
Ollama chat model | llama3.1:8b |
OLLAMA_CODER_MODEL |
Ollama code generation model | qwen2.5-coder:7b |
NVIDIA_API_KEY |
NVIDIA NIM API key (get free) | β |
OPENAI_API_KEY |
OpenAI API key (fallback) | β |
OPENAI_ORG_ID |
OpenAI organization ID | β |
HANCOCK_MODEL |
NIM/OpenAI model override | mistralai/mistral-7b-instruct-v0.3 |
HANCOCK_CODER_MODEL |
NIM/OpenAI code model | qwen/qwen2.5-coder-32b-instruct |
HANCOCK_PORT |
REST API server port | 5000 |
HANCOCK_API_KEY |
Bearer token for API auth (empty = no auth) | β |
HANCOCK_RATE_LIMIT |
Max requests per IP per minute | 60 |
HANCOCK_WEBHOOK_SECRET |
HMAC-SHA256 secret for /v1/webhook |
β |
HANCOCK_SLACK_WEBHOOK |
Slack incoming webhook URL | β |
HANCOCK_TEAMS_WEBHOOK |
Microsoft Teams incoming webhook URL | β |
IPINFO_TOKEN |
ipinfo.io API token (OSINT geolocation fallback) | β |
ABUSEIPDB_KEY |
AbuseIPDB API key (threat enrichment) | β |
VT_API_KEY |
VirusTotal API key (threat enrichment) | β |
The OSINT module (collectors/osint_geolocation.py) provides multi-source IP/domain geolocation, threat infrastructure mapping, geographic clustering, and predictive location analytics.
- Multi-source geolocation β ip-api.com (primary), ipinfo.io (fallback), ipapi.co (secondary fallback)
- Threat enrichment β AbuseIPDB + VirusTotal integration for risk scoring
- Infrastructure mapping β Geographic clustering via Haversine distance, ASN/ISP grouping
- Predictive analytics β Forecast future threat infrastructure locations based on historical patterns
- Risk scoring β Bulletproof ASN detection, country cyber-risk index (see
collectors/osint_geolocation.pyfor the full list)
python hancock_agent.py
# Then type: /mode osint| Method | Endpoint | Description |
|---|---|---|
POST |
/v1/geolocate |
Geolocate a list of IP/domain indicators |
POST |
/v1/predict-locations |
Predict future threat infrastructure locations |
POST |
/v1/map-infrastructure |
Map and cluster indicators geographically |
π Full guide:
docs/osint-geolocation.md
Hancock integrates with common security tools for automated reconnaissance and testing:
| Tool | Module | Description |
|---|---|---|
| Nmap | collectors/nmap_recon.py |
Port scanning, service enumeration, XML-to-JSON parsing |
| SQLMap | collectors/sqlmap_exploit.py |
Automated SQL injection testing via SQLMap API |
| Burp Suite | collectors/burp_post_exploit.py |
Active scanning via Burp REST API |
The GraphQL security framework provides automated penetration testing:
# Generate GraphQL security knowledge base
python collectors/graphql_security_kb.py
# Run GraphQL security tests
python collectors/graphql_security_tester.py \
--url https://api.example.com/graphql \
--token <jwt-token> \
--verbose \
--report graphql_security_report.jsonTests include: introspection detection, IDOR/BOLA, JWT vulnerabilities, mutation authorization bypass, field-level auth flaws, and rate limiting bypasses.
π Guides:
docs/graphql-security-guide.mdΒ·docs/graphql-security-quickstart.mdΒ·TOOL_INTEGRATION.md
pip install openai python-dotenv
python clients/python/hancock_cli.py
# or: make client-pythonSee clients/python/README.md for library usage.
cd clients/nodejs && npm install
node clients/nodejs/hancock.js
# or: make client-nodeSee clients/nodejs/README.md for library usage.
The /metrics endpoint exposes Prometheus-compatible metrics:
| Metric | Type | Description |
|---|---|---|
hancock_requests_total |
Counter | Total requests |
hancock_errors_total |
Counter | Total 4xx/5xx errors |
hancock_requests_by_endpoint |
Counter | Requests per endpoint |
hancock_requests_by_mode |
Counter | Requests per specialist mode |
Additional metrics (histograms, gauges) are available via monitoring/metrics_exporter.py when integrated as middleware β see docs/monitoring.md.
The /health endpoint checks backend availability (Ollama, NVIDIA NIM, or OpenAI) with 30-second TTL caching.
Pre-flight validation:
python deploy/startup_checks.pyπ Full guide:
docs/monitoring.mdΒ·docs/performance.md
# Build image
docker build -t cyberviser/hancock:latest .
# or: make docker
# Run with Docker Compose (Ollama + Hancock)
docker-compose up -d
# or: make docker-up# Apply manifests directly
kubectl apply -f deploy/k8s/
# Or install via Helm
helm install hancock deploy/helm/ -f deploy/helm/values.yamlIncludes HPA (2β10 replicas), ConfigMap, and Secret manifests.
cd deploy/terraform
terraform init && terraform applyflyctl deploy --config fly.toml
# or: make fly-deployπ Guides:
docs/deployment.mdΒ·docs/production-checklist.mdΒ·docs/ci-cd.md
Hancock includes atheris-based fuzz targets for continuous security testing:
| Target | Module Under Test |
|---|---|
fuzz/fuzz_nvd_parser.py |
NVD CVE parser |
fuzz/fuzz_mitre_parser.py |
MITRE ATT&CK parser |
fuzz/fuzz_formatter.py |
JSONL formatter |
fuzz/fuzz_formatter_v3.py |
v3 formatter |
fuzz/fuzz_api_inputs.py |
API endpoint inputs |
fuzz/fuzz_webhook_signature.py |
Webhook HMAC verification |
fuzz/fuzz_ghsa_parser.py |
GitHub Security Advisory parser |
fuzz/fuzz_xml_parsing.py |
XML parsing |
# Run all fuzz targets (60s each)
make fuzz
# Run a specific fuzz target
make fuzz-target TARGET=fuzz_nvd_parserCIFuzz runs on every PR via .github/workflows/cifuzz.yml and daily continuous fuzzing runs via .github/workflows/continuous-fuzz.yml.
| Workflow | Trigger | Description |
|---|---|---|
test.yml |
Push / PR | Unit and integration test suite |
security.yml |
Push / PR | Bandit SAST, pip-audit, Trivy container scan |
codeql.yml |
Push / PR | CodeQL static analysis |
cifuzz.yml |
PR | CIFuzz atheris fuzz testing |
continuous-fuzz.yml |
Daily schedule | Extended continuous fuzzing |
benchmark.yml |
PR | Latency regression benchmarking |
python-package.yml |
Push | Package distribution |
deploy.yml |
Push to main | Automatic deployment to staging |
finetune.yml |
Manual | Model fine-tuning pipeline |
release.yml |
Tag | GitHub release automation |
Hancock is available as a free Gradio web UI on Hugging Face Spaces:
https://huggingface.co/spaces/cyberviser/hancock
To self-host the Spaces app, set these environment variables:
| Variable | Description |
|---|---|
HANCOCK_API_URL |
URL of your deployed Hancock instance |
HANCOCK_API_KEY |
Bearer token (optional, leave blank if auth is disabled) |
python spaces_app.pyHancock uses LoRA fine-tuning on Mistral 7B β trained on a multi-source cybersecurity dataset (MITRE ATT&CK + NVD CVEs + SOC/Pentest KB + CISA KEV + Atomic Red Team + GitHub Security Advisories).
Works on both Google Colab and Kaggle β auto-detects environment:
- Click the badge above (or import
Hancock_Universal_Finetune.ipynbon Kaggle) - Enable GPU (Colab: Runtime β T4 GPU / Kaggle: Settings β Accelerator β T4)
- Run all (~30 min)
- Downloads GGUF Q4_K_M at end β run locally with Ollama
Or use the CLI script directly:
python hancock_finetune_v3.py --steps 300 --export-gguf --push-to-hubRun on any machine β trains TinyLlama-1.1B with LoRA (adapter already included):
# Quick test (10 steps, ~40 min)
python hancock_cpu_finetune.py --debug
# Full run (500 steps, ~25 hr on 16-core CPU)
python hancock_cpu_finetune.py --max-steps 500
# Load and test the saved adapter
python hancock_cpu_finetune.py --testPre-trained adapter: hancock-cpu-adapter/ β TinyLlama-1.1B + LoRA (r=8, eval_loss=2.084)
| Platform | GPU | Cost | Script |
|---|---|---|---|
| Google Colab | T4 16GB | Free (15 hr/day) | Hancock_Universal_Finetune.ipynb |
| Kaggle | T4 16GB | Free (30 hr/week) | Hancock_Universal_Finetune.ipynb |
| Modal.com | T4/A10G | Free $30/mo | modal run train_modal.py |
| Any GPU server | Any | Varies | python hancock_finetune_gpu.py |
# Load fine-tuned model in Ollama
ollama create hancock -f Modelfile.hancock-finetuned
ollama run hancock| Dataset | Samples | Sources | Command |
|---|---|---|---|
hancock_v2.jsonl |
1,375 | MITRE ATT&CK + NVD CVE + Pentest KB + SOC KB | python hancock_pipeline.py --phase 2 |
hancock_v3.jsonl |
5,670 | v2 + CISA KEV + Atomic Red Team + GitHub Security Advisories | python hancock_pipeline.py --phase 3 |
# Generate latest v3 dataset (internet required)
python hancock_pipeline.py --phase 3
# Or offline-only (static KB, no internet)
python hancock_pipeline.py --kb-onlydata/
βββ hancock_pentest_v1.jsonl # Pentest training data (MITRE + CVE + KB)
βββ hancock_v2.jsonl # v2 dataset β pentest + SOC
βββ hancock_v3.jsonl # v3 dataset β + CISA KEV + Atomic Red Team + GHSA (build with --phase 3)
collectors/
βββ mitre_collector.py # Fetches MITRE ATT&CK TTPs
βββ nvd_collector.py # Fetches NVD/CVE vulnerability data
βββ pentest_kb.py # Pentest knowledge base Q&A
βββ soc_collector.py / soc_kb.py
βββ cisa_kev_collector.py # CISA Known Exploited Vulnerabilities
βββ atomic_collector.py # Atomic Red Team test cases
βββ ghsa_collector.py # GitHub Security Advisories
βββ graphql_security_kb.py # GraphQL auth/authz vulnerability KB
βββ graphql_security_tester.py # GraphQL security testing framework
formatter/
βββ to_mistral_jsonl.py # v1 formatter
βββ to_mistral_jsonl_v2.py # v2 formatter
βββ formatter_v3.py # v3 formatter β merges all sources
| Phase | Focus | Status |
|---|---|---|
| Phase 1 | Pentest Specialist + SOC REST API | β Live |
| Phase 2 | SOC deep specialization + v3 dataset (KEV/Atomic/GHSA) | β Live |
| Phase 3 | CISO strategy + compliance automation | β Live |
| Phase 4 | Enterprise platform + SIEM/SOAR integrations | π Planned |
Contributions are welcome! Please read CONTRIBUTING.md first.
- Fork the repo
- Create a feature branch:
git checkout -b feat/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push and open a PR
CyberViser Proprietary License β see LICENSE for full terms.
- β View and study the code
- β Run locally for personal/research use
- β Submit contributions (assigned to CyberViser)
- β Commercial use without a written license agreement
- β Redistribution or reselling
- β Building competing products or services
- β Training AI/ML models on the code or datasets
- β White-labeling or removing CyberViser branding
For commercial licensing: contact@cyberviser.ai