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 / README.md
Created December 27, 2022 21:22
The Fundamentals of Sharing for Malware Analyst

Originally created on 2016-11-06

The Fundamentals of Sharing for Malware Analyst

In most organizations malware analysts are tasked to produce a deliverable derived from static or dynamic analysis. The deliverable could be to extract indicators, understand functionality, write a report or something similar. During this process the analyst will create a number of files and artifacts. These files could be IDBs, memory dumps, yara signature, decoder scripts, pcaps, notes, etc. Once the task has been completed the analyst submits their deliverable and then moves on. In many organizations the files and artifacts are not stored in a way that are accessible to others, which is a shame. Having the data and analysis accessible to others has many positive benefits.

  1. Promotes sharing of processes and knowledge between analyst.
  2. Removes duplication of labor by allowing analyst to build off of previous research and analysis.
  3. Intellectual property and artifacts are not lost when an analyst leaves the organiz
@alexander-hanel
alexander-hanel / notes.md
Created November 16, 2022 17:32
Program Analysis Topics And References

Program Analysis

Status: in progress

Logic

  • Intro to Formal Logic — Peter smith
  • Intermediate Logic - David Bostock
  • Natural Logic — Neil Tennant
  • A mathematical intro to logic — Herber Enderton
  • Logic and Structure — Dirk van Dalen
@alexander-hanel
alexander-hanel / bn-cheat.md
Last active May 1, 2024 15:10
Cheat Sheet for Binary Ninja
@alexander-hanel
alexander-hanel / go_source_code_comments.py
Created August 10, 2022 15:40
Extract Go source code function comments and add them to an IDB
import idautils
import subprocess
import os
import re
import json
import sys
GOBIN = r"C:\Program Files\Go"
@alexander-hanel
alexander-hanel / go_comment.py
Created August 9, 2022 21:51
Add Function Comments to Exportable Functions in Go
import idautils
import subprocess
import os
GOBIN = r"C:\Program Files\Go\bin"
def extract_name(func_name):
sp = func_name.split(".")
# if the start of a function is not upper case it is not exportable
@alexander-hanel
alexander-hanel / README.md
Last active September 29, 2023 03:31
IL - Overview

Stages

image

Source

1. Machine Code

  • disassemble (x86, ARM, MIPS, etc)
  • disassembler (capstone, etc)
@alexander-hanel
alexander-hanel / explore_binary_ninja.py
Last active August 24, 2022 19:15
Explore Binary Ninja's Python API
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
file_name = ""
try:
import binaryninja
logging.debug("BinaryNinja has been imported")

Disassembler (aka Task 1)

Notes on RE1.

  1. Use a language of your choice to decode the base64 encoded data, disassemble the binary data using the capstone engine and save the text to a file named disassemble.txt
import idautils
import string
DEBUG = True
if DEBUG:
import hexdump
SEGMENT = True
def get_to_xrefs(ea):
@alexander-hanel
alexander-hanel / jvm_hook.py
Created April 25, 2022 21:04
logs exported APIs in JVM
# Created By: Alexander Hanel
# Date: 20220425
# Version 2.0
# Purpose: Simple API logger for a subset of API's used by Java's JVM
# C:\tt\pypyp>C:\Python37\python.exe jvm_logger.py -file "C:\Progra~1\Java\jdk1.8.0_191\bin\java.exe" -args " -jar C:\tt\pypyp\victim-app-0.0.1-SNAPSHOT.jar"
import sys
import _ptrace
import argparse