Thursday, January 10, 2019

Fix / Patch Bug SQL injection [ Protect Website From Hacker ]

Fix / Patch Bug SQL injection [ Protect Website From Hacker ]



Halo sobat rafli haxor, pada kesempataan kali ini saya mau share cara fix Bug SQL Injection di Website mu. Tips and trick ini sudah 100% teruji oleh saya dan saya jamin tahan sql injection. tapi sebelum itu kalian harus tahu dulu apa itu sql injection.

SQL Injection

A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application. A successful SQL injection exploit can read sensitive data from the database, modify database data (Insert/Update/Delete), execute administration operations on the database (such as shutdown the DBMS), recover the content of a given file present on the DBMS file system and in some cases issue commands to the operating system. SQL injection attacks are a type of injection attack, in which SQL commands are injected into data-plane input in order to effect the execution of predefined SQL commands.

Source : OWASP

Nah sekarang kalian sudah tahukan apa itu sql injection, sudah pasti ini sangat berbahaya karena masuk top 10 Vulnerability di OAWSP hingga sekarang.

How To Patch

Kalian pasti ingin memperbaikinya kan ? ya pasti lah makanya kalian berkunjung ke blog ini kan ? wkawak.

1. Buka File yang melakukan Get / Post terhadap database,,, misal.
$id = $_GET['id'];
kalo url bakal seperti ini : .php?id=[id]
2. Kita Lakukan Filter di kode tersebut dengan menggunakan fungsi str_replace seperti ini.
$iso = $_GET['id'];$filter = array('concat', 'make_set', 'export_set', '!', 'null', 'and', 'false', 'true', 'sleep', 'or', 'select', 'extractvalue', 'from', 'dual', '-', '+'. '', '%23', '%27', 'by', 'select', 'union', 'order', '(', ')');$replace = "";$id = str_replace($filter, $replace, $iso);
*Jika Terdapat error pada $replace anda bisa menggunakan array seperti ini :$replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
3. Save Filenya
4. Test di server anda seharusnya sudah terprotect dari sql injection (blind, extrackvalue, union based, error based)

Terimakasih telah berkunjung kewebsite saya, saya harap kalian senang dan jangan sungkan sungkan untuk berkunjung kewebsite saya lagi.
BTW : Maafkan bila 1klan nya numpuk ea.

Tags : Perbaiki sql injection, fix sql injection, bypass sql injection, sql injection, cara fix sql injection, fix bug sql injection, patch sql injection, patching sql injection
Load disqus comments

0 comments