Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NoteAfterNote/1ead8e2b91f10cefd8b4cbcb41cb7f5a to your computer and use it in GitHub Desktop.
Save NoteAfterNote/1ead8e2b91f10cefd8b4cbcb41cb7f5a to your computer and use it in GitHub Desktop.
Experimental: FTP, Termux, QEMU

NoteAfterNote-6
Experimental: FTP, Termux, QEMU
Published: April 18, 2023
Link: https://gist.github.com/NoteAfterNote/1ead8e2b91f10cefd8b4cbcb41cb7f5a


Configuring vsftpd

  • QEMU Guest Operating System: vsftpd.conf
   seccomp_sandbox=NO
   pasv_enable=YES
   pasv_min_port=10000
   pasv_max_port=10005
  • QEMU firewall
   QEMU HMP Monitor Commands
   
   hostfwd_add ::10021-:21
   hostfwd_add ::10001-:10001
   hostfwd_add ::10002-:10002
   hostfwd_add ::10003-:10003
   hostfwd_add ::10004-:10004
   hostfwd_add ::10004-:10005

   
   QEMU command line
   
   -device virtio-net-pci,netdev=net0 -netdev user,id=net0,ipv6=off,hostfwd=::10021-:21,hostfwd=::10001-:10001,hostfwd=::10002-:10002,hostfwd=::10003-:10003,hostfwd=::10004-:10004,hostfwd=::10005-:10005


Client: ftp

   # Needs testing: Connecting from the guest operating system
      ftp --passive 10.0.2.2 12345
         anonymous
         guest
         epsv4
         binary
 
   # Needs testing: From Termux to vsftpd
      ftp --passive 127.0.0.1 10021
         anonymous
         guest
         epsv4
         binary


Client: lftp

   # Connecting from the guest operating system worked
   # without additional configuration or commands.

    lftp -p 10021 10.0.2.2


Reference Links

  1. vsftpd: https://security.appspot.com/vsftpd.html , https://security.appspot.com/vsftpd/Changelog.txt ("seccomp_sandbox")
  2. GNU Inetutils: https://www.gnu.org/software/inetutils/manual/inetutils.html ("ftp: FTP client")
  3. LFTP: https://lftp.yar.ru , https://github.com/lavv17/lftp (@lavv17)
  4. "Termux And The ext4 Filesystem, Part 2 Of 5: QEMU, A Guest Operating System, And darkhttpd", NoteAfterNote-2, April 7, 2023: https://github.com/NoteAfterNote (@NoteAfterNote), https://gist.github.com/NoteAfterNote/f5bd5e127d0768cb4eac53fb7729d29f
  5. "The ext4 Filesystem, Part 3 Of 5: QEMU, A Guest Operating System, LUKS Encryption, lighttpd, WebDAV", NoteAfterNote-3, April 12, 2023: QEMU, A Guest Operating System, GNU GRUB Bootloader, And fdisk", NoteAfterNote-4, April 14, 2023, https://github.com/NoteAfterNote (@NoteAfterNote), https://gist.github.com/NoteAfterNote/cabd411777f2ad5ae57d3d98c576471c
  6. "Termux And The ext4 Filesystem, Part 4 Of 5: QEMU, A Guest Operating System, GNU GRUB Bootloader, And fdisk", NoteAfterNote-4, April 14, 2023, https://github.com/NoteAfterNote (@NoteAfterNote), https://gist.github.com/NoteAfterNote/0ec14839db016b6d3b905d4eda5db263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment