Mohon sumbangkan nominal sukarela terbaik anda supaya proyek ini dikembangkan lebih baik. Klik untuk download QR Code AnTS Groups
PySec Audit adalah platform keamanan siber berbasis web untuk mendeteksi file backdoor tersembunyi dan script judi online / slot gacor pada website. Dibangun menggunakan Python Flask dan di-deploy menggunakan Gunicorn.
- Fitur Utama
- Arsitektur & Struktur Proyek
- Teknologi yang Digunakan
- Prasyarat (Prerequisites)
- Instalasi
- Menjalankan Aplikasi
- Penggunaan
- API Endpoints
- Scanner Engine Details
- Konfigurasi
- Deployment
- Troubleshooting
- Lisensi
| Fitur | Deskripsi |
|---|---|
| Webshell Detection | Mendeteksi PHP, ASP, JSP webshell (c99, r57, b374k, WSO, Alfa Shell, dll.) |
| Image Analysis | Scan file PNG, JPG, GIF, ICO, SVG untuk kode PHP/script tersembunyi |
| Obfuscation Detection | Identifikasi base64, hex encoding, high entropy, long-line obfuscation |
| Signature Matching | Cocokkan 100+ signature backdoor dan pola kode berbahaya |
| Double Extension | Deteksi trik double extension (contoh: image.jpg.php) |
| Hidden Files | Deteksi file tersembunyi (dot-prefixed) dan backup sensitif |
| URL Probing | Probe 40+ path webshell umum di server target |
| Fitur | Deskripsi |
|---|---|
| Keyword Detection | 80+ keyword gambling: slot gacor, judi online, togel, pragmatic play, sbobet |
| Hidden Content | Deteksi iframe tersembunyi, display:none, konten gambling invisible |
| Redirect Detection | Identifikasi JavaScript, meta-refresh, server-side redirect ke situs judi |
| Cloaking Detection | Bandingkan konten bot vs user untuk deteksi gambling cloaking |
| SEO Spam | Deteksi doorway pages, hidden text, dan injeksi SEO spam |
| Domain Scanning | Periksa link ke domain-domain gambling yang dikenal |
PySec-Audit-Website2/
โโโ app.py # Entry point aplikasi Flask
โโโ config.py # Konfigurasi aplikasi
โโโ requirements.txt # Dependencies Python
โโโ Procfile # Konfigurasi Gunicorn untuk deployment
โโโ README.md # Dokumentasi teknikal (file ini)
โ
โโโ scanners/ # Engine scanner
โ โโโ __init__.py
โ โโโ backdoor_scanner.py # Scanner backdoor file di path lokal
โ โโโ url_scanner.py # Scanner backdoor via URL
โ โโโ gambling_scanner.py # Scanner gambling/slot di path lokal
โ โโโ gambling_url_scanner.py # Scanner gambling/slot via URL
โ
โโโ routes/ # Flask routes & API endpoints
โ โโโ __init__.py
โ โโโ main.py # Blueprint utama (halaman + API)
โ
โโโ templates/ # HTML templates (Jinja2)
โ โโโ base.html # Base layout (sidebar, navbar, footer)
โ โโโ dashboard.html # Halaman dashboard utama
โ โโโ backdoor_scanner.html # Halaman backdoor scanner
โ โโโ gambling_detector.html # Halaman gambling detector
โ โโโ results.html # Halaman hasil scan detail
โ
โโโ static/ # Static assets
โโโ css/
โ โโโ style.css # Dark cybersecurity theme CSS
โโโ js/
โโโ main.js # JavaScript (AJAX, UI interactions)
| Teknologi | Versi | Fungsi |
|---|---|---|
| Python | 3.10+ | Bahasa pemrograman utama |
| Flask | 3.1.0 | Web framework |
| Gunicorn | 23.0.0 | WSGI HTTP Server (production) |
| Requests | 2.32.3 | HTTP client untuk URL scanning |
| BeautifulSoup4 | 4.13.3 | HTML/XML parser |
| lxml | 5.3.1 | XML/HTML parser engine |
| urllib3 | 2.3.0 | HTTP library |
Sebelum memulai instalasi, pastikan sistem Anda memiliki:
- Python 3.10 atau lebih baru โ Download Python
- pip (package manager Python) โ biasanya sudah termasuk dalam instalasi Python
- Git (opsional) โ untuk clone repository
Verifikasi instalasi Python dan pip:
python --version
# Output: Python 3.10.x atau lebih baru
pip --version
# Output: pip 2x.x.x from ...
โ ๏ธ Catatan untuk Windows: Gunakanpythonataupysesuai konfigurasi sistem Anda.
# Menggunakan Git
git clone https://github.com/username/PySec-Audit-Website.git
cd PySec-Audit-Website
# Atau download ZIP dan extract, lalu masuk ke direktori
cd PySec-Audit-Website2Virtual environment digunakan untuk mengisolasi dependencies proyek agar tidak bentrok dengan paket Python global.
# Membuat virtual environment bernama 'venv'
python -m venv venv# Membuat virtual environment bernama 'venv'
python3 -m venv venv๐ก Tips: Anda bisa mengganti
venvdengan nama lain, misalnyaenvatau.venv:python -m venv .venv
venv\Scripts\activatevenv\Scripts\Activate.ps1
โ ๏ธ PowerShell Execution Policy: Jika muncul error, jalankan dulu:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
source venv/Scripts/activatesource venv/bin/activateSetelah aktivasi, terminal Anda akan menampilkan prefix (venv):
(venv) C:\Users\NFI\...\PySec-Audit-Website>
Untuk memastikan Python yang digunakan adalah dari virtual environment:
# Windows
where python
# Linux/macOS
which pythonOutput harus menunjuk ke direktori venv/.
deactivateSetelah virtual environment aktif, install semua dependencies:
pip install -r requirements.txtVerifikasi instalasi:
pip listOutput harus menampilkan Flask, Gunicorn, requests, beautifulsoup4, lxml, dan urllib3.
Untuk development/testing lokal dengan auto-reload:
python app.pyAplikasi akan berjalan di:
- Local:
http://127.0.0.1:5000 - Network:
http://[IP-Anda]:5000
๐ก Mode debug aktif secara default di development mode.
Untuk production menggunakan Gunicorn (Linux/macOS):
gunicorn app:app --bind 0.0.0.0:5000 --workers 4 --timeout 120Atau menggunakan Procfile:
# Menggunakan heroku local atau foreman
heroku local web
# Atau langsung
gunicorn app:app --bind 0.0.0.0:${PORT:-5000} --workers 4 --timeout 120
โ ๏ธ Catatan: Gunicorn hanya berjalan di Linux/macOS. Untuk Windows, gunakanwaitresssebagai alternatif:pip install waitress waitress-serve --port=5000 app:app
- Buka halaman Backdoor Scanner dari sidebar
- Pilih tab Path Scan
- Masukkan path direktori website, contoh:
- Windows:
C:\inetpub\wwwrootatauC:\xampp\htdocs - Linux:
/var/www/htmlatau/home/user/public_html
- Windows:
- Atur Max Depth (kedalaman scan) dan Max Files (batas file)
- Klik Start Scan
- Pilih tab URL Scan
- Masukkan URL target, contoh:
https://example.com - Atur Timeout (batas waktu koneksi)
- Klik Start URL Scan
- Buka halaman Gambling Detector dari sidebar
- Pilih tab Path Scan
- Masukkan path direktori website yang dicurigai
- Klik Start Scan
- Pilih tab URL Scan
- Masukkan URL website yang dicurigai terinfeksi script judi
- Klik Start URL Scan
| Level | Warna | Deskripsi |
|---|---|---|
| ๐ด Critical | Merah | Ancaman kritis, file backdoor/webshell teridentifikasi |
| ๐ High | Oranye | Ancaman tinggi, kode berbahaya ditemukan |
| ๐ก Medium | Kuning | Ancaman sedang, pola mencurigakan terdeteksi |
| ๐ต Low | Biru | Ancaman rendah, informasi sensitivitas ringan |
| โช Info | Abu-abu | Informasi tambahan, tidak mengancam |
| Method | Endpoint | Deskripsi |
|---|---|---|
GET |
/ |
Dashboard utama |
GET |
/backdoor-scanner |
Halaman backdoor scanner |
GET |
/gambling-detector |
Halaman gambling detector |
GET |
/results/<scan_id> |
Halaman hasil scan |
POST |
/api/scan/backdoor/path |
Scan backdoor di path lokal |
POST |
/api/scan/backdoor/url |
Scan backdoor via URL |
POST |
/api/scan/gambling/path |
Scan gambling di path lokal |
POST |
/api/scan/gambling/url |
Scan gambling via URL |
GET |
/api/scan/results/<scan_id> |
Ambil hasil scan (JSON) |
GET |
/api/scan/export/<scan_id> |
Export hasil scan (download JSON) |
GET |
/api/scans/history |
Riwayat semua scan |
curl -X POST http://localhost:5000/api/scan/backdoor/path \
-H "Content-Type: application/json" \
-d '{"path": "/var/www/html", "max_depth": 10, "max_files": 10000}'curl -X POST http://localhost:5000/api/scan/backdoor/url \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "timeout": 10}'curl -X POST http://localhost:5000/api/scan/gambling/path \
-H "Content-Type: application/json" \
-d '{"path": "/var/www/html", "max_depth": 10, "max_files": 10000}'curl -X POST http://localhost:5000/api/scan/gambling/url \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "timeout": 10}'{
"scan_id": "a1b2c3d4",
"result": {
"scan_path": "/var/www/html",
"scan_time": "2026-03-07T06:00:00",
"total_files_scanned": 1250,
"total_threats_found": 3,
"findings": [
{
"file": "uploads/image.jpg.php",
"threat_level": "critical",
"findings": [
{
"type": "double_extension",
"pattern": "Double extension trick: image.jpg.php",
"match_count": 1,
"severity": "critical"
}
]
}
],
"summary": {
"critical": 2,
"high": 1,
"medium": 0,
"low": 0,
"info": 0
},
"status": "completed"
}
}File: scanners/backdoor_scanner.py
Scanner ini menganalisis file-file di direktori lokal dengan metode:
- Extension Check โ Memeriksa ekstensi file berbahaya:
.php,.phtml,.phar,.asp,.aspx,.jsp,.cgi,.pl,.sh,.bat, dll. - Content Signature Analysis โ Mencocokkan 100+ pola regex:
- Code execution:
eval(),assert(),exec(),system(),shell_exec(),passthru() - Encoding/Obfuscation:
base64_decode(),gzinflate(),str_rot13(),hex2bin() - Superglobals:
$_GET,$_POST,$_REQUEST,$_FILES - File ops:
move_uploaded_file(),file_put_contents(),fwrite() - Known shells: c99, r57, b374k, WSO, FilesMan, AnonymousFox, Alfa Shell
- Code execution:
- Image Analysis โ Scan file gambar (PNG, JPG, GIF, ICO) untuk kode PHP/script tersembunyi
- Entropy Analysis โ Hitung Shannon entropy untuk deteksi obfuscation
- Known Webshell Filenames โ Database 40+ nama file webshell yang diketahui
File: scanners/url_scanner.py
Scanner ini menganalisis website via HTTP:
- Header Analysis โ Periksa security headers yang hilang dan information disclosure
- Content Analysis โ Scan HTML untuk form, input, textarea mencurigakan
- Link Analysis โ Ekstrak semua link dan cocokkan dengan pola URL webshell
- Path Probing โ Probe 40+ path webshell umum (shell.php, cmd.php, c99.php, dll.)
- Hidden Iframe Detection โ Deteksi iframe tersembunyi dengan style display:none
- Obfuscated JS Detection โ Identifikasi JavaScript yang di-obfuscate dengan eval()
File: scanners/gambling_scanner.py
Scanner ini mendeteksi script judi online dengan:
- 80+ Gambling Keywords โ slot gacor, judi online, togel, pragmatic play, sbobet, dll.
- Gambling Domain Patterns โ slot*.com, judi*.com, togel*.com, dll.
- JavaScript Injection โ Deteksi injeksi JS gambling (popup, redirect, banner)
- SEO Spam Patterns โ display:none + gambling content, text-indent:-9999px
- Hidden Iframe Analysis โ Iframe tersembunyi yang mengarah ke situs gambling
- Redirect Detection โ window.location, meta refresh, PHP header() ke situs judi
- Filename Analysis โ File dengan nama mengandung kata gambling
File: scanners/gambling_url_scanner.py
Scanner ini menganalisis website untuk konten gambling:
- Title & Meta Analysis โ Periksa title, description, keywords untuk kata kunci gambling
- Body Content Scan โ Analisis seluruh konten halaman
- Hidden Element Detection โ Temukan div/span tersembunyi berisi konten gambling
- Iframe Scanning โ Deteksi iframe ke domain gambling
- Redirect Analysis โ JavaScript redirect, meta refresh, server redirect
- Link Scanning โ Periksa semua link ke domain gambling
- Script Inspection โ Analisis inline dan external script
- Cloaking Detection โ Bandingkan konten Googlebot vs user browser
File konfigurasi: config.py
| Parameter | Default | Deskripsi |
|---|---|---|
SECRET_KEY |
Auto-generated | Secret key Flask untuk session |
MAX_CONTENT_LENGTH |
16 MB | Batas ukuran upload |
SCAN_TIMEOUT |
300 detik | Batas waktu scan |
MAX_SCAN_DEPTH |
10 | Kedalaman rekursi direktori |
MAX_FILES_SCAN |
10.000 | Batas file per sesi scan |
URL_CRAWL_DEPTH |
3 | Kedalaman crawl URL |
URL_REQUEST_TIMEOUT |
10 detik | Timeout per HTTP request |
Environment variables yang didukung:
# Set environment ke production
export FLASK_ENV=production
# Set secret key custom
export SECRET_KEY=your-super-secret-key-here
# Set port custom
export PORT=8080# 1. Login ke Heroku
heroku login
# 2. Buat aplikasi baru
heroku create pysec-audit
# 3. Push ke Heroku
git init
git add .
git commit -m "Initial commit"
git push heroku main
# 4. Buka aplikasi
heroku openProcfile sudah dikonfigurasi:
web: gunicorn app:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120
# 1. SSH ke server
ssh user@your-server-ip
# 2. Clone repository
git clone https://github.com/username/PySec-Audit-Website2.git
cd PySec-Audit-Website2
# 3. Setup virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 4. Jalankan dengan Gunicorn
gunicorn app:app --bind 0.0.0.0:5000 --workers 4 --timeout 120 --daemon
# 5. (Opsional) Setup Nginx reverse proxy
# Buat file /etc/nginx/sites-available/pysec-audit:
#
# server {
# listen 80;
# server_name yourdomain.com;
#
# location / {
# proxy_pass http://127.0.0.1:5000;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# }
# }# Pastikan virtual environment aktif
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/macOS
# Reinstall dependencies
pip install -r requirements.txtJalankan aplikasi dengan hak akses yang sesuai, atau pastikan user memiliki akses baca ke direktori target.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser# Ganti port
python app.py # Edit PORT di environment variable
# Atau
export PORT=8080
python app.pyGunicorn tidak support Windows secara native. Gunakan alternatif:
pip install waitress
waitress-serve --port=5000 app:appProyek ini dilisensikan di bawah Apache Version 2 License.
๐ก๏ธ PySec Audit โ Dibuat untuk keamanan website Indonesia ๐ฎ๐ฉ
```
