Skip to content

Instantly share code, notes, and snippets.

@janstarke
janstarke / procmon_to_neo4j.cql
Last active January 22, 2017 16:52
neo4j: importing processes from procmon csv
# delete all
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r;
# create process index
CREATE INDEX on :Process(pid);
CREATE INDEX on :File(path);
CREATE INDEX on :RegistryValue(path);
@janstarke
janstarke / elasticsearch.sh
Last active October 5, 2020 10:18
provisioning files for vagrant
#!/bin/bash
MYIP=$1
function configure() {
sed -i "s~#*$2:.*~$2: $3~" $1
}
CFG=/etc/elasticsearch/elasticsearch.yml
export DEBIAN_FRONTEND=noninteractive
apt install --yes elasticsearch
# convert all evtx files to xml files
for F in *.evtx; do evtx_dump "$F">"${F%.evtx}.xml"; done
# create python env
python3 -m venv venv
source venv/bin/activate.fish
pip3 install --upgrade pip
pip3 install regipy
@janstarke
janstarke / gist:d9a892875094b0daf6534fbad1f27ddf
Last active January 3, 2022 08:39
Convert regripper timeline to bodyfile
| grep '^[0-9][0-9]*|' |awk -F '|' '{OFS="|";print 0,$5,0,0,0,0,0,-1,$1,-1,-1} {}'
@janstarke
janstarke / windows_timelines.sh
Last active June 13, 2022 11:49
create triage data from mounted Windows image
#!/bin/bash
trap "exit 1" TERM
export TOP_PID=$$
RIP=/usr/local/bin/rip
function tln2csv {
egrep '^[0-9]+\|' | awk -F '|' '{OFS="|";print 0,$5,0,0,0,0,0,-1,$1,-1,-1}' |mactime2 -b - -d -t "$TIMEZONE"
}
@janstarke
janstarke / mounteddevices.pl
Created April 25, 2022 11:44
Correlate mounteddevices and mountpoints2
#!/usr/bin/perl -w
use strict;
use warnings;
use DateTime;
-r "mounted_devices.txt" or die "unable to read 'mounted_devices.txt'";
my %devices = ();
@janstarke
janstarke / evtx_timeline.json
Created May 30, 2022 14:53
lnav format for evtx timelines, created with ` evtx2bodyfile`, `mactime2` and ` jq`
{
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
"evtx_timeline": {
"title": "Windows EVTX timeline",
"file-pattern": "evtx.*\\.json(\\.gz)?",
"json": true,
"line-format": [
{"field": "ts"},
"|",
{"field": "event_id", "min-width": 5, "max-width": 5, "align": "right"},
@janstarke
janstarke / mount_vmdk.sh
Created April 20, 2023 11:59
Mount vmdk files
#!/bin/bash
display_usage() {
echo "$0 <dir with vmdk files>" >&2
}
exit_with_error() {
MSG="$1"
echo "$MSG" >&2
exit 1