Last active
October 20, 2019 00:10
-
-
Save dustyfresh/28f8b380d41910c51b67870a3e2acc70 to your computer and use it in GitHub Desktop.
script to grab each pwnagotchi unit's fingerprint. You can redirect this output to a list and loop through each fingerprint to broadcast messages to ALL pwnagotchi units OwO
This file contains hidden or 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 | |
''' | |
$ ./pwnagotchi_ids.py | while read fingerprint; do pwngrid -send $fingerprint -message "( ͡° ͜ʖ ͡°)"; done | |
''' | |
import json | |
import requests | |
def main(): | |
blacklist = open('./blacklist.txt', 'r').read().splitlines() | |
page = 0 | |
print('grabbing page count...') | |
units = json.loads(requests.get('https://api.pwnagotchi.ai/api/v1/units').content) | |
print('discovered {} pages and {} units'.format(units['pages'], units['records'])) | |
print('sending message to the first page...') | |
page += 1 | |
while page != int(units['pages']): | |
records = json.loads(requests.get('https://api.pwnagotchi.ai/api/v1/units?p={}'.format(page)).content)['units'] | |
for unit in records: | |
if unit['fingerprint'] not in blacklist: | |
print(unit['fingerprint']) | |
page += 1 | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment