(Translated by https://www.hiragana.jp/)
GitHub - CompFides/deobfuscate: Decodes stdin or file(s) obfuscated with multiple layers of encodings to ascii. Project has also been ported to a Splunk custom search command.
Skip to content

Decodes stdin or file(s) obfuscated with multiple layers of encodings to ascii. Project has also been ported to a Splunk custom search command.

License

Notifications You must be signed in to change notification settings

CompFides/deobfuscate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deobfuscate

Decodes stdin or file(s) obfuscated with multiple layers of encodings to ascii.
Output file names are appended with '_dbfsctd' to prevent overwriting originals.
Project has also been ported to a Splunk custom search app.

supported encodings

encoding regex
%XX %([A-F0-9]{2})
&#xXX &#x([A-F0-9]{2})(;)
0xXX [0|\\]x([A-F0-9]{2})
\xXX [0|\\]x([A-F0-9]{2}
&#XX; &#([0-9]{2,3})(;)
char(0xXX) char(0x([A-F0-9]{2,3}))
chr(XXX) cha?r(([0-9]{2,3}))
char(XXX) cha?r(([0-9]{2,3}))
char(XXX,XXX,...) cha?r(((\d{2,3}),\s(\d{2,3},?\s?)+))
\\XXX... \\\\([0-7]+)

options

-l --lowercase convert output to lowercase
-p --plus remove plus signs from output
-i --input path
-o --output path

examples

capture stdin and output to stdout

cat log.txt | deobfuscate.py

process file.ext and output to stdout

deobfuscate.py -i file.ext

process all *.ext files in ./file/location/ and output to ./output/

deobfuscate.py -i ./file/location/*.ext -o ./output/

Splunk Custom Search Command

Installation

Create an App via the Splunk Web Interface

Click Apps > Manage Apps
Click Create app

Configure app

Name: deobfuscate
Folder name: deobfuscate
Visible: No
Template: barebones
Click Save

Configure app permissions

Click Permissions link for the deobfuscate app
Check to ensure Everyone role has "Read" permissions
Apply selected role permissions to: select All apps (system)
Click "Save"

Copy deobfuscate.py

cp ./deobfuscate/deobfuscate.py $SPLUNK_HOME/etc/apps/deobfuscate/bin/

Copy deobfuscate_splunk.py

cp ./deobfuscate/splunk/bin/deobfuscate_splunk.py $SPLUNK_HOME/etc/apps/deobfuscate/bin/

Copy commands.conf

cp ./deobfuscate/splunk/default/commands.conf $SPLUNK_HOME/etc/apps/deobfuscate/default/

Move to deobfuscate bin directory

cd $SPLUNK_HOME/etc/apps/deobfuscate/bin/

Install splunk-sdk to bin directory

pip3 install -t . splunk-sdk

Restart Splunk

Click Settings > Server controls
Click Restart Splunk

Usage

Pipe a search to deobfuscate

index = "main" sourcetype = "access_combined" (select OR insert OR cast) | deobfuscate

About

Decodes stdin or file(s) obfuscated with multiple layers of encodings to ascii. Project has also been ported to a Splunk custom search command.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages