OSCP Capstone Lab Writeup - SQLi Module - Alvida-Eatery
Take a look
Website Content Analysis:
Accessed the website (http://192.168.139.47:80)
-
Website Content Analysis:
Displays bakery goods and coffee products
Static content only
No interactive elements found:
No search functionality
No login forms
No input fields
Initial Assessment:
Limited attack surface due to lack of user input fields
Traditional injection techniques not immediately applicable
Need to explore alternative entry points
Further Website Exploration:
- Located and clicked on alvida-eatery.org link within the main website
Attempted SQLMap injection on URL parameters:
Targeted 'uuid' parameter
Result: 403 Forbidden error received
Initial Attack Attempts:
Hint suggests binding IP address to website domain
This indicates potential DNS/host file configuration requirement
Host File Configuration:
- Updated /etc/hosts file to bind target IP (192.168.139.47) to alvida-eatery.org domain
Post-Configuration Testing:
YES! The website transformation was incredible after the host file update, a juicy search functionality appeared (potential SQLi goldmine!)
SQLi Attempt Analysis(can be ignored):
Eagerly launched SQLMap against the search box parameter:
Ugh, hit with a 403 Forbidden error (so close!)
No SQL injection vectors found (disappointing but won't give up!)
Determined to find a way in, I tried more parameters:
The 'cat' parameter looked promising...but no luck
'page_id' parameter was another dead end
Frustrating results, but each failed attempt brings me closer to success
Source Code Analysis
WordPress Discovery and Exploitation:
checked the source code, I spotted WordPress signatures in the source code.
Treasure Hunting
With renewed energy, I launched a targeted sqlmap scanning against WordPress admin-ajax.php:
The anticipation was killing me during the long SQLMap runs...
JACKPOT! 🎉 Successfully extracted user credentials:
Username: admin
Password hash: [redacted WordPress hash with salt]
Hands trembling with excitement, I fired up John the Ripper:
john --wordlist=/usr/share/wordlists/rockyou.txt wp_hash.txt
YES! YES! YES! Password cracked successfully!
That moment when the hash finally cracked - pure penetration testing euphoria! 🚀
Reverse shell
Working carefully, I crafted a PHP reverse shell, packaged it into a ZIP file, and attempted to upload it as a plugin. While I could see it in the uploads section, the system required admin approval via email verification - a potential roadblock.
However, access was denied with a forbidden error.