135 lines
4.9 KiB
Bash
135 lines
4.9 KiB
Bash
#!/bin/zsh
|
|
set -Eeuo pipefail
|
|
|
|
ASN1_PREFIX=$'\x30\x4E\x30\x4C\xA0\x03\x02\x01\x00\x30\x45\x30\x43\x30\x41\x30\x09\x06\x05\x2B\x0E\x03\x02\x1A\x05\x00\x04\x14\x33\x81\xD1\xEF\xDB\x68\xB0\x85\x21\x4D\x2E\xEF\xAF\x8C\x4A\x69\x64\x3C\x2A\x6C\x04\x14\x57\x17\xED\xA2\xCF\xDC\x7C\x98\xA1\x10\xE0\xFC\xBE\x87\x2D\x2C\xF2\xE3\x17\x54\x02\x08'
|
|
URL_HOST='http://ocsp.apple.com'
|
|
URL_RESPONDER='ocsp04-devid01' # or ocsp-devid01
|
|
LEGITIMATE_SERIALS=(
|
|
$'\x00\x83\xD3\x24\xD4\xED\x43\xA2'
|
|
$'\x01\x74\x51\x7F\x11\xF6\xB6\x60'
|
|
$'\x02\xAD\x87\x78\x5C\xC9\x4D\x1C'
|
|
$'\x03\xF4\x3B\xA1\x7F\x73\x96\x0F'
|
|
$'\x04\x92\x63\xF5\x74\x32\xD1\xE5'
|
|
$'\x04\xB6\xC2\xDC\x29\xEF\xE3\xBD'
|
|
$'\x04\xCA\x81\xF7\x7D\x5E\x33\xF7'
|
|
$'\x06\xA7\x65\xE8\xB7\x0A\x87\xE0'
|
|
$'\x06\xC7\x94\x21\x6C\x7A\xA9\x30'
|
|
$'\x09\x71\xF0\x38\x88\x29\xE7\x94'
|
|
$'\x0A\x2E\x04\x85\x3E\x95\x32\x7C'
|
|
$'\x0A\x45\x89\xDC\xB1\x67\x0E\xAE'
|
|
$'\x0B\x4A\x9A\xB6\xDD\xCD\xB7\xB2'
|
|
$'\x0C\xAB\x1E\x0B\xDE\x31\xC9\x29'
|
|
$'\x0D\x5D\xD6\xCB\xD0\x96\x49\xCA'
|
|
$'\x11\x48\xDF\xC7\x64\xDB\x01\x5D'
|
|
$'\x12\x99\x56\x16\x81\x9A\x3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F\xEB\x09\x05'
|
|
)
|
|
|
|
while true; do
|
|
if [ $((RANDOM % 2)) -eq 0 ]; then
|
|
NONEXISTENT_SERIAL=$(dd if=/dev/random count=8 bs=1 2>/dev/null)
|
|
ASN1_SERIAL="$NONEXISTENT_SERIAL"
|
|
else
|
|
DICE=$((RANDOM % ${#LEGITIMATE_SERIALS} + 1))
|
|
ASN1_SERIAL="${LEGITIMATE_SERIALS[$DICE]}"
|
|
fi
|
|
echo -n "$ASN1_SERIAL" | xxd -p
|
|
|
|
ASN1_BASE64=$(echo -n "$ASN1_PREFIX$ASN1_SERIAL" | base64)
|
|
URL_ASN1=$(sed -e 's/+/%2B/g' -e 's/\//%2F/g' -e 's/=/%3D/g' <<< "$ASN1_BASE64")
|
|
curl -s "$URL_HOST/$URL_RESPONDER/$URL_ASN1" \
|
|
-H 'Accept: */*' \
|
|
-H 'Accept-Language: en-us' \
|
|
-H 'Connection: keep-alive' \
|
|
-H 'Accept-Encoding: gzip, deflate' \
|
|
-H 'User-Agent: com.apple.trustd/2.0' \
|
|
-o /dev/null
|
|
|
|
TIMER=$((RANDOM % 300))
|
|
echo "Sleeping ${TIMER}s..."
|
|
sleep "$TIMER"
|
|
done
|