Created
November 30, 2022 22:56
-
-
Save drole/681429e1ed1eb6e31229b899c3637914 to your computer and use it in GitHub Desktop.
A simple python function to decode most Gootkit obfuscated javascripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decode(encoded_string): | |
reversed = encoded_string[::-1] | |
decoded = "" | |
decoded_reversed = "" | |
for idx in range(int(len(reversed))): | |
if idx % 2: | |
decoded = decoded + reversed[idx] | |
else: | |
decoded_reversed = decoded_reversed + reversed[idx] | |
return decoded + decoded_reversed[::-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment