Skip to content

Instantly share code, notes, and snippets.

View shellcromancer's full-sized avatar
💻
Hacking

Daniel Stinson-Diess shellcromancer

💻
Hacking
View GitHub Profile
@shellcromancer
shellcromancer / vul_list.c
Created October 10, 2018 18:43
Vulnerable Linked List Program
#include <sys/mman.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
int backdoor = 0;
struct node {
@shellcromancer
shellcromancer / vul_UAF.c
Created October 10, 2018 18:46
Vulnerable Use-After-Free Sample
#include <sys/mman.h>
#include <unistd.h>
#include <sys/types.h>
typedef struct {
int data;
void (*fp)(int);
} obj1;
typedef struct {

Keybase proof

I hereby claim:

  • I am shellcromancer on github.
  • I am shellcromancer (https://keybase.io/shellcromancer) on keybase.
  • I have a public key ASAd-lIOgtX3Pl3J20Y6R1D6kB1nFpxnYxBWfW4bXqK5pQo

To claim this, I am signing this object:

@shellcromancer
shellcromancer / alg_salsa20.yara
Created January 2, 2022 21:22
Identify code for the Salsa20 cryptographic algorithm.
rule alg_salsa20 {
meta:
desc = "Identify code for the Salsa20 cryptographic algorithm."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
last_modified = "2022-01-02"
reference = "https://www.goggleheadedhacker.com/blog/post/reversing-crypto-functions"
strings:
$const16 = "expand 16-byte k" ascii
$const32 = "expand 32-byte k" ascii
@shellcromancer
shellcromancer / .bashrc
Last active January 5, 2022 12:12
Find function definitions from YARA matches
#!/bin/bash
matched_yara_fn() {
match_w_rz_cmds=$(yara -s "$1" "$2" | awk -F ':' '/1/ {printf "%s,aac; afi. @ $(?P %s)\n", $2, $1}');
IFS=$'\n'; while IFS= read -r line; do
oIFS=$IFS
IFS=',' read -r match rzcmd <<< "${line}"
echo "$(rizin -qc "$rzcmd" "$2") contains match for $match";
rule alg_crypto_aes {
meta:
descrption = "Identify code/constants for the AES cryptographic algorithm."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
date = "2022-01-03"
reference = "https://www.goggleheadedhacker.com/blog/post/reversing-crypto-functions-aes"
strings:
// T-Table value
$c1 = { a5 63 63 c6 }
@shellcromancer
shellcromancer / alg_crypto_crc32.yara
Created January 7, 2022 03:25
Identify constants in the CRC32 cryptographic algorithm.
rule alg_crypto_crc32 {
meta:
descrption = "Identify constants in the CRC32 cryptographic algorithm."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
creation_date = "2022-01-06"
reference = "https://en.wikipedia.org/wiki/Cyclic_redundancy_check#CRC-32_algorithm"
reference = "http://www.woodmann.com/fravia/crctut1.htm"
hash = "c4f370622b7c8da5247e78a22e04a7778bd6712dbb84a05e60136b8defca4eed"
location = "0x00401b50"
@shellcromancer
shellcromancer / imov_stackstrings.yara
Created January 8, 2022 03:51
YARA rule to find stack strings via indirect moves.
rule obfus_stackstring_imov {
meta:
descrption = "Identify stack-strings obfuscation via indirect moves."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
date = "2022-01-07"
reference = "https://www.mandiant.com/resources/automatically-extracting-obfuscated-strings"
strings:
$mov_r = { c6 4? ?? 72 } // mov byte [rdi + ?], 0x72 ; 'r'
$mov_s = { c6 4? 0? 73 } // mov byte [rdi + ?], 0x73 ; 's'
@shellcromancer
shellcromancer / macho_space_in_seg_or_sect.yara
Created January 9, 2022 05:05
Identify spaces in either a segment or section name of a Mach-o.
import "macho"
rule macho_space_in_segment_or_section {
meta:
descrption = "Identify spaces in either a segment or section name of a Mach-o."
author = "@shellcromancer <root@shellcromancer.io>"
version = "0.1"
date = "2022-01-08"
condition:
for any segment in macho.segments: (
import "pe"
import "elf"
rule lang_rust {
meta:
desc = "Identify a Rust binary regardless of format (PE, Macho, ELF) or arch."
author = "@shellcromancer"
version = "1.0"
last_modified = "2022.01.09"
strings: