Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Web Penetration Testing with Metasploit

You're reading from   Hands-On Web Penetration Testing with Metasploit The subtle art of using Metasploit 5.0 for web application exploitation

Arrow left icon
Product type Paperback
Published in May 2020
Publisher Packt
ISBN-13 9781789953527
Length 544 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Harpreet Singh Harpreet Singh
Author Profile Icon Harpreet Singh
Harpreet Singh
Himanshu Sharma Himanshu Sharma
Author Profile Icon Himanshu Sharma
Himanshu Sharma
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Introduction
2. Introduction to Web Application Penetration Testing FREE CHAPTER 3. Metasploit Essentials 4. The Metasploit Web Interface 5. The Pentesting Life Cycle with Metasploit
6. Using Metasploit for Reconnaissance 7. Web Application Enumeration Using Metasploit 8. Vulnerability Scanning Using WMAP 9. Vulnerability Assessment Using Metasploit (Nessus) 10. Pentesting Content Management Systems (CMSes)
11. Pentesting CMSes - WordPress 12. Pentesting CMSes - Joomla 13. Pentesting CMSes - Drupal 14. Performing Pentesting on Technological Platforms
15. Penetration Testing on Technological Platforms - JBoss 16. Penetration Testing on Technological Platforms - Apache Tomcat 17. Penetration Testing on Technological Platforms - Jenkins 18. Logical Bug Hunting
19. Web Application Fuzzing - Logical Bug Hunting 20. Writing Penetration Testing Reports 21. Assessment 22. Other Books You May Enjoy

Going the extra mile – customizing the Metasploit exploit

For the Metasploit module we used in the previous section, exploit/multi/http/wp_crop_rce, we need to have the username and password set for the module to work. But what if there's a reCAPTCHA in place at the time of authentication? The module will surely fail because there's no workaround for the module to get the session cookie:

  1. Let's modify the module so that it works with the COOKIE datastore as well:

We can see the updated module options in the following screenshot:

  1. Let's define a function for the COOKIE datastore:
  1. We also need to validate the cookie based on the response code. So, let's define a validate_cookie() function; this will validate the cookie with a 200 HTTP response code:
  1. Now, in the exploit() function, let's include a fail-safe fail_with() method to ensure...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime