Skip to content

Instantly share code, notes, and snippets.

View timb-machine's full-sized avatar

Tim Brown timb-machine

View GitHub Profile
@timb-machine
timb-machine / encode-in-tree.pl
Last active August 30, 2025 17:01
encode-in-tree.pl
#!/usr/bin/perl
use Cwd;
use MIME::Base64;
$start = getcwd();
$maxnewpath = 1024;
while (sysread(STDIN, $byte, 1) != 0) {
$maxpath = 100;
$string = $byte;
@timb-machine
timb-machine / socky.sh
Created April 5, 2020 12:41
socky.sh
#!/bin/sh
# Not to be confused with https://labs.portcullis.co.uk/tools/unix-socket-scanner/ which does more detailed enumeration but doesn't do permission checks
netstat -an | grep stream | awk '{print $9}' | sort | uniq | egrep -v "vms\/|^$" | while read socketname
do
if [ -n "$(printf "${socketname}" | grep "^/")" ]
then
printf "==\n"
ls -la "${socketname}"
if [ -n "$(ls -la "${socketname}" | grep "s.......w. ")" ]
@timb-machine
timb-machine / CoAP endpoints on Tradfri gateway
Last active March 22, 2020 20:43
CoAP endpoints on Tradfri gateway
15006
[]
15001
[]
15004
[]
15004/add
4.05
15004/remove
4.05
@timb-machine
timb-machine / CoAP endpoints on Tradfri gateway
Last active March 22, 2020 20:43
CoAP endpoints on Tradfri gateway
<//15006>;ct=0;obs,<//15001>;ct=0;obs,<//15004>;ct=0;obs,<//15004/add>;ct=0,<//15004/remove>;ct=0,<//15010>;ct=0;obs,<//15005>;ct=0;obs,<//15011/15012>;ct=0;obs,<//15011/9034>;ct=0,<//15011/9030>;ct=0,<//15011/9031>;ct=0,<//15011/9094>;ct=0;obs,<//15011/9095>;ct=0;obs,<//15011/9104>;ct=0;obs,<//15011/9063>;ct=0
@timb-machine
timb-machine / smali-rename.sh
Last active August 30, 2025 17:01
smali-rename.sh
#!/bin/sh
OLDNAME="${1}"
NEWNAME="${2}"
grep -r "${OLDNAME}" . | cut -f 1 -d : | sort | uniq | while read filename
do
cp "${filename}" "${filename}.old"
cat "${filename}.old" | sed "s/${OLDNAME}/${NEWNAME}/g" > "${filename}"
rm "${filename}.old"
@timb-machine
timb-machine / EMF Camp 2018
Created September 2, 2018 17:02
EMF Camp 2018
4th time we've run the CTF (sometimes as Cisco/Portcullis, this year as Team Alpaca)
106 challenges
Bandwidth usage so far peaked out at 24.4Mbps and disk usage at 19.4MB/s
Time machine challenge resulted in single CPU being pegged at 100%, required reprovisioning (x4 vCPUs) - go Ansible/Docker!
43 teams registered including one person playing over the Internet on their own (currently in 3rd place)
401 right submissions
507 wrong submissions
Jonty was yet again an item in the scavenger hunt category - sorry Jonty :)
We also caused uproar in the HAM community over "parabolic antenna"
We included a badge challenge for the first time
@timb-machine
timb-machine / micro:bit Space Invaders 2
Created August 19, 2018 19:58
micro:bit Space Invaders 2
# https://makecode.microbit.org/31667-75115-87037-56723
let score = 0
let delay = 0
let highscore = 0
let onscreen = 0
let heart: Image = null
let lives = 0
let clearscreen: Image = null
let ship: Image = null
input.onButtonPressed(Button.A, () => {
@timb-machine
timb-machine / micro:bit Space Invaders
Last active August 19, 2018 18:28
micro:bit Space Invaders
# https://makecode.microbit.org/45205-27183-13795-15925
let score = 0
let delay = 0
let highscore = 0
let onscreen = 0
let clearscreeen: Image = null
let ship: Image = null
input.onButtonPressed(Button.A, () => {
if (onscreen == 1) {
game.addScore(1)
Script started on 2017-11-19 18:23:01+0000
Scanning x (x.x.x.x:443). [SNI: None]
Enumerating ciphers...
Testing protocol SSLv2.0...
Testing protocol SSLv3.0...
Testing protocol TLSv1.0...
Testing protocol TLSv1.1...
RSA_WITH_AES_128_CBC_SHA [0x0000002f]
RSA_WITH_AES_256_CBC_SHA [0x00000035]
RSA_WITH_CAMELLIA_128_CBC_SHA [0x00000041]
@timb-machine
timb-machine / Router OS notes
Created November 16, 2017 09:11
Router OS notes
x - RouterOS
Core vs optional
Linux so supports various architecture
2.9 added /nova/etc/devel-login
If this exists, devel/<admin password> gets proper shell
Anatomy++ created createnpk.py and dumpnpk.py for 3.x
3.22 added checksums and signing
supout.rif contains
Configuration
/proc/