0

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 ?

Geemo
  • 11
  • 2
  • Because Python 3 is different than 2. In this case the data you are sending is different due to string encodings used. Please look at https://stackoverflow.com/questions/29513683/difference-between-python3-and-python2-socket-send-data – RvdK Oct 23 '20 at 11:13
  • Also look at https://stackoverflow.com/questions/37193088/python2-7-vs-python3-4-socket-send – RvdK Oct 23 '20 at 11:14

0 Answers0