![]() |
|
[TUT]Make your own SQLI Lab and and practice [TUT] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43) +----- Forum: SQL Injection Attacks (https://hackforums.net/forumdisplay.php?fid=103) +----- Thread: [TUT]Make your own SQLI Lab and and practice [TUT] (/showthread.php?tid=4861523) |
[TUT]Make your own SQLI Lab and and practice [TUT] - Aakash_Choudhary - Jun 12, 2015 Hi friends i am CodeNinja a.k.a. Aakash Choudhary. Today i will help you to make your own sqli lab where you can practice sql injection in your localhost. Requirement :- 1. XAMPP/LAMPP 2. Basic knowledge of PHP & MySQL NOTE: Save all this files in you localhost folder. Step 1:- Here is my code of sql ---> PHP Code Save this file as "webtest.sql" If you want to create database,tables,columns and insert data yourself with code then here is some codes but always remind that it is only for to increase your knowledge in MySQL 👍 ------ Some commands for Basic of mysql with example :- 1. Create Database :- Code CREATE DATABASE webtest;2. Create Tables :- Code CREATE TABLE `students` (Here i create "student" table and 5 columns -----> "id","firstname","lastname","email","password" & int(6) mean id is integer value with 6 length & varchar(30) mean we take name with 30 length & AUTO_INCREMENT mean it will increment id value automatic like 1,2,3 etc etc & PRIMARY KEY mean id is our primary key (main key) 3.Insert our data in those columns :- Code INSERT INTO `students` (`id`, `firstname`, `lastname`, `email`, `password`) VALUESSo this is all which we can do manually but i have given you my sql file to save your time. 😝 ------ Step 2 :- Make a php file and save following codes in that PHP Code Save this php file as "integer.php" Step 3 :- Make another php file and save following codes in php file PHP Code Save this file as "connection.php" . Now browse your localhost in your browser ---> http://localhost/lab/integer.php?id=1 and you will see page. Now if you want practice string based sql injection then just change following line :- PHP Code with this PHP Code Notice :- id = ' $id ' <===== I use quoted to make it string based. So when you type :- id=1' order by 100--+ then you will see error by putting ' so it is string based. Now if you want to practice with double quatation ( " ) instead of single ( ' ) then here is the code :- PHP Code Here if you type :- id=1") order by 100--+ then you will see error otherwise not if you use id=1') order by 100--+ So this is small tutorial for you so enjoy this. Also if you have any question, problem and if i have done any mistake then tell me.Next time i will tell about putting WAF when i learn it completely. Thanks 🤝 🎉 Hope you like it. * - Th3PonyWizard - Jun 12, 2015 A very nice tutorial. However, I don't want people taking this as an excuse to avoid learning PHP / SQL. * - saheenshoukath - Jun 13, 2015 N9c tut CodeNinja.Thanks for sharing ur knowledge :) * - ketankul.2010 - Jun 14, 2015 setting dis lab in my arch <3 .thnx buddy. * - •^v^–[ bLacKn3x ]–^v^• - Jun 21, 2015 when i open localhost/integer.php?id=1 i get only white page .what is my problem? * - Dum De Dum - Jun 21, 2015 Nice tut, it's a nice easy way to practice for all new people. * - Aakash_Choudhary - Jun 22, 2015 (Jun 21, 2015 01:04 PM)Blacknex158 Wrote: when i open localhost/integer.php?id=1 i get only white page .what is my problem? PM me for get my skype. Then i will help you live * - NIIGHT HAWKE - Jun 24, 2015 Nice tutorial, keep the good work upcoming. * - •^v^–[ bLacKn3x ]–^v^• - Jun 24, 2015 okay now i got it .you forgot in your code include("connection.php) . Thanks for that it helps me a lot for understanding this more * - xx 0x0 xx - Jun 24, 2015 this is good tutorial for who wanna be injector i like it nice work dude * - zoombierobo - Sep 19, 2015 Thank you very much for this. I got idea to make vulnerable web application now. :D * - Aakash_Choudhary - Apr 8, 2016 Posting so that many beginners learn from my tutorial Thanks * - indianehacker - Apr 17, 2017 good job...................................................................... * - mutybyte - Jul 24, 2017 Wow thank you for this tutorial. Once i learn php and mysql i will use this tutorial. Bookmarked it. My mentor told me to learn php and mysql and then build vulnerable application so i searched in forum and got this awesome tutorial. Don't know why he is no active ? * - ronnyprice - Jul 24, 2017 Thanks for this! Trying to learn PHP and SQL but this definitely helps me feel like I can actually use my skills, in the interim. |