Skip to content

Instantly share code, notes, and snippets.

@malware-kitten
malware-kitten / bitter_string_decoder.py
Created October 31, 2019 14:03
Decode strings in Ghidra from sample 11864ec73e6226f52a1e6e4074b33e89
from ghidra.program.model.listing import CodeUnit
decrypt_func = 0x004039a0
def decode(offset):
count = 0
res = b''
b = getByte(toAddr(offset))
while b != 0x0:
try:
@malware-kitten
malware-kitten / clsid.py
Created May 13, 2019 18:45
Convert CLSID to Hex
#!/usr/bin/env python
import binascii
import sys
'''
Usage:
python3 clsid.py 85131631-480C-11D2-B1F9-00C04F86C324
311613850c48d211B1F900C04F86C324
'''
#!/usr/bin/env python
# Copyright 2017 Ryan Stortz (@withzombies)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@malware-kitten
malware-kitten / mal_share_2.py
Created June 1, 2016 23:46
@mal_share challenge 2
import r2pipe
import sys
import json
import binascii
r2p = r2pipe.open(sys.argv[1])
r2p.cmd('aaa;aac')
funcs = {}
for func in r2p.cmdj('aflj'):
instructions = r2p.cmd("pdfj @ %s" % func['offset'])
@malware-kitten
malware-kitten / bro_beacons.bro
Last active January 25, 2019 06:07
Finding Beacons with Bro
#Author: Nick Hoffman / securitykitten.github.io / @infoseckitten
#Description: A bro script to find beacons
module BEACON;
@load base/protocols/http
#this is our master collection, we'll use this to store all our information
global master_collection: table[addr,addr] of vector of time &synchronized;
@malware-kitten
malware-kitten / vm_detect
Created November 10, 2014 20:37
A chunk of code found online that will check for evidence of a virtual machine
#include <string>
#include <tlhelp32.h>
#include <TCHAR.H>
#include <dir.h>
using namespace std;
int detected = 0;
DWORD GetModulePath(HINSTANCE hInst,LPTSTR pszBuffer,DWORD dwSize)
@malware-kitten
malware-kitten / cohhoc_decode
Last active August 29, 2015 14:08
Cohhoc Decode
require 'base64'
data = "3d3duIWRvYmVzZXJ2aWNlbi5ldE="
decode = Base64.decode64(data)
decode.each_byte do |b|
#shr dl,6
#shl al,2
#or dl,al
print (((b<<6)%0xff |(b>>2)%0xff)).chr