Metasploit_Exploitation
Metasploit_Exploitation
Task 2: Scanning
Just like nmap we can also perform port scanning in metasploit using modules
Metasploit: Exploitation 1
For this example we can use option 5 which is the TCP scan
Metasploit: Exploitation 2
21/tcp open ftp syn-ack ttl 63 ProFTPD 1.3.5e
22/tcp open ssh syn-ack ttl 63 OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubunt
| ssh-hostkey:
| 2048 58:64:59:cc:fa:0f:00:ac:ef:80:e1:26:99:af:41:75 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDstjlPKdo5iQJveSHs+cAfuJi1
| 256 d7:c3:79:03:5b:dd:82:91:60:91:5e:a4:17:15:b7:78 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAy
| 256 f6:5e:36:17:0b:de:22:78:5f:f2:9b:2a:51:b9:8f:15 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNIjZGNctQpLxV2AmyNVWnt4h7
139/tcp open netbios-ssn syn-ack ttl 63 Samba smbd 3.X - 4.X (workgroup: AC
445/tcp open netbios-ssn syn-ack ttl 63 Samba smbd 4.7.6-Ubuntu (workgroup
8000/tcp open http syn-ack ttl 63 WebFS httpd 1.21
| http-methods:
|_ Supported Methods: GET HEAD
|_http-title: Site doesn't have a title (text/plain).
|_http-server-header: webfs/1.21
Service Info: Host: IP-10-10-112-227; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_ke
For the last answer we can use netexec to brute-force the password from the
password list for the the user penny
Metasploit: Exploitation 3
Answer:
Task 5: Exploitation
We will be exploiting the machine using ms17-010 exploit
Metasploit: Exploitation 4
Once the payload runs successfully, we get the meterpreter session and we can
get into the shell
Answers:
Task 6: Msfvenom
to list all available payloads
Metasploit: Exploitation 5
Now lets create a simple meterpreter revershell payload encoded in php/base64
The above was an example, now lets get in to the actual task, first using SSH we
need to login to the victims machine
Now in our host machine lets create a .elf format payload, since its linux, we need
to find linux reverseshell
Now start the python server and copy the file to the victim machine
Metasploit: Exploitation 6
[~/Tryhackme/Metasploit/Exploitation] - hak101> python3 -m http.server 8000
Now that we started the listener, lets give permissions to the file and execute it
Metasploit: Exploitation 7
Summary
Metasploit enables identification and exploitation of vulnerabilities on target
systems.
Metasploit: Exploitation 8