Current Location: Home> Latest Articles> Summary of support for ftp_rawlist by different FTP servers

Summary of support for ftp_rawlist by different FTP servers

gitbox 2025-05-26

1. vsftpd (Very Secure FTP Daemon)

vsftpd is a widely used open source FTP service software known for its security. By default, its LIST output format follows UNIX style, so ftp_rawlist() performs well when parsing such server responses.

 $conn = ftp_connect("gitbox.net");
ftp_login($conn, "user", "password");
$rawlist = ftp_rawlist($conn, ".");
print_r($rawlist);

Output example:

 Array
(
    [0] => drwxr-xr-x    2 1000     1000         4096 May 20 10:30 public_html
    [1] => -rw-r--r--    1 1000     1000         1234 May 19 14:12 index.php
)

This output format is very standard and is suitable for parsing with regular expressions.

2. ProFTPD

ProFTPD supports a wide range of configuration options and also uses UNIX-style output by default. However, its configuration is flexible and the output format will be changed in some cases (such as ListOptions enabled).

If ListOptions "-a" is added to the configuration, ftp_rawlist() will return all files including hidden files.

3. Pure-FTPd

Pure-FTPd also supports UNIX style, but under some settings it may return a list of simplified formats (such as omitting permission columns). It is recommended to enable "Unix Listings" mode:

 pure-config.pl --with-unix-listings

After turning on, the return value format of ftp_rawlist() is close to vsftpd.

4. FileZilla Server (Windows)

FileZilla Server uses a custom implementation. Although its LIST output also mimics the UNIX style, permission columns and user group information are often placeholders (such as ? ), as follows:

 -rw-r--r-- ? ? ? 1024 May 21 09:45 log.txt

Although it is not the best choice in some automation scenarios, the basic structure remains unchanged and fields can still be parsed by exploit() or regular.

5. IIS FTP Server (Microsoft)

IIS's FTP Server defaults to output DOS-style directory listings in earlier versions:

 05-21-25  09:45AM       <DIR>          Logs
05-21-25  09:45AM                 1024 report.txt

ftp_rawlist() cannot directly parse the format as file/directory permissions, user and other information. It is recommended to avoid using IIS FTP in scenarios where ftp_rawlist() , or manually implement the parsing logic of this format.

summary

Server Type Format type Is it compatible with ftp_rawlist
vsftpd UNIX ?
ProFTPD UNIX ? (Configuration affects output)
Pure-FTPd UNIX ? (It is recommended to enable Unix mode)
FileZilla Server UNIX-like ? (Some fields are missing)
IIS FTP Server DOS ? (Format incompatible)