Created
September 19, 2019 21:24
-
-
Save lionaneesh/c19b457c2cd6ecd314bb06c316eb547d to your computer and use it in GitHub Desktop.
DroidCon, Sect-ctf 2019, RC4 decrypt
This file contains hidden or 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
| from arc4 import ARC4 | |
| data='\xef\x8eX7 CD\xcc\xfb!\x03@\xf5\x10\xf8 \x18\x986\xc09\xcf\x87/\xc2h\xd1\x94\xc6\x83\xfb;aG\xfat\n\xda^\x0f\xb8\xe1]d\xb6=\xd7\xa4\x0216:\x0f\xf8\xf6j\xdeN\xc3\xd5\x82z$^\xfa\xc0\xea\xab\x14\xf1qB\x80\x9c\xc5Z\xd5\xf8\xc0(H\\2\x17_\xa0\xef\xf4\x16q\x00\xbd\x17q\xfd\x10\xef\x17\xe6\xb6\x86\xea[\xb7:\x1c\x85\x8evJ!\x1a\x9d\x00\xefP\x9eml=\x13*g3\x7f\xc7\x97\xb4\xb6' | |
| def decrypt(key): | |
| arc4 = ARC4(key) | |
| config = arc4.decrypt(data) | |
| config = str(config) | |
| if('flag' in config): | |
| print(config, key) | |
| end1="0NOTCOOLMANc" | |
| end2="1NOTCOOLMANc" | |
| end3="0STEALCOINZc" | |
| end4="1STEALCOINZc" | |
| alpha='0123456789abcdefghijklmnopqrstuvwxyz' | |
| # alpha="abcdefghijklmnopqrstuvwxyz" | |
| for i in alpha: | |
| for j in alpha: | |
| for k in alpha: | |
| for l in alpha: | |
| string1=i+j+k+l | |
| decrypt(string1+end1) | |
| decrypt(string1+end2) | |
| decrypt(string1+end3) | |
| decrypt(string1+end4) | |
| print(i+" alphabet completed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment