Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: Modifing non-persistent cookies |
|---|---|
| Date: | Mon, 12 Dec 2005 08:29:57 +0200 |
I am looking for an application that can modify a non-persistent cookies value permanently (while the browser is open).
I am testing a web app where a UserID=Number is set in the browser. If I change this number to another ID I can access other users functions, but I don't want to have to manually change it with each request using a web proxy.
Does anyone have some other ideas?
Cheers
There are a couple of ways of doing this with WebScarab:
2) Using the Beanshell scripting plugin.
There are two places that you can do this, it is up to you which you choose.
a) Via the Proxy->BeanShell plugin
Hit the checkbox to enable the plugin.
Write a snippet of Java code to modify the Cookie header appropriately:
e.g.
cookie = request.getHeader("Cookie");
cookies = cookie.split("; *");
cookie = "";
for (i = 0; i< cookies.length; i++) {
nv = cookies[i].split("=", 2);
if (nv[0].equals("yourcookiename") {
nv[1] = "yournewvalue";
}
cookie = cookie + "; ";
}
cookie = cookie.substring(2);
request.setHeader("Cookie", cookie);
response = nextplugin.fetchResponse(request);
return response;The exact code may vary, but I hope you get the idea.
When your code is finished, hit the commit button to activate it.
b) The other method is via the Tools->ScriptManager.
Select the Proxy node, and then "Intercept Request"
Add the following line at the top:
request = connection.getRequest();
and then replace the last 2 lines with:
connection.setRequest(request);
Summary =======
Rogan (the author of WebScarab ;-) )
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Modifing non-persistent cookies, Dean H. Saxe |
|---|---|
| Next by Date: | Re: Security of magic_quotes_gpc under PHP against SQL injection, Peter Conrad |
| Previous by Thread: | Re: Modifing non-persistent cookies, Dean H. Saxe |
| Next by Thread: | RE: Modifing non-persistent cookies, Luke Fraser |
| Indexes: | [Date] [Thread] [Top] [All Lists] |