icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading DECRYPT2
SHA256 checksum (decrypt2_243.tgz) 8a75cb6ef75127f2c52513f5e899e957b0c68fc48dce72ad5288f3b23735f61e SHA256 checksum (decrypt2_242.tgz) 6d1be89848f5a13cdc64761a034b0b3c71f36f9648f99d716adf5a29dc591449 SHA256 checksum (decrypt2_241.tgz) 268564e7e6b07a8f1567f9196b9d8eed20849daff3b168815972616346a675f2 SHA256 checksum (decrypt2_240.tgz) 0e2afa2a319bcf48fd76176eb08a4693f72d855bed3ec67eaeb37a59a26527b5 SHA256 checksum (decrypt2_2314.tgz) aff28295574759122d167ae9f1f6059c5669039091447e416046164a1beee945 SHA256 checksum (decrypt2_2313.tgz) 7984779ff1a349b88a445f49d97b5ab08391400405b4faeb5aa6e3e9daa1ff21 SHA256 checksum (decrypt2_2312.tgz) 23272f3d59f980999b9140d3bc74bddfe6f49bb37db22912b4f9db9a87896db7 SHA256 checksum (decrypt2_2311.tgz) 4443aca3b13f6dac15cebc11c0a4f58fc0b4b2b6a523887a9e9ff878be2a95d3 SHA256 checksum (decrypt2_2310.tgz) b9e0c7a68cada2b65f8f9e8a088a3ec09f2ffd1c69d9d2dba30a0674efb8e936 SHA256 checksum (decrypt2_239.tgz) 5ac51decdbabcaf5918213da9cc4bc9c2bb0832b7a4cda5defdf936e0f0c0d8a SHA256 checksum (decrypt2_238.tgz) b0800578291d07fde9af50119a431ad7f515f47588c2aea027dc4fdcf64528bc SHA256 checksum (decrypt2_237.tgz) 35da6b2fb097cde568ce8ac792d1696152c0611fb93b188ee7d481b4ca87ca26 SHA256 checksum (decrypt2_236.tgz) 8c49219a077ed7539c1a48a564dd2aa36bd7057672c9b98525d81097309b1c77 SHA256 checksum (decrypt2_235.tgz) 336da64a0dd0ea2674971b885b481e0cea6fa33f76ad1c0afbae485b745b004d SHA256 checksum (decrypt2_234.tgz) 0f9891baf6cb93c01fede3d6b3048a21d3e8546d9f16cec0d38674485da5935d SHA256 checksum (decrypt2_233.tgz) d506cd327f192ffb126db28061e0ac925fcce984905c0b7cf7167bd05a9151a1 SHA256 checksum (decrypt2_232.tgz) 4832477cceff7bbc6325f2b4ce8e249b27bde896dfacf201f0d83be8c51811a5
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

DECRYPT2

Splunk Cloud
Overview
Details
DECRYPT2 is a fork of DECRYPT by Michael Zalewski
DECRYPT is a set of Splunk commands which provide Base32, Base64, XOR, ROTX, RC4, ROL/ROR, hex, ascii, substr, decode (python codec), escape, unescape, htmlescape, htmlunescape, tr, rev, find, substr, slice, zlib_inflate, Base32 reverse endian, Base64 reverse endian, Base58 routines which are commonly used for obfuscating malware communications and data exfiltration.

These commands can be leveraged in Splunk queries by users or automation to decipher previously indexed communications.

. _
| /____ ___________ ___.__._______/ |
/ |/ _/ ____ < | |____ \ __\
/ // \
/\ _| | \/___ || |> > |
_
|_ >_ >| / ____|| /||
\/ \/ \/ \/ |
|

                    Original author: Michael Zalewski <mjz@hexize.com>
                    New maintainer: Gareth Anderson

DECRYPT is a set of Splunk commands which provide encryption and
decryption routines commonly used in malware communication and data
exfiltration.

Installation

DECRYPT is a standard Splunk App and requires no special configuration.

Usage

DECRYPT is implemented as a single search command which exposes a number of data manipulation functions. It takes the required field to manipulate and then one or more functions as arguments.

Usage: decrypt [field=<name>] FUNCTIONS...

The following example will transform the sourcetype field into its hex representation:

... | decrypt field=sourcetype hex() emit('sourcetype')

If the emit function is not mentioned, an emit('decrypted') is automatically added so the data is output

Note: Fields must be output via the emit function. The input field is not modified in place.

Arguments

field

The field argument specifies the Splunk field to use as input.

... | decrypt field="hostname" ...
If no field argument is passed then _raw will be used by default.

Note: If a field argument is passed and the field does not exist in the current record being processed, no error or warning will be given.

