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 / 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))
__author__ = 'Alexander Hanel'
__date__ = '2018/02/28'
__version__ = "2.0"
__title__ = "struct creator"
import re
"""
Example:
@alexander-hanel
alexander-hanel / CRC.asm
Created April 28, 2018 23:42
CRC w/ comments
; English forum: http://purebasic.myforums.net/viewtopic.php?t=8957&highlight=
; Author: Wayne Diamond
; Date: 01. January 2004
; CRC32 - A relatively fast algorithm that creates a 32-bit checksum.
; CRC32 is the most commonly-used 32-bit checksum algorithm.
Procedure.l CRC32(Buffer.l, BufLen.l)
Result.l = 0
@alexander-hanel
alexander-hanel / commpile.sh
Created July 4, 2018 02:01
compile asm using nasm and execute it
#!/bin/bash
INPUT=$1
name=${INPUT%.*}
ncmd=$(printf "nasm -f elf64 %s" "$INPUT")
eval $ncmd
ll=$(printf "ld %s.o -o %s" "$name" "$name")
eval $ll
tt=$(printf "chmod +x %s" "$name")
xx=$(printf "./%s" "$name")
eval $xx
@alexander-hanel
alexander-hanel / decoder.py
Created October 11, 2018 19:19
p0wnedShell(??) shellcode extractor
import base64
import sys
import re
import gzip
import StringIO
import hexdump as h
from capstone import *
# old code from https://bitbucket.org/snippets/Alexander_Hanel/onboA/p0wnedshell-shellcode-extractor
@alexander-hanel
alexander-hanel / gui.md
Created November 13, 2018 02:52
GUI Code Sucks
from PyQt5 import QtWidgets, QtGui

class ListViewDemoDialog(QtWidgets.QDialog):
    def __init__(self):
        super(ListViewDemoDialog, self).__init__()
       
        # create a layout to place controllers (called widgets) on
        layout = QtWidgets.QVBoxLayout()
@alexander-hanel
alexander-hanel / pefile_examples.py
Created December 26, 2018 23:40
pefile common usage examples
import pefile
import sys
import datetime
import zlib
"""
Author: Alexander Hanel
Summary: Most common pefile usage examples
Date: 20181226
"""