I'm using this code to practice BOF but can't get it to work. Any help is appreciated.
#!/usr/bin/python3
import socket, sys
from time import sleep
buffer = b'A' * 100
while True:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('192.168.71.141, 9999'))
s.close()
sleep(2)
buffer = buffer + b'A' * 100
except:
print(f"Fuzzing crashed at {str(len(buffer))} bytes.")
sys.exit()
The error message:
File "/root/home_lab/py3fuzz", line 18
print(f"Fuzzing crashed at {str(len(buffer))} bytes.")
^
SyntaxError: invalid syntax