Walkthrough on exploiting a Linux machine. Enumerate Samba for shares, manipulate a vulnerable version of proftpd and escalate your privileges with path variable manipulation.
Enumerating Samba for Shares
- using nmap to enumerate smb shares
nmap --script=smb-enum-shares.nse,smb-enum-users.nse -p 445 <ip>
- smb has to ports, 445, 139
- try to connect to one of the shares
smbclient //<target ip>/<>
- recursively download smb shares
smbget -R smb://<ip>/<>
- scan PRCbind ports for volumes
nmap -p <port of rpc> --script=nfs-ls,nfs-statfs,nfs-showmount <ip>
Gain Initial Access with ProFtpd
- get proftpd server version using netcat
nc <ip> 21
- search for possible exploits
- ???
- Profit
Privilege Escalation with Path Variable Manipulation
- use SUID bits to elevate privileges
find / -perm -u=s -type f 2>/dev/null