Skip to content

Instantly share code, notes, and snippets.

View joswr1ght's full-sized avatar

Joshua Wright joswr1ght

View GitHub Profile
@joswr1ght
joswr1ght / colorpromptnewline.txt
Created October 25, 2015 16:43
Colorful Terminal Prompt with Directory on a Separate Line
PS1="\[\033[01;34m\]\w\[\033[00m\]\n\$ "
@joswr1ght
joswr1ght / urldecode.py
Created January 20, 2016 13:23
URL decode from the command line
#!/usr/bin/env python
import sys, urllib as ul
print ul.unquote_plus(open(sys.argv[1]).read()),
@joswr1ght
joswr1ght / changeImageAspect.vbs
Last active February 22, 2016 18:16
Change Image Aspect - Fix broken image aspect change in PowerPoint after converting from 4:3 to 16:9
Sub changeImageAspect()
Dim oshp As Shape
Dim osld As Slide
' Stupid workaround for no getter for scaleWidth/scaleHeight
Dim sHeightOld As Variant
Dim sWidthOld As Variant
Dim tScaleWidth As Variant
Dim tScaleHeight As Variant
@joswr1ght
joswr1ght / burn.sh
Created February 9, 2016 14:22
OS X Burn DVD
hdiutil burn foo.iso
#!/usr/bin/env python
# rduck-pinbrute: Generate Duckyscript file that brute forces all 4-digit
# PIN values for use in attacking Android devices. Prioritizes common
# PIN values before resorting to exhaustive 0000-9999 search.
# Joshua Wright, [email protected]. Public Domain.
#
# Inspired by Darren Kitchen script:
# https://forums.hak5.org/index.php?/topic/28165-payload-android-brute-force-4-digit-pin/
# Data Genetics high probability list
@joswr1ght
joswr1ght / zunzip.py
Last active January 21, 2019 18:28
Zlib decompress file, producing file.out
#!/usr/bin/env python
import zlib, sys
if len(sys.argv) != 2:
print "Usage: %s <zlib-compressed-file>"%sys.argv[0]
print "Produces decompressed file with \".out\" filename suffix."
sys.exit(0)
indata=open(sys.argv[1], "rb").read()
outdata=zlib.decompress(indata)
@joswr1ght
joswr1ght / labelimg.sh
Created May 12, 2016 20:08
Add EXIF data about camera stuff to a JPG destructively using exiftool and ImageMagick
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "WARNING: Will overwrite source image!"
echo "$0 [images]"
exit
fi
for IMAGE in "$@"; do
LENS=`exiftool -T -lens $1`
@joswr1ght
joswr1ght / getios10beta1filesystem.sh
Last active May 15, 2024 10:24
Get iOS 10 Beta 1 File System (iPhone 6s device)
# Get iOS 10 Beta 1 File System (iPhone 6s device)
wget -q http://apple.co/28R9rhS -O ios10beta1-iphone6s.zip
mkdir ios10beta1
unzip -q ios10beta1-iphone6s.zip -d ios10beta1
cd ios10beta1
# wget this file for OSX systems
wget -q http://newosxbook.com/files/OTApack.tar
# or wget this file for Linux systems
wget -q http://www.willhackforsushi.com/code/OTApack.tar
tar xf OTApack.tar
@joswr1ght
joswr1ght / getios10beta1kernelcache.sh
Created June 23, 2016 10:44
Get iOS 10 Beta 1 Kernelcache for reverse engineering (iPhone 6s hardware)
# Get decrypted kernelcache
# URL for iOS 10 Beta 1 for iPhone 6s taken from http://pastebin.com/FRMfanmT
wget -q http://apple.co/28R9rhS -O ios10beta1-iphone6s.zip
mkdir ios10beta1
unzip -q ios10beta1-iphone6s.zip -d ios10beta1
cd ios10beta1
wget -q http://nah6.com/%7Eitsme/cvs-xdadevtools/iphone/tools/lzssdec.cpp
g++ -o lzssdec lzssdec.cpp
./lzssdec -o 439 < AssetData/boot/kernelcache.release.n71 >kernelcache.decrypted # 439 is offset byte count to 0xFFCFFAEDFE header
xxd kernelcache.decrypted | head -1
@joswr1ght
joswr1ght / diffpriv.swift
Created June 24, 2016 19:03
Demonstrate possible collection of emoji use data with random sampling for differential privacy
import Cocoa; import Foundation
func randomBool() -> Bool {
return arc4random_uniform(2) == 0 ? true: false
}
// A list of all emojis (
let emojis = ["πŸ˜€","😁","πŸ™πŸΎ","🐺","πŸƒ","πŸ›‚","πŸ’Έ","πŸ’°","πŸ’Ž","πŸŒ‚","πŸ‘","πŸ‘›","πŸ‘œ","πŸ†”","πŸŒ€","πŸ”»","πŸ’©"]
// A "collected list" of most used emojis