Skip to content

Instantly share code, notes, and snippets.

@scramblr
Last active June 7, 2024 12:24
Show Gist options
  • Save scramblr/1b7d5f14db6870bc82f4528582863a7b to your computer and use it in GitHub Desktop.
Save scramblr/1b7d5f14db6870bc82f4528582863a7b to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#
# This is a small, simple script to test your server's abilities to spoof IPv4 packets or not.
# You should use this instead of things like caida project's tool, because they're rumored to
# collect data or hand it off to others who harass the server/network owners until they re-configure
# their networks and discontinue allowing spoofed packets.
#
# By default, this script sends spoofed packets to fuzzme.packet.tel - but it can be configured to
# send them anywhere. You can download a constantly running pcap by typing:
# wget http://fuzzme.packet.tel/fuzzme.packet.tel.last10minutes.pcap
# EDIT: packet.tel has been killed off for now, and also I think cock.li (my host) may be in some hot water,
# sooooo yeah. No fun utilities like fuzzme for now.
#
# Thank the White Knights of the Internet for all of this crap.
#
# Requires scapy and a spoofy box
#
# Enjoy!
# -SCRAMBLR
#
from scapy.all import *
howmany = 666 # Change this if u want
destination = "localhost" # u can also change this too!
message = "HISEXYITSSPOOFTESTDOTPY"
print("IP Spoofing / IPHM Test Tool")
print("IP Header Modification & Verification Tool")
print("Now With 100% LESS CAIDA!!")
print("")
print("Created by SCRAMBLR (https://github.com/scramblr)\r\n\r\n")
print("[*] We're gonna be spoofing now!")
print("[*] How many packjets r we sending? [Enter For Default (666)]: ")
print(howmany)
print("[*] Where we sending deez spiffy, spoofy bois to? [Enter For Default (localhost): ")
print(destination)
print("[*] Verifying " + destination + " still lives on the internet with ICMP ping...")
send(IP(dst='" + destination + "')/ICMP())
print("[*] Sending some spoofy packjets to da box!")
packjet = IP(src=RandIP(),dst=destination)/ICMP()/"$message"
send(packjet,count=howmany)
sleep(3)
print("[*] w00t! ok we sent " + howmany + "ICMP packjets to " + destination + " so hopefully you")
print("[*] were running tcpdump on that server to watch for the packets. otherwise, log in to the")
print("[*] destination server and run, as root, # tcpdump -i any -nnnv -c 5000 icmp <-- and then")
print("[*] re-run this script on the spoofy server again to send the blast of packets to the server")
print("")
print("[*] check https://github.com/scramblr/spooftest for updates!")
print("[*] © MMXXIV SCRAMBLR
@scramblr
Copy link
Author

scramblr commented Feb 6, 2023

you get the point. buy your own server to test im broke ;)

@scramblr
Copy link
Author

scramblr commented Jun 7, 2024

### NOTE: SCAPY NO LONGER SUPPORTS WILDCARDS IN DESTINATIONS. Code is being archived for historical purposes only.

Please check https://github.com/scramblr/iphm_servers for current and future updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment