Skip to content

Conversation

@strikoder
Copy link

@strikoder strikoder commented Jan 10, 2026

Description

Fixes #1068 - FTP module's --ls flag now displays hidden files (dotfiles) by using LIST -a command instead of LIST.

Summary: Modified list_directory_full() method in nxc/protocols/ftp.py (line 126) to show all files including .bash_history, .ssh/, .env, and other dotfiles that are critical for penetration testing enumeration.

Motivation: I integrated nxc into my automated enumeration scripts. This bug caused me to miss .ssh keys once and .bash_history another time during CTFs because hidden files weren't shown and I thought the server is empty.

Dependencies: None - one-line change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Setup guide for the review

Environment:

  • Python: 3.11+ (tested on 3.11)
  • OS: Kali Linux
  • Target: ProFTPD Server on port 2121

Bug Reproduction:

  1. Set up any FTP server with a user that has dotfiles (.bash_history, .ssh/, etc.) in their home directory
  2. Run: nxc ftp <target> -u <user> -p <pass> --ls
  3. Bug: Hidden files are NOT shown
  4. Compare with standard FTP client: ftp <user>@<target> then ls -lah - hidden files ARE shown

Expected After Fix:
Running nxc ftp <target> -u <user> -p <pass> --ls shows all files including dotfiles, matching standard FTP client behavior.

Screenshots:

Before (missing hidden files):

FTP         10.129.118.31   2121   10.129.118.31    [+] ceil:qwer1234
ftp

After (all files including hidden ones):

FTP         10.129.118.31   2121   10.129.118.31    [+] ceil:qwer1234
Directory Listing
drwxr-xr-x   4 ceil     ceil         4.0k Nov 10  2021 .
drwxr-xr-x   4 ceil     ceil         4.0k Nov 10  2021 ..
-rw-------   1 ceil     ceil          294 Nov 10  2021 .bash_history
-rw-r--r--   1 ceil     ceil          220 Nov 10  2021 .bash_logout
-rw-r--r--   1 ceil     ceil         3.7k Nov 10  2021 .bashrc
drwx------   2 ceil     ceil         4.0k Nov 10  2021 .cache
-rw-r--r--   1 ceil     ceil          807 Nov 10  2021 .profile
drwx------   2 ceil     ceil         4.0k Nov 10  2021 .ssh
-rw-------   1 ceil     ceil          759 Nov 10  2021 .viminfo
afterfix

Checklist:

  • I have performed a self-review of my own code

@NeffIsBack
Copy link
Member

Thanks for the PR!

Please also adjust the proto arg description so this is clear to the user.

@NeffIsBack NeffIsBack added the bug-fix This Pull Request fixes a bug label Jan 10, 2026
@strikoder
Copy link
Author

You are most welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix This Pull Request fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: FTP module --ls flag fails to show hidden files (dotfiles)

2 participants