# Scapy

Send data over ICMP!

```python
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))
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.m4lwhere.org/programming/python/scapy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
