SlideShare a Scribd company logo
CNIT 124:
Advanced Ethical
Hacking
Ch 8: Exploitation
Topics
• Metasploit Payloads
• Exploiting WebDAV Default Credentials
• Exploiting Open phpMyAdmin
• Downloading Sensitive Files
Topics
• Exploiting a Buffer Overflow in Third-Party
Software
• Exploiting Third-Party Web Applications
• Exploiting a Compromised Service
• Exploiting Open NFS Shares
Metasploit Payloads
msf> show payloads
• Shows all payloads
• If after use it only shows payloads
compatible with that exploit
Payloads for ETERNALBLUE
Staged Payloads
• Loads small first stage downloader
• Downloads larger payload
Inline Payloads
• Whole payload delivered immediately
Meterpreter
• Custom payload for Metasploit
• Resides in memory
• Loaded by reflective dll injection
• Uses TLS encryption
• Useful commands like getsystem and
hashdump
Exploiting WebDAV Default
Credentials
Nmap Scan
WebDAV
• Web Distributed Authoring and Versioning
– An extension to HTTP
– Allows developers to easily upload files to
Web servers
XAMPP
• A convenient way to run a LAMP server on
Windows
– LAMP: Linux, Apache, MySQL, and PHP
• Includes WebDAV, turned on by default,
with default credentials
– In older versions
Cadaver
• A command-line tool to use WebDAV
servers
• Default credentials allow file uploads
Website Defacement
• Violates integrity, but not as powerful as
Remote Code Execution
Upload a PHP File
• PHP file
executes
on the
server!
• This is
Remote
Code
Execution
Msfvenom Creates Malicious PHP File
• msfvenom -l payloads to see all payloads
• msfvenom -p php/meterpreter/
reverse_tcp -o to see options
Msfvenom Creates Malicious PHP File
Upload and Run
• Using cadaver, put meterpreter.php
• Browse to it in a Web browser to execute
it
Meterpreter Reverse Shell
Exploiting Open phpMyAdmin
Purpose
• phpMyAdmin provides a convenient GUI
• Allows administration of SQL databases
phpMyAdmin
Should be Protected
• phpMyAdmin should be limited-access
– With a Basic Authentication login page, or a
more secure barrier
SQL Query
• Can write text to a file
• This allows defacement
PHP Shell
• Can execute one line of CMD at a time
Downloading a File with TFTP
• We need some way to download another
attack file to the target using the
command-line
• Windows lacks "wget" (although you can
use bitsadmin)
• Another solution: TFTP
CNIT 124: Ch 8: Exploitation
Staged Attack
• Initial attack sends a very small bit of
code, such as a single line of CMD
• That attack connects to a server and
downloads more malicious code
• Very commonly used by malware
CNIT 124: Ch 8: Exploitation
Using FTP (Not in Book)
FTP Server in Metasploit
FTP Scripts
• File contains text to be executed by
command-line FTP client
Making the Script File with SQL
Run the FTP –s:script Command
• More methods at link Ch 8w
Owned
Downloading Sensitive Files
Directory Traversal
• Zervit allows you to browse the file
system
• Restart 

Win2008-124 VM
• Start Zervit 

on port 3232
Zervit
• Shows folders in 

C:Program Files
Download Filezilla XML File
• Contains MD5 password hashes
SAM and SYSTEM
• C:Windowssystem32configSAM
• System Accounts Manager
• Contains password hashes
• Encrypted
• C:Windowssystem32configSYSTEM
• Contains encryption key
Traverse to Them
Zervit Can't Access Them
C:WindowsRepair
• Contained backups of SAM and SYSTEM in
Windows XP
• But not in Server 2008
• We'll have to get password hashes another
way, later
Exploiting a Buffer Overflow in
Third-Party Software
SLMail
• Textbook uses an SLmail exploit from 2003
• But it seems not to run on Server 2008
• Just normal Metasploit procedure, same
as other exploits
• Nothing to see here
Exploiting Third-Party Web
Applications
TikiWiki
• Textbook exploits TikiWiki on a Linux
target we're not using
• Again, normal Metasploit process
• Only difference: php payloads, like
• php/meterpreter/reverse_tcp
Exploiting a Compromised
Service
Metasploitable Target
• Nmap shows vsftpd 2.3.4
Google "vsftpd 2.3.4"
Install FTP
• Kali doesn't have "ftp" by default
• apt install ftp
Smileyface in Username
• x
Exploiting Open NFS Shares
Nmap Shows nfs
Nmap Script nfs-ls
nmap --script=nfs-ls
• Error message appears below this, ignore it
Install nfs-common
• Required to mount nfs shares from Kali
• apt-get update
• apt-get install nfs-common
SSH Keys in .ssh Directory
Authorized Keys
• Public keys which allow login as msfadmin
Generate SSH Keys
Add to Authorized Keys
Connect with SSH
Move to /tmp/mount/root/.ssh
• Log in as root
CNIT 124: Ch 8: Exploitation

More Related Content

PDF
CNIT 124 Ch 13: Post Exploitation (Part 1)
PDF
CNIT 124: Ch 6: Finding Vulnerabilities and Exploiting Domains
PDF
CNIT 124: Ch 5: Information Gathering
PDF
CNIT 124 Ch10-12: Local Exploits through Bypassing AV
PDF
CNIT 124: Ch 7: Capturing Traffic
PDF
CNIT 127: 8: Windows overflows (Part 2)
PDF
CNIT 126 Ch 11: Malware Behavior
PDF
CNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124: Ch 6: Finding Vulnerabilities and Exploiting Domains
CNIT 124: Ch 5: Information Gathering
CNIT 124 Ch10-12: Local Exploits through Bypassing AV
CNIT 124: Ch 7: Capturing Traffic
CNIT 127: 8: Windows overflows (Part 2)
CNIT 126 Ch 11: Malware Behavior
CNIT 127 Ch 16: Fault Injection and 17: The Art of Fuzzing

