Update repos for Packet Squirrel Mk 2 release

This commit is contained in:
Mike Kershaw / Dragorn
2023-07-24 14:58:18 -04:00
parent 2181bf89e5
commit d3250b4165
56 changed files with 731 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
# Wake-on-LAN
This payload generates a WoL (Wake-on-LAN) magic packet for the devices listed in the
payload configuration.
Make sure to copy BOTH `payload` and `wol_python.py` to the SAME payload directory on
the Packet Squirrel!

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Title: Wake on Lan
# Description: Wake On Lan with Python
# Author: Hak5
# Configuration
# MAC addresses, separated by spaces
WOL_TARGETS="11:22:33:44:55:66 AA:BB:CC:DD:EE:FF"
# How often do we wake up systems, in seconds?
WOL_INTERVAL=30
# NAT mode
NETMODE NAT
# Set the LED
LED G SINGLE
while true; do
# Toggle the LED, send the WoL
LED W SOLID
python /root/payloads/$(SWITCH)/python_wol.py ${WOL_TARGETS}
# Wait one second for the LED to be visible
sleep 1
# Reset the LED
LED G SINGLE
# Wait the wakeup interval
sleep ${WOL_INTERVAL}
done

View File

@@ -0,0 +1,21 @@
#!/usr/bin/python
import sys
import socket
# Simplified function to send a wake-on-lan packet
def send_wol(destination):
sync = "FF" * 6
macs = destination * 16
payload = bytes.fromhex(sync + macs)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(payload, ("255.255.255.255", 9))
# Send a WoL packet for each MAC address we
# were called with
for mac in sys.argv[1:]:
fin_mac = mac.replace(":", "")
send_wol(fin_mac)