Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇸
1635 E58A 7EFB EC41 0C0F 6FCF 14C1 182B C579 36B2

Bryan Black reelsense

🇺🇸
1635 E58A 7EFB EC41 0C0F 6FCF 14C1 182B C579 36B2
View GitHub Profile
View help-network_anal.md

Network Analysis

Log Searching

cat example.log | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | sort | uniq -c | sort

Monitoring

View help-bookmark_js.md

Bookmark Javascript

Archiving shortcuts

archive.org

javascript:void(open('https://web.archive.org/save/'+encodeURI(document.location)))
View help-cron.md

Cron

At 09:00 on Monday in every month.

0 9 * */1 1 /usr/sbin/service mumble-server restart

At 09:00 on Monday.

0 9 * * 1 /usr/sbin/service mumble-server restart
@reelsense
reelsense / fstab
Created Nov 8, 2019
mergefs fstab example
View fstab
/mnt/disk*:/mnt/tank/fuse /mnt/storage fuse.mergerfs defaults,allow_other,direct_io,use_ino,hard_remove,minfreespace=250G,fsname=mergerfs 0
View help-data_processing.md

Data Processing

Run command against each line in a file

while read in; do COMMAND "$in"; done < FILE

Run command in parallel once per line in a file

@reelsense
reelsense / help-unfuck-virtualbox-freebsd-11-2-not-booting.md
Last active Oct 13, 2019
How to fix FreeBSD 11.2-RELEASE not booting because of error "Fatal trap 12: page fault while in kernel mode"
View help-unfuck-virtualbox-freebsd-11-2-not-booting.md

How to fix FreeBSD 11.2-RELEASE not booting because of Virtual Box driver.

I entcountered a bug with virtualbox-ose-nox11-5.2.14_1 & virtualbox-ose-kmod after upgrading to FreeBSD 11.2-RELEASE on first reboot.

The system would enter a boot loop with this crash error:

supdrvGipCreate: failed to allocate the GIP page
@reelsense
reelsense / brute_upnproxy.sh
Created May 29, 2018
The best way to identify if a device is vulnerable or actively being leveraged for UPnProxying is to scan the endpoint and audit your NAT table entries.
View brute_upnproxy.sh
#!/bin/bash
url=$1
soap_head='<?xml version="1.0" encoding="utf-8"?><s:Envelopes:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:GetGenericPortMappingEntry xmlns:u="urn:upnporg:serviceId:WANIPConnection.1#GetGenericPortMappingEntry"><NewPortMappingIndex>'soap_tail='</NewPortMappingIndex></u:GetGenericPortMappingEntry></s:Body></s:Envelope>'
for i in `seq 1 1000`; do
payload=$soap_head$i$soap_tail
curl -H 'Content-Type: "text/xml;charset=UTF-8"' -H 'SOAPACTION: "urn:schemasupnp-org:service:WANIPConnection:1#GetGenericPortMappingEntry"'--data "$payload"
"$url"
echo ""
done
@reelsense
reelsense / help-ssh-tips.md
Last active Jul 17, 2019
Helpful SSH tips
View help-ssh-tips.md

Helpful SSH tips

Executing a single command:

ssh USER@HOST ls

sudo requires interactive shell, it can be enabled with -t parameter:

ssh -t USER@HOST sudo ls /root
View help-gpg-agent.md

Help Desktop Applications usegpg-agent for Yubikey.

How do I use my Yubikey with desktop applications like Sequel Pro or MySQL Workbench?

When you use the GPG Agent (with or without smartcard, the agent takes care of that, so it's not a problem if you don't have one I think) it should ask for the passphrase of your GPG key (or the PIN of the smartcard in my case) and not the SSH password.

But how it works now is that the SSH attempt asks for the SSH password, not the GPG passphrase.

Ok, here is an example: >