I just wrote a very simple fuzzer to fuzz the TRUN command of vulnserver. The problem is, it works with python2 and not works with python3.
OS: Kali GNU/Linux Rolling x86_64 2020.2
Python3 Version: Python 3.8.2
Python2 Version: Python 2.7.18
import sys, socket
from time import sleep
buffer = "A" * 100
while True:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.1.106",9999))
s.send(("TRUN /.:/" + buffer))
s.close()
sleep(1)
buffer = buffer + "A"*100
except:
print("Crashed near %s bytes." % str(len(buffer)))
sys.exit()
Also it doesn't exit the program after hitting the exception. Can anybody explain why ?