Skip to content

Instantly share code, notes, and snippets.

@hasherezade
hasherezade / brainfuck.l
Created May 28, 2015 18:28
BrainfuckToC (Flex & Bison)
%{
#include "brainfuck.tab.h"
#include <string.h>
#include <stdlib.h>
void error()
{
fprintf(stdout, "Plik niepoprawny pod wzglêdem leksykalnym. Linia: %d\n", yylineno);
exit(1);
}
@hasherezade
hasherezade / AddToShell.reg
Last active June 9, 2021 04:32
PIN_runner
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\PIN_run]
@="Run with PIN"
[HKEY_CLASSES_ROOT\*\shell\PIN_run\command]
@="\"C:\\Pin_Tools\run_me.bat\" \"%1\""
#!/usr/bin/env python
"""
(c) hAsh, 2015 run via ImmunityDbg
"""
__VERSION__ = '0.3.1'
__AUTHOR__ = 'hAsh'
import immlib
import pefile
@hasherezade
hasherezade / bytes.txt
Last active May 20, 2018 20:08
Scripts for unpacking XORed payload
5B_2F_FD_3A_0A_1D_38_A0_DD_FC_4A_A1_6E_11_BD_F1_64_0C_D5_88_C6_35_65_D2_F9_AD_60_B8_C9_3C_92_99_81_FE_35_39_EC_CC_DD_E0_96_A5_DD_AA_89_ED_18_E0_79_0C_9A_91_D1_BE_BD_91_9C_BC_85_F8_06_65_05_52_97_62_2A_A6_89_78_9B_F4_A0_96_44_65_21_DD_69_C8_9F_E6_AD_AA_BB_D2_FF_B2_58_11_6A_42_F0_00_73_7E_88_CC_D7_8D_E6_A7_F0_5C_39_44_4E_18_4D_F3_E1_D9_4C_31_71_7C_02_21_30_4A_12_25_5D_2A_09_6D_78_40_49_69_3A_31_1D_1F_1E_B1_C9_F0_FF_AD_C6_E5_E5_F2_F9_1D_F0_C8_29_6C_30_F8_EA_AF_75_A9_EC_1E_9D_C0_D6_F3_6D_3A_C9_DD_F8_A0_17_7C_8A_A1_D1_CE_3D_F1_5C_EC_95_C8_86_B5_E5_82_B9_8D_A0_B8_89_3E_52_59_C5_7E_B5_B9_AC_8C_9D_60_D2_25_1D_2A_C9_ED_18_E0_F9_2C_DA_D1_91_BC_BD_D1_1C_3C_45_78_C5_65_05_97_D9_FD_80_A8_C9_9C_D2_39_41_2E_15_29_2C_EC_BD_A0_76_55_4D_1A_19_3D_18_00_39_7C_0A_21_51_6E_5D_51_00_EC_35_68_49_15_45_B2_D9_0D_60_B8_A1_BF_B2_F9_A1_1E_D5_D9_EC_2C_3D_80_B6_A5_1D_AA_C9_6D_B8_80_D9_6C_3A_31_9D_DE_DD_B1_18_C3_85_F8_9A_E5_65_F2_79_5D_B0_88_89_EC_B2_99_E1_AE_85_A9_AC_7C_5D_00_96_75_ED_BA_89_9D_B8_20_D9_7C_4A_21_91_EE_3D_F1_DC_8C_D5_88_C6_B
#!/usr/bin/env python
"Copies/moves files from the list into the separate folder, CC-BY: hasherezade"
__VERSION__ = "0.1"
import sys
import os
import re
import argparse
@hasherezade
hasherezade / chinad.py
Last active July 5, 2017 02:51
script used to discover C&C's of Chinad botnet
#!/usr/bin/env python
"""script used to discover C&C's of Chinad botnet
(more: https://blog.malwarebytes.org/intelligence/2015/06/unusual-exploit-kit-targets-chinese-users-part-2/)
"""
import sys
import argparse
import urllib2
url_bgn = "http://"
@hasherezade
hasherezade / search_lib.py
Last active May 28, 2020 20:28
Search library in PE file
import pefile
import os
def list_files(dir, ext):
file_list = []
for root, dirs, files in os.walk(dir):
for file in files:
if file.endswith(ext):
path = os.path.join(root, file)
file_list.append(path)
@hasherezade
hasherezade / cnc_gen.py
Last active June 2, 2016 07:38
Script for finding XOR value used to calculate Bunitu CnC's IP
#!/usr/bin/env python2.7
"Script for finding XOR value used to calculate CnC's IP (for Bunitu)"
__AUTHOR__ = 'hasherezade'
__VERSION__ = '0.1'
import sys
import time
import struct
import socket
@hasherezade
hasherezade / dyreza_decoder.py
Last active June 2, 2016 07:38
Dyreza resources decoders (as input use dumped resource files)
#!/usr/bin/python
"Decodes dyreza resources from the original Exe"
__AUTHOR__ = 'hasherezade'
import argparse
def decode(data, key_data):
decoded = bytearray()
i = 0
for i in range(0, len(data)):
@hasherezade
hasherezade / xor_decoder.py
Created November 30, 2015 12:37
XOR decoder
#!/usr/bin/python
import sys, argparse
import re
def get_bytes(buf):
if not buf:
return None
t = re.findall ('[0-9a-fA-F]{2}', buf)
byte_buf = []