Skip to content

Instantly share code, notes, and snippets.

@hasherezade
hasherezade / wchar_to_char.py
Last active June 2, 2016 07:35
Converts wide string to string
#!/usr/bin/python
# CC-BY: hasherezade
"""Convert wchar string to char string"""
import argparse
def convert(data):
maxlen = len(data)
decoded = bytearray()
i = 0
@hasherezade
hasherezade / config.json
Created May 24, 2016 16:50
Cerber config
{
"blacklist": {
"countries": [
"am",
"az",
"by",
"ge",
"kg",
"kz",
"md",
@hasherezade
hasherezade / find_r5a_key.py
Created May 31, 2016 23:57
Decoder for 7even-HONE$T ransomware - variant: 08a53eb5d54c6829cf6ea29bd61ea161
#!/usr/bin/python
# CC-BY: hasherezade
"""Finds R5A key for 7even-HONE$T ransomware - variant: 08a53eb5d54c6829cf6ea29bd61ea161"""
import argparse
import os
PREFIX = 'M'
SUFFIX = '*'
.n64
.m4u
.m3u
.mid
.wma
.flv
.3g2
.mkv
.3gp
.mp4
@hasherezade
hasherezade / msil_dec.py
Last active July 11, 2020 13:06
Helper script for decoding some .NET cryptor
#!/usr/bin/python2.7
import argparse
def decode(data, key, offset, extra_rounds):
maxlen = len(data)
keylen = len(key)
j = 0 #key index
num2 = (maxlen - 1) * (extra_rounds + 1)
decoded = bytearray()
@hasherezade
hasherezade / file_rev.cpp
Created August 2, 2016 18:23
Reverse file content
#include <stdio.h>
size_t filesize(FILE *f)
{
fseek(f, 0, SEEK_END);
size_t size = ftell(f);
fseek(f, 0, SEEK_SET);
return size;
}
@hasherezade
hasherezade / peb_lookup.h
Last active May 24, 2025 01:07
Search module in PEB
#pragma once
#include <Windows.h>
//here we don't want to use any functions imported form extenal modules
typedef struct _LDR_MODULE {
LIST_ENTRY InLoadOrderModuleList;// +0x00
LIST_ENTRY InMemoryOrderModuleList;// +0x08
LIST_ENTRY InInitializationOrderModuleList;// +0x10
void* BaseAddress; // +0x18
@hasherezade
hasherezade / exports_lookup.h
Last active August 25, 2016 18:02
Search function in exports
#pragma once
#include <Windows.h>
//WARNIG: we don't want to use any imported functions in here!
#include "pe_hdrs_helper.h"
/*
typedef struct _IMAGE_EXPORT_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
#!/usr/bin/python
# CC-BY: hasherezade
"""Decoder for 7even-HONE$T ransomware"""
import argparse
import os
PREFIX = 'M'
SUFFIX = '*'
@hasherezade
hasherezade / trick_bot.txt
Created October 14, 2016 15:46
strings from the sample: f24384228fb49f9271762253b0733123
Text strings referenced in payload_:.text
Address Text string
004012EE UNICODE "TrickBot"
0040131C UNICODE "Bot"
004013D2 UNICODE "Bot"
00401432 UNICODE "PT0S"
004014F8 UNICODE "Author Name"
00401559 UNICODE "Trigger1"
00401590 (Initial CPU selection)
004015F3 UNICODE "P1D"