Skip to content

Instantly share code, notes, and snippets.

@nicholas-gh
Last active September 4, 2016 07:23
Show Gist options
  • Select an option

  • Save nicholas-gh/8ab178ea98aa42a82589a436efcd281d to your computer and use it in GitHub Desktop.

Select an option

Save nicholas-gh/8ab178ea98aa42a82589a436efcd281d to your computer and use it in GitHub Desktop.
from scapy.all import *
from qhue import Bridge
# Also remember to firewall it off, as I did use mine to order something
# in order to get a discount on the button. After that, I get a note in the
# app each time I press - which I want to surpress.
# I have my DHCP server always give the same IP, and then I DENY that one
# at my main router:
# iptables -I FORWARD 1 -m mac --mac-source ac:63:be:36:9b:e1 -j REJECT
b = Bridge("172.10.10.123",
"kwAybzasdfasdfasdfasdf56d7wv")
def display(pkt):
# most online tutorials seem to expect ARP, but my dash doesn't do that.
if BOOTP in pkt:
if pkt[Ether].src == "ac:63:bd:56:9a:d5":
b.groups['Living room'].action(on=False)
print sniff(prn=display, filter="ip", store=0, count=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment