Skip to content

Instantly share code, notes, and snippets.

@volpino
Created November 21, 2014 16:06
Show Gist options
  • Save volpino/9fd435a9f0d044cc122f to your computer and use it in GitHub Desktop.
Save volpino/9fd435a9f0d044cc122f to your computer and use it in GitHub Desktop.
Shoutr tools
# Part of SPMS project at UTwente
# Generator of all possible WPA passphrases used by Shoutr
for i in range(10000):
print "%04d%04d" % (i, i)
import time
import struct
def calc_checksum(ssid):
ssid = list(ssid)
ssid[22] = chr(123)
result = 15
for char in ssid:
result ^= ord(char)
ssid[22] = chr(result)
return "".join(ssid)
def generate_shoutid():
# username padded with spaces
username = "FAKE_USER"
result = username + " " * (16 - len(username))
# timestamp
result += struct.pack(">I", int(time.time()))
# content type - e.g.: 0x0008 is public text message
result += "\x00\x08"
# checksum, we still don't know the value so just put a placeholder
result += "\x00"
# type of shout - e.g.: 0x00 is file transfer
result += "\x00"
# calculate checksum
result = calc_checksum(result)
return result.encode('base64').strip()
if __name__ == "__main__":
print "SSID: {}".format(generate_shoutid())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment