Created
December 15, 2020 02:21
-
-
Save taco-shellcode/a4a5136ff4d60d69aaf46be574600c8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from socket import * | |
from struct import unpack | |
import sys | |
INTERFACE = "eth0" | |
TARGET = "8.8.8.8" | |
if __name__ == "__main__": | |
sock = socket(AF_PACKET, SOCK_DGRAM, 0x0800) | |
sock.bind((INTERFACE, 0x0800)) | |
while True: | |
data = sock.recvfrom(1500, 0)[0] | |
ip = inet_ntop(AF_INET, data[12:16]) | |
if ip == TARGET: | |
print "GOT TARGET" | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment