Scapy

Scapy is so special it earns its own page

Send data over ICMP!

from scapy.all import *
import time, random

# Read in the picture as a file
with open('./hahaha.jpg', 'rb') as manning:
    peyton = manning.read()

# Encode the file to hex (easier to send as hex)
peyton = peyton.hex()

# How long each payload should be
n = 32
# Split the encoded hex into a list of n-sized pieces
haha = [peyton[i:i+n] for i in range(0, len(peyton), n)]

# Loop to constantly send ICMP
while True:
    # Loop through entire list and send in order
    for i in range(len(haha)):
        # Re-encode payload as bytes for index
        payload = bytes.fromhex(haha[i])
        send(IP(dst="127.0.0.1")/ICMP(type=8)/payload)
        # Sleep for a bit to make it less consistent
        time.sleep(random.randint(1,15))
    # Sleep between each set
    time.sleep(random.randint(600,1500))

Last updated