SQL Injection ( For Newbies Part 4 ) _ _ Nabil Rahman

Let's Learn About Sql Injection 



First, SQLi করার জন্য আমাদের যে কোন সাইটের vulnerable point বা injection point Find Kra Lgbe. URL এর শেষে যে .php?id=3 বা কোন parameter থাকে ওইটাতে injection করতে হবে । এখন দেখার হচ্ছে, এটা কত রকমে থাকে , এবং পাবো কিভাবে ।

- How to find Vuln sites ?

বিভিন্ন Dork ব্যাবহার করে, অথবা সাইটে visit করে । (Here Dorks list)

Example _ inurl:.php?id= site:demo.com

এবারে URL এর শেষে .php?

id= এইটা কত রকমের হতে পারে তার কিছু নমুনা নিচে দিয়ে দিয়েছি,
যা যা রকমে এটা থাকে,
.php?id=45
.php?id=result
.php?rsult=student
.php?catid=3
.php?p=4
.php?id=Mw== //(base64)
যেমন,
http://christukula.co.in/event.php?id=78
http://www.orascomci.com/index.php?id=talentprogram
http://www.sherrihill.com/content.php?id=registration
http://www.sciencedomain.org/page.php?id=reviewers-editors
http://www.esuprobhat.com/index.php?page=1&date=2015-03-14
http://www.aksimgroup.com/pDetails.php?pid=68

- এখন আমরা কিভাবে জানতে পারি এই সাইটটি SQLi vulnerable কি না ?

Our Target Site : http://testphp.vulnweb.com/artists.php?artist=1

Parameter এর শেষ এ (এখানে parameter value 1 যেহেতু artists=1) Special Character দিতে হয় । তাহলে এই 1 এর শেষে Special Character দিতে হবে,
Example _  http://testphp.vulnweb.com/artists.php?artist=1'

Special Character দেয়ার পর যদি, কোন error দেয় তবে মনে করবেন site vulnerable , error বিভিন্ন রকমে দিতে পারে।




বেশির ভাগই লেখা আসে যে ,

[1]
Query failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1

or

[2]
(Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Inetpub\vhosts\jayapriya.com\httpdocs\gallery.php on line 11)

আবার অনেক ক্ষেত্রে সাইটে পরিবর্তন আসে , যেমন কোন ছবি নাই হয়ে যায়, বা পেজ ছোট হয়ে যায় , বা সাইট এর যে কোন পরিবর্তন হয় তবে সাইট তাকে vulnerable বলতে পারি । অদ্য কথা হচ্ছে Special Character দেয়ার পরে যদি সাইটে কোন রকম পরিবর্তন আসে তবে sqli হতে পারে ।


Post a Comment

Do leave your comment