hippie68 / ps4-ftp

Improved FTP server payload for PS4 and command line FTP server for Linux.
18 stars 0 forks source link
ftp linux payload ps4 server

FTP server for PS4 and Linux

This is an improved version of the "FTPS4" FTP server payload (https://github.com/xerpi/FTPS4) that fixes a few major bugs and many small ones. Plus the server now runs on Linux, too!

Some of the most important bug fixes:

New features:

The compiled PS4 payload is available for download in the release section. To exit the running payload at any time, send the custom FTP command SHUTDOWN (or, if the payload is running inside the web browser, close the browser).

How to compile for PS4

  1. Set up the PS4 payload SDK from https://github.com/Scene-Collective/ps4-payload-sdk.
  2. In the ps4-ftp directory, type "make clean && make" to compile.

Optional: if you want to help debug, add your computer's IP address and port as described in the file ftp.h, section "Preprocessor directives for PS4". Uncomment the line that says "//#define DEBUG_PS4" or use compiler option -DDEBUG_PS4. It will make the code larger and the FTP server less responsive, so only do this if you want to debug. On your computer, start netcat or any similar TCP/IP program to listen to the debug output. The computer's IP address and the specified port must match those saved in ftp.h. E.g.:

    netcat -l 9023

netcat must be started before starting the payload.

How to compile for Linux

    gcc source/*.c -pthread -Wall -Wextra --pedantic -s -O3 -o ftpserver

How to run on Linux

Usage: ftpserver [OPTIONS] [PORT]

Starts an anonymous FTP server in the current directory.

Options:
  -h, --help       Print help information and quit.
      --read-only  Start the server in read-only mode.

The Linux version starts an anonymous FTP server in the current directory, with the default port being 1337. It will print a log that displays connected clients and the client-server dialogues. If you want to see debug output, too, add the compiler option -DDEBUG. Press CTRL-C to exit the running server at any time (or send the custom FTP command SHUTDOWN).

How to compile for other operating systems

The code might compile on other Unix-like operating systems by specifying the macro "NON_LINUX", but this is not tested.


If you have ideas on how to improve the code and want to share, please let me know by creating an issue. Bash scripts to test other FTP servers for some of the bugs are found in the scripts directory.

Credits

Development chain: xerpi -> idc -> xvortex -> Scene-Collective -> hippie68. And thanks to SiSTRo for pointing out problems in the original FTPS4 code!