pretty_name: OffSec RedTeam Codes
license: other
language:
- en
size_categories:
- 10M<n<100M
tags:
- code
- security
- penetration-testing
- pentesting
- offensive-security
- red-team
- osint
- bug-bounty
- ctf
- forensics
- reverse-engineering
- malware-analysis
- threat-hunting
- adversary-emulation
- dataset
- jsonl
- github
- cybersecurity
- cyber-security
task_categories:
- text-generation
- fill-mask
- text-retrieval
- text-ranking
- feature-extraction
- sentence-similarity
- question-answering
- document-question-answering
- summarization
- text-classification
configs:
- config_name: adversary-emulation
data_files:
- split: train
path: adversary-emulation/train-*
- config_name: adversary-simulation
data_files:
- split: train
path: adversary-simulation/train-*
- config_name: binary-exploitation
data_files:
- split: train
path: binary-exploitation/train-*
- config_name: bug-bounty
data_files:
- split: train
path: bug-bounty/train-*
- config_name: bugbounty
data_files:
- split: train
path: bugbounty/train-*
- config_name: c2
data_files:
- split: train
path: c2/train-*
- config_name: command-and-control
data_files:
- split: train
path: command-and-control/train-*
- config_name: ctf
data_files:
- split: train
path: ctf/train-*
- config_name: ethical-hacking
data_files:
- split: train
path: ethical-hacking/train-*
- config_name: exploit
data_files:
- split: train
path: exploit/train-*
- config_name: exploitation
data_files:
- split: train
path: exploitation/train-*
- config_name: forensics
data_files:
- split: train
path: forensics/train-*
- config_name: lateral-movement
data_files:
- split: train
path: lateral-movement/train-*
- config_name: malware-analysis
data_files:
- split: train
path: malware-analysis/train-*
- config_name: offensive-security
data_files:
- split: train
path: offensive-security/train-*
- config_name: osint
data_files:
- split: train
path: osint/train-*
- config_name: penetration-testing
data_files:
- split: train
path: penetration-testing/train-*
- config_name: pentesting
data_files:
- split: train
path: pentesting/train-*
- config_name: persistence
data_files:
- split: train
path: persistence/train-*
- config_name: post-exploitation
data_files:
- split: train
path: post-exploitation/train-*
- config_name: privilege-escalation
data_files:
- split: train
path: privilege-escalation/train-*
- config_name: pwn
data_files:
- split: train
path: pwn/train-*
- config_name: recon
data_files:
- split: train
path: recon/train-*
- config_name: reconnaissance
data_files:
- split: train
path: reconnaissance/train-*
- config_name: red-team
data_files:
- split: train
path: red-team/train-*
- config_name: redteam
data_files:
- split: train
path: redteam/train-*
- config_name: reverse-engineering
data_files:
- split: train
path: reverse-engineering/train-*
- config_name: security
data_files:
- split: train
path: security/train-*
- config_name: threat-hunting
data_files:
- split: train
path: threat-hunting/train-*
- config_name: webhacking
data_files:
- split: train
path: webhacking/train-*
dataset_info:
- config_name: adversary-emulation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 69714885
num_examples: 6686
download_size: 21753502
dataset_size: 69714885
- config_name: adversary-simulation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 3972883
num_examples: 297
download_size: 1218234
dataset_size: 3972883
- config_name: binary-exploitation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 31168730
num_examples: 3760
download_size: 10962879
dataset_size: 31168730
- config_name: bug-bounty
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 92074181
num_examples: 14020
download_size: 29239227
dataset_size: 92074181
- config_name: bugbounty
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 913466117
num_examples: 283694
download_size: 229449923
dataset_size: 913466117
- config_name: c2
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 79200496
num_examples: 6075
download_size: 26367428
dataset_size: 79200496
- config_name: command-and-control
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 20567644
num_examples: 2864
download_size: 6138607
dataset_size: 20567644
- config_name: ctf
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 2483736478
num_examples: 288417
download_size: 782529947
dataset_size: 2483736478
- config_name: ethical-hacking
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 188840514
num_examples: 20317
download_size: 65000701
dataset_size: 188840514
- config_name: exploit
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 1935718615
num_examples: 530182
download_size: 426593667
dataset_size: 1935718615
- config_name: exploitation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 189985279
num_examples: 25221
download_size: 66156344
dataset_size: 189985279
- config_name: forensics
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 522859432
num_examples: 49299
download_size: 159641323
dataset_size: 522859432
- config_name: lateral-movement
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 4977001
num_examples: 357
download_size: 3048593
dataset_size: 4977001
- config_name: malware-analysis
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 2038409393
num_examples: 74275
download_size: 338929688
dataset_size: 2038409393
- config_name: offensive-security
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 141214094
num_examples: 18641
download_size: 42515409
dataset_size: 141214094
- config_name: osint
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 9635815504
num_examples: 382956
download_size: 3574204510
dataset_size: 9635815504
- config_name: penetration-testing
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 650429302
num_examples: 72373
download_size: 202267221
dataset_size: 650429302
- config_name: pentesting
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 2738158144
num_examples: 406119
download_size: 812729521
dataset_size: 2738158144
- config_name: persistence
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 383609845
num_examples: 71027
download_size: 114396034
dataset_size: 383609845
- config_name: post-exploitation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 72623626
num_examples: 6984
download_size: 22998469
dataset_size: 72623626
- config_name: privilege-escalation
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 41482462
num_examples: 3436
download_size: 13246705
dataset_size: 41482462
- config_name: pwn
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 112730343
num_examples: 10070
download_size: 29878447
dataset_size: 112730343
- config_name: recon
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 96680697
num_examples: 20041
download_size: 29096306
dataset_size: 96680697
- config_name: reconnaissance
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 940800571
num_examples: 233813
download_size: 191199541
dataset_size: 940800571
- config_name: red-team
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 430501779
num_examples: 30587
download_size: 139717741
dataset_size: 430501779
- config_name: redteam
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 427756229
num_examples: 46864
download_size: 126638695
dataset_size: 427756229
- config_name: reverse-engineering
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 10645596862
num_examples: 787940
download_size: 2764044510
dataset_size: 10645596862
- config_name: security
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 20019687663
num_examples: 2117990
download_size: 5260414818
dataset_size: 20019687663
- config_name: threat-hunting
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 880474233
num_examples: 52454
download_size: 193579659
dataset_size: 880474233
- config_name: webhacking
features:
- name: content
dtype: string
- name: repo_name
dtype: string
- name: repo_id
dtype: int64
- name: path
dtype: string
- name: branch
dtype: string
- name: license
dtype: string
- name: lang
dtype: string
- name: stargazers
dtype: int64
- name: pushed_at
dtype: timestamp[s]
- name: topics_matched
list: string
- name: size
dtype: int64
- name: topic
dtype: string
splits:
- name: train
num_bytes: 33528261
num_examples: 2144
download_size: 12228192
dataset_size: 33528261
OffSec RedTeam Codes
Token count: ~30B tokens.
OffSec RedTeam Codes is a curated corpus of code (and some auxiliary text) extracted from popular GitHub repositories related to offensive security / red teaming (pentesting, OSINT, C2, privilege escalation, exploitation, forensics, etc.). It is also the largest open-source dataset of red-team and offensive-security code ever compiled.
⚠️ Ethical use only. This dataset is for research, education, and defensive security testing in lawful environments with proper authorization. Do not use it to harm systems, violate terms of service, or break the law.
What’s new (Nov 2025)
- Parquet per‑topic configs are now published for fast loading with
datasets.load_dataset(...). raw/folder added: original JSON/JSONL/NDJSON sources moved underraw/(e.g.raw/github_topic_code-<topic>.jsonl).- All Parquet splits include a constant
topiccolumn. - Shards are sized at ≈256–512 MB to balance memory, upload speed, and downstream streaming.
Repository layout
/ # root
README.md # this card
raw/ # original source JSON/JSONL/NDJSON (one file per topic)
<topic>/ # per-topic Parquet config folder produced by HF Datasets
train-0000X-of-00N.parquet
Schema
All examples share the same columns (Parquet + raw JSON):
- content (string) — full file text (notebook outputs stripped;
execution_countcleared) - repo_name (string) —
owner/name - repo_id (int) — GitHub repo id
- path (string) — file path in repo
- branch (string) — default branch at fetch time
- license (string|null) — SPDX id or GitHub license key
- lang (string) — approx language/extension
- stargazers (int) — star snapshot
- pushed_at (string, ISO‑8601) — last push timestamp
- topics_matched (list[string]) — discovery topics that matched this repo
- size (int) — character length of
content - topic (string) — added during build, equals the topic/config name
Load the Parquet configs (recommended)
Single topic
from datasets import load_dataset
# Loads Parquet for the selected topic (config name)
ds = load_dataset(
"tandevllc/offsec_redteam_codes",
name="pentesting", # pick any topic listed above
split="train",
)
print(len(ds), ds.column_names)
Multiple topics (interleaved)
from datasets import load_dataset, interleave_datasets
names = ["osint", "pentesting", "reverse-engineering"]
parts = [load_dataset("tandevllc/offsec_redteam_codes", name=n, split="train") for n in names]
# Optionally balance by size:
probs = [1/len(parts)]*len(parts)
ds = interleave_datasets(parts, probabilities=probs, seed=42)
Filter by language or license
py = ds.filter(lambda r: r.get("lang") == "py")
permissive = ds.filter(lambda r: (r.get("license") or "").lower() in {"mit","apache-2.0","bsd-3-clause"})
Load the raw JSON/JSONL sources (optional)
If you prefer the original line-delimited JSON:
from datasets import load_dataset
raw = load_dataset(
"json",
data_files="raw/github_topic_code-pentesting.jsonl",
split="train",
repo_id="tandevllc/offsec_redteam_codes",
)
Content selection and filtering
- File types: code-like extensions only (
py,pyw,pyi,js,mjs,cjs,ts,tsx,jsx,java,kt,kts,groovy,scala,c,h,cpp,cc,cxx,hpp,hh,hxx,ino,rs,go,rb,php,phtml,cs,fs,vb,swift,m,mm,sh,bash,zsh,ksh,fish,ps1,psd1,psm1,sql,pl,pm,r,jl,lua,dart,zig,nim,yaml,yml,toml,ini,cfg,conf,env,properties,gradle,cmake,make,mk,mkfile,json,ipynb). - Excluded paths: build outputs, vendored folders, caches, VCS dirs, virtualenvs
- Binaries/archives/media: filtered by extension + text heuristics
- Large files: default cap ≈2 MB (configurable)
- Minified blobs: excluded by average line-length heuristics
- Secrets: basic regex heuristics (keys, private certs) excluded where detected
Intended uses
- Pretraining / continued pretraining of code LMs in the security domain
- RAG / retrieval with metadata filters (language, topics, license, stars)
- Code search / similarity tasks
- Curriculum sampling by
lang,stargazers,topic, or recency (pushed_at)
This dataset is not an instruction set for unauthorized intrusion. Use defensively and ethically.
Limitations & caveats
- Licenses vary per file. The compilation license does not replace upstream licenses.
- Heuristics can omit useful files or miss some undesirable ones.
- Time-varying metadata (stars, topics, default branch) reflect the crawl moment.
License & Access
License: "TanDev Proprietary License — All Rights Reserved"
Upstream Licenses: Each record includes source_repo and source_license. Rights in the original repositories remain with their owners. This compilation license does not limit rights you already have in the upstream sources.
If you are a repository author and would like your content removed, please open an issue or contact the maintainer.
Citation
@dataset{tandevllc_2025_offsec_redteam_codes,
author = {Gupta, Smridh},
title = {OffSec RedTeam Codes},
year = {2025},
url = {https://huggingface.co/datasets/tandevllc/offsec_redteam_codes}
}
Maintainer
Smridh Gupta — [email protected]