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 three specialist modes and exposes a clean REST API.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β βββ βββ ββββββ ββββ βββ βββββββ βββββββ ββββββββββ β
β βββ ββββββββββββββββ βββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββ ββββββ βββ ββββββ βββ β
β βββββββββββββββββββββββββββββ βββ ββββββ βββββ
β βββ ββββββ ββββββ ββββββββββββββββββββββββββββββββββββ
β βββ ββββββ ββββββ βββββ βββββββ βββββββ βββββββ β
β CyberViser β Pentest + SOC Specialist β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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 |
| π 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 (IP, domain, URL, hash, email) |
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"}'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
/clear β clear conversation history
/history β show history
/model <id> β switch NVIDIA NIM model
/exit β quit
Hancock 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