Anonforce
This engagement involved assessing a Linux-based target exposed on a private network. Initial reconnaissance revealed limited surface area, with FTP and SSH services available. The primary focus of the assessment was to identify misconfigurations and leverage them to gain initial access and escalate privileges.
Reconnaissance
Port scanning revealed the following services:
- FTP (vsftpd 3.0.3) with anonymous login enabled
- SSH (OpenSSH 7.2p2)
No web server was exposed, reducing the initial attack surface. However, FTP access allowed unauthenticated users to browse and interact with the filesystem.
Initial Access
Anonymous FTP access provided visibility into the underlying filesystem. This misconfiguration exposed sensitive directories, including a user home directory and a writable folder. Within the user directory, the user flag was immediately accessible, indicating improper access controls on file permissions.
Key Finding: Exposed Private Key Material via FTP
A directory containing sensitive files was discovered, including:
- A PGP private key (`private.asc`)
- An encrypted backup file (`backup.pgp`)
The presence of a private key accessible via anonymous FTP represents a critical misconfiguration, as it enables attackers to decrypt protected data.
Exploitation
The private key was extracted and imported into a local GPG keyring. Since the key was passphrase-protected, it was converted into a crackable hash format using `gpg2john`. The passphrase was successfully recovered using a wordlist-based attack with John the Ripper. With the decrypted private key available, the encrypted backup file was decrypted using GPG, revealing sensitive system data including credential hashes from `/etc/shadow`. These hashes were subsequently cracked, allowing full system compromise via SSH as the root user.
- Exposed private keys can completely undermine encryption protections
- Misconfigured FTP services can unintentionally expose entire filesystems
- Tools like John the Ripper can extend beyond password cracking to cryptographic key passphrases
- Proper access control and segregation of sensitive data are critical in preventing full system compromise