mirror of
https://github.com/hak5/packetsquirrel-payloads.git
synced 2025-12-19 09:48:47 +00:00
Update repos for Packet Squirrel Mk 2 release
This commit is contained in:
7
payloads/remote-access/wake_on_lan/README.md
Normal file
7
payloads/remote-access/wake_on_lan/README.md
Normal 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!
|
||||
37
payloads/remote-access/wake_on_lan/payload
Executable file
37
payloads/remote-access/wake_on_lan/payload
Executable 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
|
||||
21
payloads/remote-access/wake_on_lan/python_wol.py
Executable file
21
payloads/remote-access/wake_on_lan/python_wol.py
Executable 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)
|
||||
|
||||
Reference in New Issue
Block a user