Skip to content

Instantly share code, notes, and snippets.

@cedriczirtacic
Created February 12, 2019 16:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedriczirtacic/20ff279ba09ed8a42da1da9af34b3906 to your computer and use it in GitHub Desktop.
Save cedriczirtacic/20ff279ba09ed8a42da1da9af34b3906 to your computer and use it in GitHub Desktop.
wake-on-lan using scapy
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