MODUL 6 WEB SECURITY [DVWA] Tujuan Pembelajaran 1. Mahasiswa memahami SQL Injection 2. Mahasiswa dapat melakukan SQL Injection 3. Mahasiswa dapat menemukan celah keamanan pada web
Dasar Teori Damn Vulnerable Web Application (DVWA) adalah kumpulan tool hacking web berbasis PHP/mySQL. DVWA dapat menjadi pilihan bagi hacking web pemula untuk mempelajari teknik web hacking dari awal. Beragam teknik serangan web hacking dapat diperoleh dari tool ini. Selain mudah digunakan, ringan dan lengkap, DVWA dijalankan melalui server local (localhost) menggunakan aplikasi WAMP/XAMP/LAMP dan lainya. DVWA menyertakan beberapa tool web hacking seperti: - SQL Injection - XSS (Cross Site Scripting) - LFI (Local File Inclusion) - RFI (Remote File Inclusion) - Command Execution - Upload Script - Login Brute Force
SQL Injection SQL injection adalah serangan yang memanfaatkan kelalaian dari website yang mengijinkan user untuk menginputkan data tertentu tanpa melakukan filter terhadap malicious character. Inputan tersebut biasanya di masukan pada box search atau bagian-bagian tertentu dari website yang berinteraksi dengan database SQL dari situs tersebut. Perintah yang dimasukan para attacker biasanya adalah sebuah data yang mengandung link tertentu yang mengarahkan para korban ke website khusus yang digunakan para attacker untuk mengambil data pribadi korban.
Percobaan Topologi
Note : Disarankan untuk menggunakan jaringan yang masih dalam satu subnet jaringan.
Pada percobaan ini di rekomendasikan untuk menggunakan Virtual Box 1. Buka Virtual Box 2. Klik New
Klik Next. 3. Alokasikan untuk RAM 1248
4. Lakukan pengaturan pada bagian Network
5. Masukkan virtual disk.
Lakukan penghapusan pada virtual disk yang ada.
6. Masukkan vdi yang Ubuntu server.
Setelah server yang akan di lakukan penyerangan sudah siap dan sudah bisa di akses / sudah terkoneksi dalam satu jaringan dengan komputer yang akan melakukan penyerangan, maka sudah bisa melakukan percobaan penyerangan.
Silahkan
lakukan
scanning
terlebih
mengetahui IP server yang akan di serang.
dahulu
untuk
-
Login to DVWA o
o
Instructions: 1. Start up Firefox on BackTrack 2. Place http://(IP address server ubuntu) /dvwa/login.php in the address bar. 3. Login: admin 4. Password: password 5. Click on Login
-
Set DVWA Security Level o
o
Instructions: 1. Click on DVWA Security, in the left hand menu. 2. Select "low" 3. Click Submit
-
SQL Injection Menu o
o
Instructions: 1. Select "SQL Injection" from the left navigation menu.
-
Basic Injection o
o
Instructions: 1. Input "1" into the text box. 2. Click Submit. 3. Note, webpage/code is supposed to print ID, First name, and Surname to the screen. Notes(FYI): Below is the PHP select statement that we will be exploiting, specifically $id. $getid = "SELECT first_name, last_name FROM users WHERE user_id = '$id'";
o
-
Always True Scenario o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' or '0'='0 1. Click Submit Notes(FYI): In this scenario, we are saying display all record that are false and all records that are true. %' - Will probably not be equal to anything, and will be false. '0'='0' - Is equal to true, because 0 will always equal 0. Database Statement mysql> SELECT first_name, last_name FROM users WHERE user_id = '%' or '0'='0';
o
o
-
Display Database Version o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' or 0=0 union select null, version() # 1. Click Submit Notes(FYI): Notice in the last displayed line, 5.1.60 is displayed in the surname. This is the version of the mysql database.
o
o
-
Display Database User o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' or 0=0 union select null, user() # Notes(FYI): Notice in the last displayed line, root@localhost is displayed in the surname. This is the name of the database user that executed the behind the scenes PHP code.
o
o
-
Display Database Name o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' or 0=0 union select null, database() # Notes(FYI): Notice in the last displayed line, dvwa is displayed in the surname. This is the name of the database.
o
o
-
Display all tables in information_schema o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' and 1=0 union select null, table_name from information_schema.tables # 1. Click Submit Notes(FYI): Now we are displaying all the tables in the information_schema database. The INFORMATION_SCHEMA is the information database, the place that stores information about all the other databases that the MySQL server maintains.
o
o
-
Display all the user tables in information_schema o
Instructions: 0. Input the below text into the User ID Textbox (See Picture). %' and 1=0 union select null, table_name from information_schema.tables where table_name like 'user%'# 1. Click Submit Notes(FYI): Now we are displaying all the tables that start with the prefix "user" in the information_schema database.
o
o
-
Selanjutnya silakah kalian cari username dan password untuk akses server sebagai admin Setelah dapat username dan password maka kalian akan menemukan akses sebagai “root”
Tugas Praktikum Cari password untuk akses ke dalam server sebagai “root”
Clue : Jelajah rumah,,,,,
Referensi : www.computersecuritystudent.com