Skip to content

Instantly share code, notes, and snippets.

View timb-machine's full-sized avatar

Tim Brown timb-machine

View GitHub Profile
#!/usr/bin/perl
# largely purloined from http://www.perlmonks.org/?node_id=1093916 as my PoC for the old options overflow proved too messy^wPerlish to rework - [machine]
use strict;
use IO::Socket;
use Net::DHCP::Packet;
use Net::DHCP::Constants;
my $serveripaddress = "10.10.10.1";
@timb-machine
timb-machine / grace.sh
Last active August 30, 2025 16:59
grace.sh
#!/bin/sh
BINFILENAME="${1}"
tempfilename="`tempfile`"
echo "set pagination off" > "${tempfilename}"
# | grep ":$" | grep -v "\." | cut -f 2 -d "<" | cut -f 1 -d ">" | cut -f 1 -d "@"
# | grep "@plt" | cut -f 2 -d "&lt;" | cut -f 1 -d "@"
objdump -D "${BINFILENAME}" | grep ":$" | grep -v "\." | cut -f 2 -d "<" | cut -f 1 -d ">" | cut -f 1 -d "@" | sort | uniq | while read line^M
do
@timb-machine
timb-machine / sorun.c
Created September 4, 2017 03:24
sorun.c
#include <dlfcn.h>
#include <stdio.h>
int main(int argc, char **argv) {
void *libraryhandle;
int (*functionpointer)(void *, void *, void *, void *, void *, void *, void *, void *, void *);
int functionresult;
libraryhandle = dlopen(argv[1], RTLD_NOW);
functionpointer = dlsym(libraryhandle, argv[2]);
functionresult = functionpointer(argv[3] ? argv[3] : NULL, argv[4] ? argv[4] : NULL, argv[5] ? argv[5] : NULL, argv[6] ? argv[6] : NULL, argv[7] ? argv[7] : NULL, argv[8] ? argv[8] : NULL, argv[9] ? argv[9] : NULL, argv[10] ? argv[10] : NULL, argv[11] ? argv[11] : NULL);
@timb-machine
timb-machine / get-sigs.ps1
Created September 4, 2017 02:47
get-sigs.ps1
function Get-Sigs($directorypath = $pwd, [string[]]$patternstring = "*.exe") {
foreach ($fileitem in Get-ChildItem $directorypath)) {
if ($patternstring | Where { $fileitem -Like $_ }) {
Get-AuthenticodeSignature $fileitem.FullName
}
if (Test-Path $fileitem.FullName -PathType Container) {
Get-Sigs $fileitem.FullName $patternstring
}
}
}