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 | |
""" | |
requires pyusb, which should be pippable | |
have this run in an udev rule, like | |
SUBSYSTEM=="usb", ATTR{idVendor}=="4348", ATTR{idProduct}=="55e0", MODE="666", RUN+="/bin/sh -c '/path/to/this/script/revive_ch59x.py' >> /tmp/ch59x" | |
and update the rules with | |
$ sudo udevadm control --reload-rules && sudo udevadm trigger | |
Then see the output with | |
$ tail -f /tmp/ch59x |
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
syntax = "proto2"; | |
message InnerMessage { | |
optional bytes message = 1; | |
optional uint32 counter = 2; | |
optional bytes ktGossipData = 3; | |
optional bytes debugInfo = 99; | |
} | |
message OuterMessage { |
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 | |
import apple_auth | |
from io import BytesIO | |
vd = BytesIO(bytes(apple_auth.IDS(open('idevice.json').read()).request_validation_data())) # create json with Smoothstep/apple-gen-rs | |
tag = vd.read(1) # always 0x02, maybe like the APNS msg for cert? | |
stat16b = vd.read(16) # static across machines, some versioning? | |
dyn16b = vd.read(16) # the actual signature from the obfuscated algorithm | |
len_payload = vd.read(4) | |
payload = BytesIO(vd.read(int.from_bytes(len_payload,"big"))) |
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
import time | |
import bluetooth | |
from micropython import const | |
_IRQ_SCAN_RESULT = const(5) | |
_IRQ_SCAN_DONE = const(6) | |
def bt_irq(event, data): | |
if event == _IRQ_SCAN_RESULT: | |
# A single scan result. | |
addr_type, addr, connectable, rssi, adv_data = data |
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
# MIT License | |
# | |
# Copyright (C) 2014 Jesper Borgstrup | |
# ------------------------------------------------------------------- | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sublicense, and/or sell copies of the Software, | |
# and to permit persons to whom the Software is furnished to do so, |
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
import objc | |
from ctypes import c_char | |
from Foundation import NSBundle | |
Security = NSBundle.bundleWithIdentifier_('com.apple.security') | |
S_functions = [ | |
('SecKeychainGetTypeID', 'I'), | |
('SecKeychainItemGetTypeID', 'I'), | |
('SecKeychainAddGenericPassword', 'i^{OpaqueSecKeychainRef=}I*I*I*o^^{OpaqueSecKeychainItemRef}'), | |
('SecKeychainOpen', 'i*o^^{OpaqueSecKeychainRef}'), |
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 python3 | |
''' | |
bling.py - extract keys from macOS keychains. | |
installation: | |
pip install pytz hexdump vivisect-vstruct-wb tabulate argparse pycryptodome | |
usage: | |
python bling.py /path/to/keychain-db <password> ./path/to/output/directory |
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/python | |
import objc | |
from Foundation import NSBundle, NSClassFromString | |
SeedingBundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/Seeding.framework') | |
objc.loadBundleFunctions(SeedingBundle, globals(), [("currentBuildIsSeed", '@')]) | |
buildInfo = NSClassFromString('SDBuildInfo') |
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
# This was all run from user space | |
# I haven't tested it with root | |
# ... but it didn't prompt for any permissions under userspace ^_^ | |
# Tested on 10.11.5 | |
import objc | |
from Foundation import NSBundle | |
EAP8021X_bundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/EAP8021X.framework') | |
Security_bundle = NSBundle.bundleWithIdentifier_('com.apple.security') |
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
pragma solidity >=0.6.2; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/EnumerableSet.sol"; | |
import "@openzeppelin/contracts/utils/Address.sol"; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
import "./RandomNumberGenerator.sol"; | |
contract Lottery is Ownable{ |
NewerOlder