Skip to content

Instantly share code, notes, and snippets.

View alexander-hanel's full-sized avatar
😶

Alexander Hanel alexander-hanel

😶
View GitHub Profile
@alexander-hanel
alexander-hanel / seclznt1.py
Created November 16, 2017 23:23
extract pe sections and attempts to decompress them with lznt1
# extract PE sections using pefile by name and decompress them using lznt1 via Rekall
# author: alexander hanel
# Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@alexander-hanel
alexander-hanel / nuclear_bot_decoder.py
Created November 20, 2017 15:52
IDAPython string decrytor for variants of Nuclear Bot
import idautils
from cStringIO import StringIO
from collections import Counter
from itertools import cycle
from itertools import product
MAX_INSTR = 8
"""
Example
@alexander-hanel
alexander-hanel / yolo.py
Last active January 17, 2020 03:40
old and new names in idc.py (in progress)
import re
import sys
import os
def load_apis():
new_old_apis = [
# start of changes for idc.py
("hasValue", "has_value"),
("byteValue", "byte_value"),
("isLoaded", "is_loaded"),
@alexander-hanel
alexander-hanel / hex2ip.py
Last active January 5, 2018 00:16
hex to ip
import socket
import struct
def ipconver(addr_long):
return socket.inet_ntoa(struct.pack("<L", addr_long))
@alexander-hanel
alexander-hanel / enum_add.py
Last active December 7, 2022 00:27
idapython add enum example
id = add_enum(-1, "neutrino_cmds", idaapi.decflag())
idc.add_enum_member(id, "CMD_LOADER", 0X69CDCD5D, -1)
idc.add_enum_member(id, "CMD_CMD", 0x796cd5b4, -1)
idc.add_enum_member(id, "CMD_RATE", 0xae839a18, -1
@alexander-hanel
alexander-hanel / blobheader_parser.py
Last active October 29, 2023 22:45
parse PUBLICKEYSTRUCT and RSAPUBKEY
import struct
import sys
class BLOBHEADER:
def __init__(self, data):
self.bType = None # BYTE
self.bVersion = None # BYTE
self.reserved = None # WORD
self.aiKeyAlg = None # ALG_ID
self._parse_data(data)
@alexander-hanel
alexander-hanel / x64dbgp.md
Created February 23, 2018 02:32
x64dbgpy Notes
import x64dbgpy 
from x64dbgpy.pluginsdk import *

# clear breakpoints 
x64dbg.DbgCmdExecDirect("bc")
x64dbg.DbgCmdExecDirect("bphwc")
# break at entry point 
x64dbg.SetBreakpoint(x64dbg.GetMainModuleEntry())
__author__ = 'Alexander Hanel'
__date__ = '2018/02/28'
__version__ = "2.0"
__title__ = "struct creator"
import re
"""
Example:
@alexander-hanel
alexander-hanel / outlook_property_id.json
Created April 9, 2018 21:49
outlook related property ids
{
"000000010040": "PidLidAttendeeCriticalChange",
"00000002001F": "PidLidWhere",
"000000030102": "PidLidGlobalObjectId",
"00000004000B": "PidLidIsSilent",
"00000005000B": "PidLidIsRecurring",
"00000006001F": "PidLidRequiredAttendees",
"00000007001F": "PidLidOptionalAttendees",
"00000008001F": "PidLidResourceAttendees",
"00000009000B": "PidLidDelegateMail",