FUNCTIONS

Each function passed as an argument will be executed in order, with the output of the previous function provided as input to the next.

... | decrypt field=hostname b64 xor('s\x65cr\x65t') hex emit('decrypted')
The above example can be explained as:

  • Pass the value of the hostname field to b64 as input
  • Pass the output of b64 to xor as input with the argument 's\x65cr\x65t'
  • Pass the output of xor to hex as input
  • Pass the output of hex to emit with the argument 'decrypted', creating a decrypted field

Functions

btoa()
Encodes input to a Base64 string.

b64(), atob()
Decodes a Base64 encoded string.

b32()
Decodes a Base32 encoded string.

b58()
Decodes a Base58 encoded string.

rotx(count)
Implements Caesarian shift. The count argument specifies the amount to shift and must be an integer.

rol(count)
Implements rotate-on-left to each character within the string using an 8 bit boundary. The count argument specifies the amount to rotate and must be an integer.

ror(count)
Implements rotate-on-right to each character within the string using an 8 bit boundary. The count argument specifies the amount to rotate and must be an integer.

xor(key)
Implements basic XOR cipher against the field with the supplied key. The key can be provided as a string or integer.

rc4('key')
Implements the RC4 cipher against the field with the supplied key. The key provided must be a string.

hex()
Transforms input into its hexadecimal representation.

unhex()
Transforms hexadecimal input into its byte form.

save('name')
Saves the current state to memory as name.

load('name')
Recalls the previously saved state name from memory.

ascii()
Transforms input into ASCII output. Non-printable characters will be replaced with a period.

emit('name')
Outputs the current state as UTF-8 to the field name.

substr(offset, count)
Returns a substring of the input, starting at the index offset with the number of characters count. Set the count to 'null' to return from the start offset to the end of the input.

slice(start, end)
Returns a slice of the input, starting at start offset to the end offset. Set the end to 'null' to go to the end of the input.

decode('codec')
Returns a decoded version of the input based on the codec, python codec list is available on https://docs.python.org/3/library/codecs.html#standard-encodings

escape
Returns a string where control characters, \, and non-ASCII characters are backslash escaped (e.g. \x0a, \\, \x80).

unescape
Returns a string run through python unicode_escape (i.e. return the unicode point(s)). Reverses escape. Also unescapes Unicode codepoints (\uxxxx or \Uxxxxxxxx), which escape does not produce.

htmlescape
Returns a string with &, <, and > XML escaped like &amp;.

htmlunescape
Returns a string with HTML references like &gt; and &#62; unescaped to >.

tr('from', 'to')
Takes an argument to translate "from" and an argument of characters to translate "to" and then returns a result with the result (similar to tr in Unix).

rev()
Returns the input in reverse order.

find('subseq', start)
Returns the index of a subsequence "subseq" starting at index "start", or -1 if the subsequence is not found.

b32re()
Returns a reverse-endian base32 decoded string, as used in the SunBurst DGA.

b64re()
Returns a reverse-endian base64 decoded string.

zlib_inflate()
Returns zlib.decompress() inflated bytes. The window size (wbits) must be provided.

Note: you must use single quotes around the strings.

Function Arguments

Strings

Strings can be specified by encapsulating values in apostrophes (single quote). Strings accept Pythonic escape sequences, so hexadecimal and octal values can be specified with \xhh and \ooo respectively.

'This is a valid string'
'This is also \x61 valid string.'

Quotation marks (double quotes) cannot be used.

"This is not a valid string"

Integers

Integers can be specified numerically or as hexadecimal representations by prefixing values with a 0x.

The value 256 could be passed as is or as its hexadecimal representation 0x100.

Field References

The value of Splunk fields can be used in function parameters by passing the field name as an argument. All referenced fields must be complete words unbroken by whitespace.

... | decrypt field=_raw xor(sourcetype) ...
The above example demonstrates passing the sourcetype field as the key to the xor function.

Fields saved using the save command can also be referenced.

... | decrypt field=_raw substr(0,1) save('1byte') substr(1, 4096) xor(1byte) ...

Style

Functions which take no arguments do not need parenthesis in order for syntax checking to pass. The following examples will pass syntax checks and execute the same.

... | decrypt field=_raw b64 hex unhex
... | decrypt field=_raw b64() hex() unhex()
... | decrypt field=_raw b64() hex unhex

New lines can be used to break up command sequences for easier readability.

... | decrypt field=_raw
b64
hex
unhex

Recipes

XOR

... | decrypt field=data xor('secret') emit('result')

ROT13 cipher

... | decrypt field=data rotx(13) emit('result')

Base64 decode, XOR

... | decrypt field=data b64 xor('secret') emit('result')

