Fixes #1068 - FTP module --ls flag now displays hidden files (dotfiles) #1069
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1068 - FTP module's
--lsflag now displays hidden files (dotfiles) by usingLIST -acommand instead ofLIST.Summary: Modified
list_directory_full()method innxc/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
Setup guide for the review
Environment:
Bug Reproduction:
.bash_history,.ssh/, etc.) in their home directorynxc ftp <target> -u <user> -p <pass> --lsftp <user>@<target>thenls -lah- hidden files ARE shownExpected After Fix:
Running
nxc ftp <target> -u <user> -p <pass> --lsshows all files including dotfiles, matching standard FTP client behavior.Screenshots:
Before (missing hidden files):
After (all files including hidden ones):
Checklist: