Created
December 17, 2015 18:49
-
-
Save allegrem/c754e7552a5e15d1d2ea to your computer and use it in GitHub Desktop.
Ameno Button
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
import pygame | |
from scapy.all import * | |
pygame.mixer.init() | |
pygame.mixer.music.load("ameno.wav") | |
playing = False | |
# while pygame.mixer.music.get_busy() == True: | |
# continue | |
def arp_display(pkt): | |
global playing | |
if pkt[ARP].op == 1: #who-has (request) | |
if pkt[ARP].psrc == '0.0.0.0': # ARP Probe | |
if pkt[ARP].hwsrc == '74:c2:46:b8:f4:f2': | |
if playing: | |
print "Pause Ameno" | |
pygame.mixer.music.stop() | |
playing = False | |
else: | |
print "Play Ameno" | |
pygame.mixer.music.play() | |
playing = True | |
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