Wednesday, January 02, 2008

Cookie editing through javascript injection



JS injection is a technique which allows you to alter the content of a site without leaving the site. This can be used to spoof the server which is using javasript.

Requirements
1) A javascript enabled browser ( I will say use Mozilla Firefox)
2) A webpage which uses cookies ( For ex orkut)

Procedure

First check that the site has any cookie do this by

javascript:alert(document.cookie);

after this you will get an alert box showing you the cookie of the site with various fields

to edit the cookie use the following script

javascript:void(document.cookie="fieldname=value");

replace fieldname with the name of the field which you want to alter and value with the altered value

and you have just edited the cookie!!! you can verify it by usin alert(document।cookie) option.

आशीष कुमार

0 comments: