How to use Javascript to Change Pages
(note this isn't for illegal activities, it is for education and maybe to help future developers to see errors in their design...basically just a header to make sure my thread isn't flamed :))
Okay so today we are going to learn how to use javascript to dynamically change web page content. First a small example:
Go to your url bar and type
Quote:
javascript:alert(document.cookie)
and low and behold there is your cookie data for this site! Now here comes the cool thing, you can do is actually enter any information you want into that cookie. All you have to do is void the original data and then place your own data in there. For example, I am going to change my userid:
Quote:
javascript:void(document.cookie="bbuserid=1")
My user ID is now 1. Lets just say that there is a site that doesn't compare info in the cookie, it only compares data entered into the log in form....hey it can happen.
Next, you can actually change content of the page itself. I am only going to list one example, but it is a very handy example: altering Forms.
Every form on a page (unless otherwise named) is labled forms[0]-forms[x] where x is the last form on the page (btw x is a variable that represents a number...not x).
To access each form just
Quote:
javascript:alert(document.forms[0])
and you will probobly reacieve an alert saying "[object]." So what you do is look for a field in that form; how about the forms action?
Quote:
javascript:void(document.forms[1].action="GET")
That form has now reversed its purpose.
For more info, read a book! And feel free to post other ideas or add to this.