🔬SMB - PsExec
Lab 1
Target IP:
10.4.16.36SMB exploitation
Dictionaries to use:
/usr/share/metasploit-framework/data/wordlists/common_users.txt
/usr/share/metasploit-framework/data/wordlists/unix_passwords.txt
Enumeration
ping 10.4.16.36
nmap -sV -sC 10.4.16.36PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
3389/tcp open ms-wbt-server Microsoft Terminal Services
| ssl-cert: Subject: commonName=EC2AMAZ-408S766
| Not valid before: 2023-03-11T17:43:37
|_Not valid after: 2023-09-10T17:43:37
|_ssl-date: 2023-03-12T17:47:48+00:00; 0s from scanner time.
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2023-03-12 23:17:49
|_ start_date: 2023-03-12 23:13:37
📌 SMB version 2.02
SMB Brute-force
Use Metasploit smb_login module to brute force SMB
The brute force success is based on the users and password used.

SMB Exploitation
Use PsExec.py script for Linux (from the impacket-scripts) to get a command prompt on the target machine, with the Administrator account.
Using this technique, no exploit is launched or uploaded on the target system.
It is a legitimate authentication with the actual credentials and the use of an official tool (
psexec).

Alternatively to the Python script, use Metasploit psexec module to get a
meterpretersession on the target system.This technique will upload and run a (malicious) payload on the target. Pay attention to the antivirus!

Find the flag, running
meterpretercommands
Lab 2 - Eternal Blue (Extra)
🔬 Home Lab
I have prepared a vulnerable Windows 2008 R2 Virtual Machine and connected it to the same network of the Kali virtual machine. On the server, I have activated
File Servicesrole and created a shared folder with the Administrators Group.
Host system:
Kali LinuxTarget system:
Windown Server 2008 R2- IP192.168.31.131-Administrator:Eternal17010Exploitation tool: AutoBlue-MS17-010
Vulnerability: CVE-2017-0143 - EternalBlue + CVE-2017-0144
Enumeration


📌 The system is vulnerable to the
CVE-2017-0143
Manual Exploitation
AutoBlue-MS17-010 will be used for the manual exploitation
Generate a shellcode that will be exploited on the target system.

Set a
netcatlistener on the specified port, in another terminal tab
In the
AutoBlueterminal tab, use theeternalblue_exploit7.pyto exploit the target from the AutoBlue-MS17-010 directory
Check the
netcattab for the reverse shell

Automatic Exploitation

Last updated
Was this helpful?
