Skip to content

Instantly share code, notes, and snippets.

View mrT4ntr4's full-sized avatar
⚔️
Battling Obfuscation

Suraj Malhotra mrT4ntr4

⚔️
Battling Obfuscation
View GitHub Profile
@mrT4ntr4
mrT4ntr4 / pos.py
Created April 21, 2020 20:03
Implementation of encrypt Function for Position Challenge from Reversing.kr
'''Position
Find the Name when the Serial is 76876-77776
This problem has several answers.
Password is ***p
'''
import string
name = ['g','o','l','u']
serial = [None]*11
@mrT4ntr4
mrT4ntr4 / wavDecode.py
Created April 21, 2020 19:55
Solution script for Challenge Screams from riceteacatpanda CTF 2020
## Fixing wav and generating an img
import soundfile as sf
import numpy as np
from PIL import Image
#im = Image.new()
#np.set_printoptions(threshold=np.inf)
data, samplerate = sf.read('../aaaaaaaaaaaaaaaaaa.wav')
@mrT4ntr4
mrT4ntr4 / deobf_r0shin.py
Created April 21, 2020 19:47
Deobfuscating some strings and variables from r0sh1n's crackme
#https://crackmes.one/crackme/5e2e79f933c5d43b8718c5d0
def deobf(enc,k):
num = 276606405 + k +1
dec = ""
for item in enc:
c = ord(item)
lev2 = ((c >> 8) ^ num) & 0xff
num+=2
dec += (chr(lev2))
@mrT4ntr4
mrT4ntr4 / SharpPasswd_dec_volga20.py
Created April 21, 2020 19:39
Trying decryption of hash for Challenge SharpPasswd.dll from VolgaCTF 2020 (Unsolved)
dd = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
get_bin = lambda x: format(x, 'b').zfill(6)
enc = "h3dly.DhgeOUeicweL2Zp."
n = 4
enc = [enc[i:i+n] for i in range(0, len(enc), n)]
#print enc
i=0
@mrT4ntr4
mrT4ntr4 / SharpPasswd_enc_volga20.py
Last active April 21, 2020 19:37
Encrypt Fcn of Challenge SharpPasswd.dll from VolgaCTF 2020 (Unsolved)
def b64From24bit(a, b, c, n):
num = c << 16 | b << 8 | a
b64enc = ""
while (n):
b64enc += "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[num & 63]
num >>= 6;
n-=1
return b64enc
@mrT4ntr4
mrT4ntr4 / reee_plaid20_z3.py
Created April 20, 2020 10:24
Unoptimized solution script for 'reee' chall from Plaid CTF 2020, solved using z3
from z3 import *
import time
start_time = time.time()
s = Solver()
enc = ['0x48', '0x5f', '0x36', '0x35', '0x35', '0x25', '0x14', '0x2c', '0x1d', '0x01', '0x03', '0x2d', '0x0c', '0x6f', '0x35', '0x61', '0x7e', '0x34', '0x0a', '0x44', '0x24', '0x2c', '0x4a', '0x46', '0x19', '0x59', '0x5b', '0x0e', '0x78', '0x74', '0x29', '0x13','0x2c']
enc = [int(x,16) for x in enc]
inp = []