ifconfig
For scanning the machine we use the command
nmap -sV <ip>
We can see that there many services let's take any two and try to exploit it.
First go with vsftpd 2.3.4 lets search in metasploit database using the search command
So there is exploit for this lets select that exploit
We have selected the payload let see the options
After setting the host, running the command we were able to get root shell access into the metasploit system
Samba is running on port 139 and 445 so we will use a samba based exploit next
selected the exploit, now to adding the RHOST
After the running exploit we get a root shell
So we can see that we are in the target machine a we have full access
This the target windows machine
Let's try get access to that machine using a reverse shell when get executed in the windows machine will give reverse connection to attacker machine.
created a payload.
Sending the payload by addigd it in the html directory under /var/www/html/
So we downloaded file target machine let's setup the listener We use exploit multi hander to interact with payload
We have to set the LHOST that is the ip of the attacker machine
Run the payload2.exe file after turning on the listener in attacker machine.
Now as you can see we got access to the victim machine.