Base64 decode, XOR with first byte

... | decrypt field=data
b64
save('bin')
substr(0, 1) emit('key')
load('bin')
substr(1, 9999) xor(key) emit('result')

Brute force RC4

... | decrypt field=data
b64
save('orig') rc4('secret') emit('rc4-secret')
load('orig') rc4('password') emit('rc4-password')
load('orig') rc4('abc123') emit('rc4-abc123')
load('orig') rc4('aabbccdd') emit('rc4-aabbccdd')

Brute force XOR key

... | decrypt field=data
b64
save('data') xor(0x01) emit('xor0x01')
load('data') xor(0x02) emit('xor0x02')
load('data') xor(0x03) emit('xor0x03')
...

Reverse the data field

... | decrypt field=data rev

Find the index of a subsequence in a data field

... | decrypt field=data find('subseq', 0)

Decrypt SunBurst DGA with reverse endian base32

... | decrypt field=data tr('ph2eifo3n5utg1j8d94qrvbmk0sal76c', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567') b32re

Contributors

Shannon Davis (Splunk)
Steven (malvidin on github)

Release Notes

2.4.0

Merged pull request from Steven (malvidin on github)

This new version includes:
- Removal of python2 support
- Cleanup code formatting
- Remove unused COMMA handling
- Add slice function

Note that 2.3.14 will be the last version of decrypt2 supporting python2

2.3.14

Merged pull request from Steven (malvidin on github)

This new version includes:
- Improved handling of negative integers
- Update so xor doesn't accept negative integers
- substr now accepts a null as count to return to end of string

2.3.13

Merged pull request from Steven (malvidin on github)

This new version includes:
- Added zlib_inflate function
- Updated Splunk python SDK to 1.7.3

2.3.12

Merged pull request from Steven (malvidin on github)

This new version includes:
- A fix to base58 to deal with empty input
- A setting for slice length and max length on base58

2.3.11

Merged pull request from Steven (malvidin on github)

This new version includes:
- New base58 decode function (b58)
- Updated python SDK to 1.7.2

2.3.10

Merged pull request from Steven (malvidin on github)

When Splunk sends a CSV that contains null bytes to Python 3.7, the CSV Reader error is not helpful
This update provides a warning to advise of the null character in the data (sed/rex/eval/replace can be used to remove the NUL character)

2.3.9

Updated Splunk python SDK to 1.6.20

2.3.8

Merged pull request from Steven (malvidin on github)

  • New find function
  • New b32re, and b64re functions that use the reverse endian decoding used by the SunBurst DGA

2.3.7

Merged pull request from Steven (malvidin on github)

  • New rev function
  • Decreased differences with python2

Updated Splunk python SDK to 1.6.19

2.3.6

Updated metdata file to include sc_admin role for Splunk Cloud

2.3.5

Merged pull request from Steven (malvidin on github)

  • Escape ASCII control characters
  • New functionality based on pull requests by Steven (malvidin) on GitHub

htmlescape
htmlunescape

Note: htmlescape is not implemented for Python 2

Updated Splunk python SDK to 1.6.18

2.3.4

  • New functionality based on pull requests by Steven (malvidin) on GitHub

decode
escape
unescape
tr

2.3.3

  • Minor update to license file
  • The field .decrypt_failure__ is not only output when there is an error (previously always output)
  • If the emit function is omitted, the output now defaults to 'decrypted' as the field name

2.3.2

Fork of version 2.3.1 of DECRYPT app from SplunkBase (under MIT license)
- Updated python SDK to version 1.6.15
- default.meta file now includes read * and write to admin, power
- Created a README.md file

2.3.1

Feb. 16, 2021
- Bug fix for distributed search environments

2.3.0

  • Unicode support
  • Introduce ascii command
  • Command change to SCPv2
  • Changes to save/load command mechanics

2.2.1

  • Bug fix and minor package metadata updates

2.2

  • Addition of Base32 decoding
  • Addition of Base64 decoding alias (b64)

2.1

  • Works with Splunk 8.x
  • Bug fix to work in distributed search environments

2.0

  • Rearchitected due to a limitation with passing binary data between commands
  • Introduced SAVE/LOAD/EMIT/HEX/UNHEX functions

1.0

  • Initial release

Release Notes

Version 2.4.3
Sept. 16, 2024

Updated Splunk python SDK from 2.0.1 to 2.0.2 as per Splunk cloud compatibility requirements

Version 2.4.2
April 17, 2024

Updated python SDK to 2.0.1

Version 2.4.1
Nov. 13, 2023
  • Added support for null argument padding, so find('decrypt2') is equivalent to find('decrypt2', 0)
  • Added zlib_deflate for internal validation of zlib_inflate, which can also be used for information analysis
  • Add basic entropy calculation
Version 2.4.0
June 14, 2023

Merged pull request from Steven (malvidin on github)

This new version includes:
- Removal of python2 support
- Cleanup code formatting
- Remove unused COMMA handling
- Add slice function

Note that 2.3.14 will be the last version of decrypt2 supporting python2

Version 2.3.14
June 7, 2023

Merged pull request from Steven (malvidin on github)

This new version includes:
- Improved handling of negative integers
- Update so xor doesn't accept negative integers
- substr now accepts a null as count to return to end of string

Version 2.3.13
June 2, 2023

Merged pull request from Steven (malvidin on github)

This new version includes:

Added zlib_inflate function
Updated Splunk python SDK to 1.7.3

Version 2.3.12
Oct. 15, 2022

Merged pull request from Steven (malvidin on github)

This new version includes:
- A fix to base58 to deal with empty input
- A setting for slice length and max length on base58

Version 2.3.11
Oct. 9, 2022

Merged pull request from Steven (malvidin on github)

This new version includes:
- New base58 decode function (b58)
- Updated python SDK to 1.7.2

Version 2.3.10
June 20, 2022

Merged pull request from Steven (malvidin on github)

When Splunk sends a CSV that contains null bytes to Python 3.7, the CSV Reader error is not helpful
This update provides a warning to advise of the null character in the data (sed/rex/eval/replace can be used to remove the NUL character)

Version 2.3.9
June 14, 2022

Updated Splunk python SDK to 1.6.20

Version 2.3.8
April 30, 2022

Merged pull request from Steven (malvidin on github)

  • New find function
  • New b32re, and b64re functions that use the reverse endian decoding used by the SunBurst DGA
Version 2.3.7
April 23, 2022

Merged pull request from Steven (malvidin on github)

  • New rev function
  • Decreased differences with python2

Updated Splunk python SDK to 1.6.19

Version 2.3.6
Feb. 27, 2022

Updated the metadata file to include the sc_admin role

Version 2.3.5
Jan. 29, 2022

Merged pull request from Steven (malvidin on github)

  • Escape ASCII control characters
  • New functionality based on pull requests by Steven (malvidin) on GitHub

htmlescape
htmlunescape

Note: htmlescape is not implemented for Python 2

Updated Splunk python SDK to 1.6.18

Version 2.3.4
Aug. 15, 2021

Note the Splunk Python Readiness app incorrectly flags this as not compatible, I've tested on python3 without an issue

New functionality based on pull requests by Steven (malvidin) on github
decode
escape
unescape
tr

This is a fork of the DECRYPT app by Michael Zalewski which is now archived
Version 2.3.3
- Minor update to license file
- The field .decrypt_failure__ is not only output when there is an error (previously always output)
- If the emit function is ommitted, the output now defaults to 'decrypted' as the field name

DECRYPT is a set of Splunk commands which provide Base32, Base64, XOR, ROTX, RC4 and ROL/ROR routines which are commonly used for obfuscating malware communications and data exfiltration.

These commands can be leveraged in Splunk queries by users or automation to decipher previously indexed communications.

Version 2.3.3
June 25, 2021

Note the Splunk Python Readiness app incorrectly flags this as not compatible, I've tested on python3 without an issue

This is a fork of the DECRYPT app by Michael Zalewski which is now archived
Version 2.3.3
- Minor update to license file
- The field .decrypt_failure__ is not only output when there is an error (previously always output)
- If the emit function is ommitted, the output now defaults to 'decrypted' as the field name

Version 2.3.2
- Fork of version 2.3.1 of Decryt from SplunkBase (under MIT license)
- Updated python SDK to 1.6.15
- default.meta file now includes read * and write to admin, power
- Created README.md file

DECRYPT is a set of Splunk commands which provide Base32, Base64, XOR, ROTX, RC4 and ROL/ROR routines which are commonly used for obfuscating malware communications and data exfiltration.

These commands can be leveraged in Splunk queries by users or automation to decipher previously indexed communications.

Version 2.3.2
May 29, 2021

This is a fork of the DECRYPT app by Michael Zalewski which is now archived

Version 2.3.2
- Fork of version 2.3.1 of Decryt from SplunkBase (under MIT license)
- Updated python SDK to 1.6.15
- default.meta file now includes read * and write to admin, power
- Created README.md file

DECRYPT is a set of Splunk commands which provide Base32, Base64, XOR, ROTX, RC4 and ROL/ROR routines which are commonly used for obfuscating malware communications and data exfiltration.

These commands can be leveraged in Splunk queries by users or automation to decipher previously indexed communications.


Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk LLC in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.