What's hot (20)

PDF
9: OllyDbg
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PDF
Powering up on PowerShell - BSides Charleston - Nov 2018
PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
PDF
CNIT 126 Ch 9: OllyDbg
PDF
Practical Malware Analysis: Ch 8: Debugging
PDF
CNIT 126 12: Covert Malware Launching
PDF
CNIT 127 Ch 3: Shellcode
PPTX
Tuenti Release Workflow
PDF
Codefest2015
PPT
Selenium RC Overview
PPTX
Backend Server Validation
PDF
Investigating Hackers' Tools
PDF
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
PPTX
Owning computers without shell access 2
PPTX
15 most valuable reports with CFEngine
PDF
Kalnai_Jirkal-vb-2016-malicious-osx-cocktail
PDF
Multi-language/multi-OS communication using RabbitMQ
9: OllyDbg
CNIT 126: 10: Kernel Debugging with WinDbg
Powering up on PowerShell - BSides Charleston - Nov 2018
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 9: OllyDbg
Practical Malware Analysis: Ch 8: Debugging
CNIT 126 12: Covert Malware Launching
CNIT 127 Ch 3: Shellcode
Tuenti Release Workflow
Codefest2015
Selenium RC Overview
Backend Server Validation
Investigating Hackers' Tools
Virtual Security Lab Setup - OWASP Broken Web Apps, Webgoat, & ZAP
Owning computers without shell access 2
15 most valuable reports with CFEngine
Kalnai_Jirkal-vb-2016-malicious-osx-cocktail
Multi-language/multi-OS communication using RabbitMQ
Ad

Similar to CNIT 124: Ch 8: Exploitation (20)

PDF
CNIT 126 7: Analyzing Malicious Windows Programs
PPT
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
PPT
Windows internals
PDF
CNIT 152 10 Enterprise Service
PDF
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
PDF
What Could Microsoft Do To Make PHP Run Better On Windows
PDF
Practical Malware Analysis: Ch 11: Malware Behavior
PDF
CNIT 152: 10 Enterprise Services
PDF
unit 2 confinement techniques.pdf
PDF
CNIT 121: 10 Enterprise Services
PDF
CNIT 126 11. Malware Behavior
PDF
CNIT 129S: 10: Attacking Back-End Components
PDF
Practical White Hat Hacker Training - Exploitation
PDF
Practical White Hat Hacker Training - Post Exploitation
PPTX
Defending Your "Gold"
PDF
Web Application Penetration Testing.pdf
PPTX
Apache Performance Tuning: Scaling Up
PPTX
Debugging the Web with Fiddler
PDF
1000 to 0
PPTX
BSides Algiers - Metasploit framework - Oussama Elhamer
CNIT 126 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Windows internals
CNIT 152 10 Enterprise Service
CNIT 126 Ch 7: Analyzing Malicious Windows Programs
What Could Microsoft Do To Make PHP Run Better On Windows
Practical Malware Analysis: Ch 11: Malware Behavior
CNIT 152: 10 Enterprise Services
unit 2 confinement techniques.pdf
CNIT 121: 10 Enterprise Services
CNIT 126 11. Malware Behavior
CNIT 129S: 10: Attacking Back-End Components
Practical White Hat Hacker Training - Exploitation
Practical White Hat Hacker Training - Post Exploitation
Defending Your "Gold"
Web Application Penetration Testing.pdf
Apache Performance Tuning: Scaling Up
Debugging the Web with Fiddler
1000 to 0
BSides Algiers - Metasploit framework - Oussama Elhamer
Ad

More from Sam Bowne (20)

PDF
Introduction to the Class & CISSP Certification
PDF
Cyberwar
PDF
3: DNS vulnerabilities
PDF
8. Software Development Security
PDF
4 Mapping the Application
PDF
3. Attacking iOS Applications (Part 2)
PDF
12 Elliptic Curves
PDF
11. Diffie-Hellman
PDF
2a Analyzing iOS Apps Part 1
PDF
9 Writing Secure Android Applications
PDF
12 Investigating Windows Systems (Part 2 of 3)
PDF
10 RSA
PDF
12 Investigating Windows Systems (Part 1 of 3
PDF
9. Hard Problems
PDF
8 Android Implementation Issues (Part 1)
PDF
11 Analysis Methodology
PDF
8. Authenticated Encryption
PDF
7. Attacking Android Applications (Part 2)
PDF
7. Attacking Android Applications (Part 1)
PDF
5. Stream Ciphers
Introduction to the Class & CISSP Certification
Cyberwar
3: DNS vulnerabilities
8. Software Development Security
4 Mapping the Application
3. Attacking iOS Applications (Part 2)
12 Elliptic Curves
11. Diffie-Hellman
2a Analyzing iOS Apps Part 1
9 Writing Secure Android Applications
12 Investigating Windows Systems (Part 2 of 3)
10 RSA
12 Investigating Windows Systems (Part 1 of 3
9. Hard Problems
8 Android Implementation Issues (Part 1)
11 Analysis Methodology
8. Authenticated Encryption
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 1)
5. Stream Ciphers

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Cell Structure & Organelles in detailed.
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Insiders guide to clinical Medicine.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Final Presentation General Medicine 03-08-2024.pptx
human mycosis Human fungal infections are called human mycosis..pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Sports Quiz easy sports quiz sports quiz
Anesthesia in Laparoscopic Surgery in India
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
O7-L3 Supply Chain Operations - ICLT Program
Cell Structure & Organelles in detailed.
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

CNIT 124: Ch 8: Exploitation