Text Generation
PEFT
English
cybersecurity
penetration-testing
exploit-development
offensive-security
lora
qwen
code
Instructions to use HeeBive/ZeroSec-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use HeeBive/ZeroSec-7B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
π΄ ZeroSec-7B β exploit-specialized LLM (training in progress)
Browse files
README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-Coder-7B-Instruct
|
| 4 |
+
library_name: peft
|
| 5 |
+
tags:
|
| 6 |
+
- cybersecurity
|
| 7 |
+
- penetration-testing
|
| 8 |
+
- exploit-development
|
| 9 |
+
- offensive-security
|
| 10 |
+
- lora
|
| 11 |
+
- qwen
|
| 12 |
+
- code
|
| 13 |
+
datasets:
|
| 14 |
+
- ezradixon/zerosectraining
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# ZeroSec-7B π΄
|
| 21 |
+
|
| 22 |
+
A QLoRA fine-tune of Qwen2.5-Coder-7B on 29,588 exploit and security samples.
|
| 23 |
+
|
| 24 |
+
**Built by [The Zero Project](https://github.com/ezradixon) β use only for authorized security testing.**
|
| 25 |
+
|
| 26 |
+
## What is this?
|
| 27 |
+
|
| 28 |
+
ZeroSec-7B is a specialist language model trained exclusively on offensive security data:
|
| 29 |
+
- **15,023 exploit code files** (Python, C, Perl, Ruby, PHP) from ExploitDB
|
| 30 |
+
- **13,468 vulnerability detection rules** from Nuclei templates
|
| 31 |
+
- **576 attack payloads** from PayloadsAllTheThings (SQLi, XSS, CMDi, SSTI, SSRF, etc.)
|
| 32 |
+
- **523 methodology & reference documents** on exploitation techniques
|
| 33 |
+
|
| 34 |
+
It's designed to assist with legitimate penetration testing, vulnerability research, and security education.
|
| 35 |
+
|
| 36 |
+
## Quick Start
|
| 37 |
+
|
| 38 |
+
### Option 1: Merge + run locally (recommended)
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
# 1. Download the LoRA adapter
|
| 42 |
+
git lfs install
|
| 43 |
+
git clone https://huggingface.co/ezradixon/ZeroSec-7B
|
| 44 |
+
|
| 45 |
+
# 2. Merge with base model
|
| 46 |
+
python merge_and_export.py
|
| 47 |
+
|
| 48 |
+
# 3. Quantize for local inference (Mac/CPU)
|
| 49 |
+
llama-quantize merged-model-f16.gguf Q4_K_M zerosect-7b-Q4_K_M.gguf
|
| 50 |
+
|
| 51 |
+
# 4. Run
|
| 52 |
+
llama-server -m zerosect-7b-Q4_K_M.gguf -ngl 99
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
### Option 2: Python inference
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 59 |
+
from peft import PeftModel
|
| 60 |
+
import torch
|
| 61 |
+
|
| 62 |
+
base_model = "Qwen/Qwen2.5-Coder-7B-Instruct"
|
| 63 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
+
base_model,
|
| 65 |
+
torch_dtype=torch.float16,
|
| 66 |
+
device_map="auto",
|
| 67 |
+
trust_remote_code=True,
|
| 68 |
+
)
|
| 69 |
+
model = PeftModel.from_pretrained(model, "ezradixon/ZeroSec-7B")
|
| 70 |
+
model = model.merge_and_unload()
|
| 71 |
+
|
| 72 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
|
| 73 |
+
|
| 74 |
+
prompt = "Write a Python script to check for SQL injection in a login form"
|
| 75 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 76 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 77 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Training Details
|
| 81 |
+
|
| 82 |
+
| Parameter | Value |
|
| 83 |
+
|---|---|
|
| 84 |
+
| Base model | Qwen/Qwen2.5-Coder-7B-Instruct |
|
| 85 |
+
| Method | QLoRA (4-bit quantization) |
|
| 86 |
+
| GPU | NVIDIA A10G (24GB) |
|
| 87 |
+
| Training samples | 29,588 |
|
| 88 |
+
| Max sequence length | 1024 tokens |
|
| 89 |
+
| Batch size | 2 (effective 8 with grad accum) |
|
| 90 |
+
| Epochs | 2 |
|
| 91 |
+
| Learning rate | 2e-4 |
|
| 92 |
+
| LoRA rank | 16, alpha 32 |
|
| 93 |
+
| Training time | ~2 hours |
|
| 94 |
+
| Cost | ~$2.00 (Modal serverless) |
|
| 95 |
+
|
| 96 |
+
## Limitations
|
| 97 |
+
|
| 98 |
+
- **7B parameters** β not as capable as larger models (GPT-4, Claude)
|
| 99 |
+
- **Training data quality varies** β ExploitDB contains legacy code that may not work on modern systems
|
| 100 |
+
- **No real-world validation** β exploits were not tested against live targets
|
| 101 |
+
- **English only** β training data is overwhelmingly English
|
| 102 |
+
|
| 103 |
+
## β οΈ Disclaimer
|
| 104 |
+
|
| 105 |
+
**This model is for authorized security testing and education only.**
|
| 106 |
+
|
| 107 |
+
Do not use ZeroSec-7B for:
|
| 108 |
+
- Attacking systems without explicit written permission
|
| 109 |
+
- Developing malware or ransomware
|
| 110 |
+
- Any illegal activity whatsoever
|
| 111 |
+
|
| 112 |
+
The Zero Project and the model's creator are not responsible for any misuse.
|
| 113 |
+
|
| 114 |
+
## Author
|
| 115 |
+
|
| 116 |
+
**Ezra Dixon** β [The Zero Project](https://github.com/ezradixon)
|
| 117 |
+
|
| 118 |
+
Built on Modal cloud GPUs. π¦πΊ
|