Skip to content

Instantly share code, notes, and snippets.

@ritcheyer
Forked from eob/dash-listen-3.py
Created August 21, 2015 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritcheyer/17d7f1ab4a466eb5a04a to your computer and use it in GitHub Desktop.
Save ritcheyer/17d7f1ab4a466eb5a04a to your computer and use it in GitHub Desktop.
for hacking an Amazon Dash to record poops and stuff
from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
requests.post(MAGIC_FORM_URL, data)
def record_wake():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Woke from Sleep'
}
requests.post(MAGIC_FORM_URL, data)
def arp_display(pkt):
timestamp = time.strftime("%Y-%m-%d %H:%M")
if pkt[ARP].op == 1: #who-has (request)
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe
if pkt[ARP].hwsrc == '74:75:48:5f:99:30': # Huggies
print "Pushed Huggies"
record_poop()
elif pkt[ARP].hwsrc == '10:ae:60:00:4d:f3': # Elements
print "Pushed Elements"
record_wake()
else:
print "ARP Probe from unknown device: " + pkt[ARP].hwsrc
print sniff(prn=arp_display, filter="arp", store=0, count=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment