Created
February 12, 2019 16:11
-
-
Save cedriczirtacic/20ff279ba09ed8a42da1da9af34b3906 to your computer and use it in GitHub Desktop.
wake-on-lan using scapy
This file contains 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
from scapy.sendrecv import send | |
from scapy.layers.inet import * | |
from binascii import unhexlify | |
import sys | |
magic = '' | |
for h in sys.argv[1].split(':'): magic += unhexlify(h); | |
send(IP(dst="255.255.255.255")/UDP(dport=9)/Raw(load=(chr(0xff)*6 + magic*16))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment