Description
I accidentally left the debug script in place... Well, I think that's fine - No one could possibly access my super secure directory.
Setup
Launch the challenge instance and note the host and port.
This is the third Printer Shares challenge -- focus on the debug script mentioned in the description.
sudo apt install smbclient
Solution
- Step 1Connect to the SMB share anonymouslyDespite the 'super secure directory' claim, the SMB share itself is still accessible without credentials. Use null authentication (-N flag) to enumerate and connect.smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -Nsmbclient //<HOST>/shares -p <PORT_FROM_INSTANCE> -N
- Step 2Recursively browse and find debug.shEnable recursive listing to find all files including the accidentally-left debug script.smb: \> recurse ONsmb: \> ls# Locate debug.sh in the directory treesmb: \> get debug.sh
- Step 3Read the debug script for the flagThe debug script contains hardcoded credentials, paths, or directly echoes/prints the secret. Inspect it locally to extract the flag.cat debug.sh# The flag or credentials to the secure area are inside the script
Flag
picoCTF{pr1nt3r_shar3s_3_d3bug_...}
Despite claims of security, the SMB share allows anonymous access. A debug.sh script was accidentally left in the share -- it contains hardcoded credentials or the flag itself.