November 19, 2026
TryHackMe Anonforce Walkthrough: FTP Enumeration, GPG Key Cracking & Root Access
Tracing a complete attack chain from anonymous FTP access to root authentication on a Linux machine.

By Muhammed Ameen S
5 min read
Introduction
The Anonforce room on TryHackMe demonstrates how multiple security weaknesses can combine to compromise a Linux system.
During this lab, I started with network reconnaissance and discovered an FTP service that allowed anonymous authentication. Further investigation exposed files containing a GPG private key and an encrypted backup. By recovering the key's passphrase and analyzing the backup, I obtained password hashes that could be audited offline.
The investigation ultimately led to root SSH access.
This walkthrough documents the methodology, commands, findings, and practical lessons from the lab.
Lab: TryHackMe โ Anonforce Attacker: Kali Linux Target: Ubuntu 16.04.6 LTS Tools: Nmap, FTP, GPG, John the Ripper, SSH
1. Initial reconnaissance
The first step was to identify the target's exposed services and understand the available attack surface.
I ran an Nmap scan with service detection and aggressive enumeration:
nmap -sV -A <TARGET_IP>nmap -sV -A <TARGET_IP>Results
The scan identified the following services:
PortServiceVersion21/TCPFTPvsftpd 3.0.322/TCPSSHOpenSSH 7.2p2
The FTP service allowed anonymous authentication, making it the primary entry point for further investigation.
Initial reconnaissance identifying the FTP and SSH services and anonymous FTP access.
The key observation was that the target allowed access to its FTP service without requiring a normal account.
2. Anonymous FTP access
I connected to the target using the FTP client:
ftp <TARGET_IP>ftp <TARGET_IP>At the username prompt, I entered:
anonymousanonymousThe server accepted the authentication.
230 Login successful.230 Login successful.I checked the current directory and explored the filesystem:
pwd
lspwd
lsThe directory listing exposed filesystem information, including a directory named notread.
This confirmed that anonymous FTP access was not restricted to a simple public file directory.
Anonymous FTP login and directory enumeration.
3. Discovering the exposed files
I navigated into the notread directory:
cd notread
lscd notread
lsTwo files were available:
backup.pgp
private.ascbackup.pgp
private.ascThese files were particularly interesting because they suggested a relationship between an encrypted backup and a private cryptographic key.
I downloaded both files to my Kali machine:
get backup.pgp
get private.ascget backup.pgp
get private.ascThe transfer completed successfully.
Retrieving the encrypted backup and private key from the exposed FTP directory.
At this point, the investigation shifted from network enumeration to cryptographic analysis.
4. Extracting the private-key hash
The private key was protected by a passphrase. Instead of attempting to guess it manually, I used John the Ripper's GPG hash-conversion utility to prepare the key for offline password auditing.
Here the command, I used:
gpg2john private.asc > privatehash1gpg2john private.asc > privatehash1This generated the hash material required for password auditing.
This was a small but useful reminder: tool names matter, and troubleshooting is part of the practical workflow.
5. Recovering the GPG passphrase
I used John the Ripper with the RockYou wordlist to audit the extracted private-key hash.
john --wordlist=/usr/share/wordlists/rockyou.txt privatehash1john --wordlist=/usr/share/wordlists/rockyou.txt privatehash1After the audit completed, I displayed the recovered result:
john --show privatehash1john --show privatehash1The passphrase was successfully recovered.
Offline auditing of the GPG private-key passphrase using John the Ripper.
The recovered passphrase allowed me to access the private key's functionality.
6. Importing the GPG key
I imported the recovered private key into my local GPG keyring:
gpg --import private.ascgpg --import private.ascThe output confirmed that the secret key was imported.
This was an important transition in the investigation. The previously exposed private key was now usable for decrypting the backup.
Importing the recovered private key into the local GPG keyring.
7. Decrypting the backup
With the key imported, I attempted to decrypt the backup file:
gpg --decrypt backup.pgpgpg --decrypt backup.pgpGPG identified the encryption key and produced the contents of the encrypted file.
The decrypted output contained password-hash information associated with system accounts, including root and a user account.
This was the critical finding of the lab because the investigation had moved from obtaining a private key to recovering credential material for the target system.
Decrypting the backup using the imported private key.
Decrypted backup data revealing password-hash material.
Sensitive hash values should not be published. In a real environment, exposing these hashes could enable offline password attacks.
8. Root password hash auditing
I extracted the root password hash into a separate file for offline analysis.
The first attempts did not load the hash correctly. This was caused by the formatting and hash identification issues encountered during preparation.
After correcting the hash input, John the Ripper recognized the hash as a SHA-512 crypt password hash.
I then ran the wordlist-based audit:
john --wordlist=/usr/share/wordlists/rockyou.txt root.txtjohn --wordlist=/usr/share/wordlists/rockyou.txt root.txtAfter the cracking process completed, I checked the recovered result:
john --show root.txtjohn --show root.txtThe root password was successfully recovered.
Recovering the root password hash through offline wordlist auditing.
This demonstrated how weak passwords can undermine account security even when password hashes are not directly exposed as plaintext.
9. Establishing root SSH access
With the root credentials recovered, I attempted to authenticate remotely using SSH:
ssh root@<TARGET_IP>ssh root@<TARGET_IP>The SSH client displayed the host-key verification prompt. I confirmed the connection within the lab environment and continued with authentication.
The login succeeded.
The target displayed the Ubuntu system information and provided a root shell.
Successful remote authentication as root.
This confirmed that the attack chain had progressed from anonymous FTP access to administrative access on the target.
10. Final verification
After gaining root access, I inspected the root directory and verified the final lab result.
The final stage confirmed that root-level access had been achieved.
Final verification of root access.
I completed the room objectives in TryHackMe.
Lab completion.
Attack chain overview
The complete attack path was:
Nmap reconnaissance
โ
FTP service discovery
โ
Anonymous FTP login
โ
Directory enumeration
โ
Download backup.pgp and private.asc
โ
Extract GPG private-key hash
โ
John the Ripper password audit
โ
Import recovered GPG key
โ
Decrypt backup
โ
Extract root password hash
โ
Offline root password audit
โ
SSH authentication as root
โ
Root access verifiedNmap reconnaissance
โ
FTP service discovery
โ
Anonymous FTP login
โ
Directory enumeration
โ
Download backup.pgp and private.asc
โ
Extract GPG private-key hash
โ
John the Ripper password audit
โ
Import recovered GPG key
โ
Decrypt backup
โ
Extract root password hash
โ
Offline root password audit
โ
SSH authentication as root
โ
Root access verifiedKey security lessons
Anonymous FTP access
Anonymous FTP should be disabled unless there is a legitimate requirement. Publicly accessible directories should be isolated and must not contain sensitive system data.
Private-key protection
Private keys should never be stored in publicly accessible locations. Strong passphrases, restrictive file permissions, secure key storage, and key rotation are essential.
Password strength
A weak passphrase can undermine the protection of cryptographic keys. Long, unique, unpredictable passwords significantly improve resistance to wordlist attacks.
Sensitive backups
Backups containing account information or credential hashes must be protected as carefully as production systems.
Root SSH access
Direct root SSH login increases the impact of credential compromise. Administrators should restrict root authentication and use least-privilege access.
Defense in depth
This room demonstrated how several weaknesses combined to create a full compromise. Preventing any one of the key failures โ anonymous access, exposed private keys, weak passwords, or unrestricted root authentication โ could have disrupted the attack chain.
Conclusion
Anonforce was a practical exercise in connecting reconnaissance findings to a complete attack path.
I practiced identifying exposed services, investigating anonymous FTP, extracting cryptographic material, auditing passphrases and password hashes, decrypting protected data, and validating remote access.
The most important lesson was that a security compromise often results from multiple weaknesses working together rather than a single vulnerability.
Understanding how these stages connect is what makes a penetration-testing investigation meaningful.
Continuing to build practical cybersecurity skills through hands-on labs, structured methodology, and evidence-based analysis.