1337Up Live CTF web/Fruitables
My solution for 1337Up Live CTF web/Fruitables challenge
Challenge overview
The Fruitables challenge presents a web application for managing fruit-related content. The application includes user authentication, an admin panel, and file upload functionality. The goal is to identify and exploit multiple vulnerabilities to ultimately retrieve a hidden flag file.
Initial reconnaissance
During the initial enumeration phase, I discovered the main application with an interesting endpoint at /account.php
. This suggested potential authentication vectors worth investigating.
Analysis
SQL Injection
The registration endpoint was found to be vulnerable to SQL injection. Using sqlmap
, I exploited this vulnerability to dump the database contents:
1
2
3
4
sqlmap -u "https://fruitables-0.ctf.intigriti.io/auth/fruitables_register.php" \
--data="first_name=a&last_name=a&username=a&password=a" \
--method POST \
--dump -p username
The scan revealed a users table containing valuable information:
Password cracking
Using hashcat, I successfully cracked the administrator
’s password hash, revealing the password: futurama
1
hashcat -m 3200 -a 0 '$2y$10$ukfji0VE/xBEBuwDFp/5b.fy6EjZ2VtaK6Xj0Wdip/viPEnVFqGGa' rockyou.txt
File upload vulnerability
After gaining administrative access, I discovered a file upload feature that accepted image files (JPEG/PNG
). Through testing, I identified that:
- The uploads were accessible via the
/uploads/
directory - The application performed insufficient validation on file contents
- PNG metadata was not properly sanitized
Exploitation
- Administrative access
- Used SQL injection to dump user database
- Cracked admin password hash
- Logged in as administrator using
tjfry_admin:futurama
- File upload
- Remote Code Execution (RCE)
Flag:
INTIGRITI{fru174bl35_vuln3r4b1l17y_ch3ckm8}
Conclusion
The Fruitables challenge demonstrated the importance of implementing proper security controls across multiple application components.
Key takeaways
- Always implement proper input validation and sanitization.
- Use strong password hashing algorithms and enforce robust password policies.
- Implement thorough file upload validation, including content inspection.