Skip to content

Instantly share code, notes, and snippets.

@msm-code
msm-code / paper.python.9791eab6a92fd95aff480029c993e429
Created October 21, 2016 09:36
paper.python.9791eab6a92fd95aff480029c993e429
def parse_message(blob):
i = 0
while i < len(blob):
chunk_type = blob[i:i+4]
chunk_len = from_uint32(blob[i+4:i+8])
chunk_content = blob[i+8:i+8+chunk_len]
process_chunk(chunk_type, chunk_content)
i += 8 + chunk_len
@msm-code
msm-code / paper.python.fd38e71c7996d21488ca07737dd4dc15
Created October 21, 2016 09:36
paper.python.fd38e71c7996d21488ca07737dd4dc15
def inner_decrypt(raw, rsa_key):
encrypted_header, encrypted_data = raw[-0x40:], raw[:-0x40]
decrypted_data = rsa_decrypt(encrypted_header, rsa_key)
md5 = decrypted_data[0:16]
blob = decrypted_data[16:32]
length = from_uint32(decrypted_data[32:36])
serpent_decrypted = crypto.s_decrypt(encrypted_data, blob)[:length]
assert md5 == hashlib.md5(serpent_decrypted).digest()
@msm-code
msm-code / paper.unk.40194f6deb5d679ccdd66f7885ad3281
Created October 21, 2016 09:36
paper.unk.40194f6deb5d679ccdd66f7885ad3281
<d2bf6f4a> >>> [+] [ 62 bytes]:
state information:
data field 0: 0x263
data field 1: 0x23426908
data field 2: 0x0
data field 3: 0x0 <- injects version
data field 4: 0x0
data field 5: 0x0
data field 6: 0x0 <- webfilters version
data field 7: 0x0
@msm-code
msm-code / paper.unk.04102ed29d239357be366ee4d8f9c164
Created October 21, 2016 09:36
paper.unk.04102ed29d239357be366ee4d8f9c164
<b84216c7> <<< [+] [ 4 bytes]:
client ip 195.187.238.160
<be8ec514> <<< [+] [ 257 bytes]:
uri found: 66.168.203.239:34352
uri found: 98.109.148.2:34352
uri found: 80.147.180.254:34352
uri found: 162.222.25.250:34352
uri found: 78.28.51.22:34352
uri found: 75.166.109.79:34352
@msm-code
msm-code / paper.yara.d34fac1409fd90a40b6637dbc35ac654
Created October 21, 2016 09:36
paper.yara.d34fac1409fd90a40b6637dbc35ac654
rule nymaim: trojan
{
meta:
author = "mak"
strings:
$call_obfu_xor = {55 89 E5 5? 8B ?? 04 89 ?? 10 8B ?? 0C 33 ?? 08 E9 }
$call_obfu_add = {55 89 E5 5? 8B ?? 04 89 ?? 10 8B ?? 0C 03 ?? 08 E9 }
$call_obfu_sub = {55 89 E5 5? 8B ?? 04 89 ?? 10 8B ?? 0C 2b ?? 08 E9 }
$nym_get_cnc = {E8 [4] C7 45 ?? [4] C7 45 ?? [4] 83 ??}//3D[4] 01 74 4E E8}
@msm-code
msm-code / paper.asm.9319e5977756b9581c4ce3f8b6c7c31c
Created October 21, 2016 09:53
paper.asm.9319e5977756b9581c4ce3f8b6c7c31c
jz loc_4381B4
xchg eac, [ebp-0Ch]
push 053h
call sub_408D02
push 050h
call sub_408D02
push edx
push 8AB4BF9EH
push 754A35C1H
call sub_41CF77
@msm-code
msm-code / paper.asm.6272ef5748d45a1afee7fbb48bdc5abe
Created October 21, 2016 09:53
paper.asm.6272ef5748d45a1afee7fbb48bdc5abe
mov eax, 0x8CBFB5FF
call xor_eax_with_8CBFB5DA
@msm-code
msm-code / paper.asm.d8e2b049f81c1c7c57f717b042db6bed
Created October 21, 2016 09:53
paper.asm.d8e2b049f81c1c7c57f717b042db6bed
jmp 0x42424242
@msm-code
msm-code / paper.asm.64ca36263ef4107022aa090a54c67161
Created October 21, 2016 09:53
paper.asm.64ca36263ef4107022aa090a54c67161
push 0x40404040
push 0x02020202
jmp detour
detour:
pop eax ; oversimplification, detour can never spoil registers
pop ebx
add eax, ebx ; or xor, or sub, or add
jmp eax
@msm-code
msm-code / paper.asm.9f309c5f45c3c13cc5004490647f08fd
Created October 21, 2016 09:53
paper.asm.9f309c5f45c3c13cc5004490647f08fd
jz loc_4381B4
xchg eac, [ebp-0Ch]
push 053h
call push_cpu_register ; push ebx
push 050h
call push_cpu_register ; push eax
push edx
push 8AB4BF9Eh
push 754A35C1h
call detour_1 ; call f(8AB4BF9Eh, 754A35C1h)