Command Obfuscation Detection
This project currently only supports cmd.exe command obfuscation detection on Windows. In a previous iteration of this project, we used deep learning. Now, we have shifted the approach towards XGBoost instead.
- Blog post: https://medium.com/adobetech/using-deep-learning-to-better-detect-command-obfuscation-965b448973e0
- Pip package: https://pypi.org/project/obfuscation-detection/
Quick Installation
You can install our package through pip!
pip install obfuscation-detection
This is a basic usage of our package:
from obfuscation_detection import ObfuscationDetectionClassifier
model = ObfuscationDetectionClassifier()
commands = ['cmd.exe /c "echo Invoke-DOSfuscation"',
'cm%windir:~ -4, -3%.e^Xe,;^,/^C",;,S^Et ^^o^=fus^cat^ion&,;,^se^T ^ ^ ^B^=o^ke-D^OS&&,;,s^Et^^ d^=ec^ho I^nv&&,;,C^Al^l,;,^%^D%^%B%^%o^%"',
'cat /etc/passwd']
y = model.predict(commands)
y_prob = model.predict_proba(commands)
# 1 is obfuscated, 0 is non-obfuscated
print(y) # [0, 1, 0]
print(y_prob)
Usage
-
Install python dependencies:
pip install -r requirements.txt -
For quick usage, give a .csv file with column
commandsand you can run the commands through the model:python obfuscation_detection/main.py --filename commands.csv -
You can also write your own scripts to use the model class directly:
python obfuscation_detection/model.py
Contributing
Contributions are welcomed! Read the Contributing Guide for more information.
Licensing
This project is licensed under the Apache V2 License. See LICENSE for more information.
Metadata
Release files for obfuscation-detection 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| obfuscation_detection-1.0.0.tar.gz | 30.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| obfuscation_detection-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.9 kB
Release files / obfuscation_detection-1.0.0.tar.gz
| Download URL | obfuscation_detection-1.0.0.tar.gz |
|---|---|
| Size | 30.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dd63ea8102aea818de431ba39f6756927825aac1bde7c734d9ed8b0eb9b0fff
|
|
BLAKE2b-256 checksum How to use checksums |
9a4739b4131bc27ba4816387e910746fd52d0229549e08117e8678c780dc767c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / obfuscation_detection-1.0.0-py3-none-any.whl
| Download URL | obfuscation_detection-1.0.0-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ffa5c2c2641775d34743732fa535715a4451ed9a7767f239de4e278885d8dded
|
|
BLAKE2b-256 checksum How to use checksums |
a8adc0a302eb8aaa29d4d4a9b28e0bdc16452749d539a06ee97be148fb085f3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for obfuscation-detection 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.