Some of it related to embedded analysis, some of it not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# sudo call integrity check: only root should be able to change script | |
l=($(ls -l `readlink -f $0`)) | |
[ ${l[0]:2:1} != "-" ] && [ "${l[2]}" != "root" ] || | |
[ ${l[0]:5:1} != "-" ] && [ "${l[3]}" != "root" ] || | |
[ ${l[0]:8:1} != "-" ] && { echo -e "only root should be able to modify\n${l[@]}"; exit 1;} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# As this script may be called from sudo, suggest safe use: | |
l=($(ls -l $0)) | |
[ ${l[0]:2:1} != "-" ] && [ "${l[2]}" != "root" ] || | |
[ ${l[0]:5:1} != "-" ] && [ "${l[3]}" != "root" ] || | |
[ ${l[0]:8:1} != "-" ] || [ -L $0 ] || [ -L ${0%/*} ] && | |
{ echo -e "no symlinks and only root should be able to modify.\n${l[@]}"; exit 1;} |
This homebrewed notation I typically use when evaluating secure boot designs of embedded devices. It doesn't apply accurately for the iOS review, hides the key-wrapping schema for example. But it's enough to keep track of storage location of secrets and some interdependency.
pfk = 256bit per_file_key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# As this script may be called from sudo, suggest safe use: | |
l=($(ls -l $0)) | |
[ ${l[0]:2:1} != "-" ] && [ "${l[2]}" != "root" ] || | |
[ ${l[0]:5:1} != "-" ] && [ "${l[3]}" != "root" ] || | |
[ ${l[0]:8:1} != "-" ] || [ -L $0 ] || [ -L ${0%/*} ] && | |
{ echo -e "no symlinks and only root should be able to modify.\n${l[@]}"; exit 1;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download latest OTR and Pidgin and run vanilla configure & compile | |
# you'll have to run make install manually when completed. | |
# If you get errors on OSX you may find help at: | |
# https://gist.github.com/cyphunk/5048773 | |
INSTALLPREFIX=/usr/local | |
SH_SOURCE=${BASH_SOURCE:-$_} | |
if readlink "$SH_SOURCE" >/dev/null 2>&1; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e #exit on any error | |
if [ $# -lt 1 ]; then | |
echo "$0 file [file ...]" | |
exit | |
fi | |
FILE1=$(basename "$(readlink -f "$1")") | |
NAME="${FILE1%.*}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# check url for a text and send alert via nexmo.com sms api | |
# | |
# example, checking for machina ex tickets: | |
# | |
# while [ 1 ]; do | |
# ./checkurlthensms.py \ | |
# http://www.hebbel-am-ufer.de/programm/spielplan/machina-ex-lessons-of-leaking/2354/ \ | |
# ticketLink "Tickets available" \ | |
# <nexmo_apikey> <nexmo_apisecret> \ |
Reverse engineering a device can be assisted by tracing lines that are exposed on the PCB. For complex tracing I have used depcb and for more simple tracing I use gimp. First the images of the PCB layers should be aligned with each other.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#otr: curl https://otr.cypherpunks.ca/gpgkey.asc | gpg --import | |
#pidgin: gpg --keyserver pgp.mit.edu --recv-key 0xA40AB77B | |
INSTALLPREFIX=/usr/local | |
SH_SOURCE=${BASH_SOURCE:-$_} | |
if readlink "$SH_SOURCE" >/dev/null 2>&1; then | |
cd "$(dirname $(readlink $SH_SOURCE))" | |
else | |
cd "$(dirname $SH_SOURCE)" |