473,569 Members | 2,845 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

spoofing question

Hi. I have an ASP page which stores a cookie. That cookie is then read on a
different server. This is the crux of an ASP / JSP bridge I am creating for
allowing a user to seemlessly switch from an ASP service to a JSP service
and have their session state returned to them.

My question is, is there any way a hacker can spoof a cookie in a request?

Thanks

S
Jul 19 '05 #1
11 2035

"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:eE******** ******@TK2MSFTN GP09.phx.gbl...

My question is, is there any way a hacker can spoof a cookie in a request?


Yes.

Ray at work
Jul 19 '05 #2

"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:uL******** ******@TK2MSFTN GP12.phx.gbl...

"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:eE******** ******@TK2MSFTN GP09.phx.gbl...

My question is, is there any way a hacker can spoof a cookie in a request?


Yes.

Ray at work


Darn. How? NOW I do not want to spoof anyone. I want to make sure I do not
create spoofable stuff. I have to understand how the spoof is done. Probably
my idea is not salvagable. (Which is a drag.) But I guess I would still like
to know. I suppose I could encryt...

Thanks

S
Jul 19 '05 #3

"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:OJ******** *****@TK2MSFTNG P11.phx.gbl...

"Ray at <%=sLocation% > [MVP]" <myfirstname at lane34 dot com> wrote in
message news:uL******** ******@TK2MSFTN GP12.phx.gbl...

"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:eE******** ******@TK2MSFTN GP09.phx.gbl...

My question is, is there any way a hacker can spoof a cookie in a request?
Yes.

Ray at work


Darn. How? NOW I do not want to spoof anyone. I want to make sure I do not
create spoofable stuff. I have to understand how the spoof is done.

Probably my idea is not salvagable. (Which is a drag.) But I guess I would still like to know. I suppose I could encryt...

Thanks

S


Never mind. That was a dubm question. I tend to forget that a web browser is
not the only thing capable of creating an http request.

S
Jul 19 '05 #4

"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:OJ******** *****@TK2MSFTNG P11.phx.gbl...

Darn. How? NOW I do not want to spoof anyone. I want to make sure I do not
create spoofable stuff. I have to understand how the spoof is done. Probably my idea is not salvagable. (Which is a drag.) But I guess I would still like to know. I suppose I could encryt...


I don't really know exactly how, since I'm an honest non-hacking person. ;]
But, I've written some vbscript code before to send http requests to sites
with cookies for legitimate reasons. I could put in bogus values if I
wanted to.

Cookies are a nice convenience tool, but shouldn't really be used as a
security tool if possible.

Ray at work
Jul 19 '05 #5
"Stephanie Stowe" wrote:

My question is, is there any way a hacker can spoof a cookie
in a request?

Yes.


Darn. How? NOW I do not want to spoof anyone. I want to make
sure I do not create spoofable stuff.


It rather depends on what you mean by "spoofable" . Are you trying to prevent
someone from guessing a cookie value? Are you trying to prevent multiple
users from sharing (knowingly or not) access to the same session/record?

I assume from your original post that this is a session management question,
in which case you may be concerned about either of the above.

If your ASP and JSP services have access to the same data store, you can
pass the session id through the cookie (or even the QueryString) and store
shared session variables in the DB. A SQL Server GUID might be useful for
generating "unguessabl e" session IDs. See this for pros and cons:
http://www.devx.com/dbzone/Article/10167

As for restricting access, the receiving script can compare various Request
headers (REMOTE_HOST, USER_AGENT, HTTP_ACCEPT, etc.) to those stored in the
DB by the sending script (in the record matching the shared session ID).
Some of the headers to consider are in this list of ServerVariables :
http://msdn.microsoft.com/library/en...rvariables.asp

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6

"Dave Anderson" <GT**********@s pammotel.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Stephanie Stowe" wrote:

My question is, is there any way a hacker can spoof a cookie
in a request?

Yes.
Darn. How? NOW I do not want to spoof anyone. I want to make
sure I do not create spoofable stuff.


It rather depends on what you mean by "spoofable" . Are you trying to

prevent someone from guessing a cookie value? Are you trying to prevent multiple
users from sharing (knowingly or not) access to the same session/record?

Both. The accessing the same session/record I am concerned about in a
separate post that I will be making after replying to this one. The question
I asked was about guessing the session id.
I assume from your original post that this is a session management question, in which case you may be concerned about either of the above.

If your ASP and JSP services have access to the same data store, you can
pass the session id through the cookie (or even the QueryString) and store
shared session variables in the DB. A SQL Server GUID might be useful for
generating "unguessabl e" session IDs. See this for pros and cons:
http://www.devx.com/dbzone/Article/10167
I am not at liberty to do this as I do not have SQL Server. We use DB2 on
the iSeries. More in a new post this am.
As for restricting access, the receiving script can compare various Request headers (REMOTE_HOST, USER_AGENT, HTTP_ACCEPT, etc.) to those stored in the DB by the sending script (in the record matching the shared session ID).
Some of the headers to consider are in this list of ServerVariables :
http://msdn.microsoft.com/library/en...rvariables.asp


Thanks.

S
Jul 19 '05 #7
"Stephanie Stowe" wrote:
http://www.devx.com/dbzone/Article/10167


I am not at liberty to do this as I do not have SQL Server. We use
DB2 on the iSeries. More in a new post this am.


The GUID suggestion was merely one way of creating an "unguessabl e" session
id. You don't need SQL Server to create one:

[JScript example]
Server.CreateOb ject("Scriptlet .TypeLib").GUID .replace(/[{}]/g,"")
(The object has a .GUID string property)

You certainly can implement your own, for that matter. For example, you
could randomly generate a string of digits and check your db for uniqueness.

How many digits would suffice? Suppose you use the GUID as an example of a
sufficient space. There are (2^8)^16 (or
3.4028236692093 846346337460743 177e+38) possible values. Using just the
characters [0-9], you would need 38.53 characters to cover the same range of
values. Using [A-Z], you would need 27.23 characters. Combining them,
[A-Z0-9] requires strings of length 24.76, [a-zA-Z] needs 22.45, [A-Za-z0-9]
needs 21.50 characters.

Obviously, there is no such thing as a string of length 38.53. But by
choosing 39 character strings of [0-9], you guarantee a space at least as
large as the GUID space. Does that seem like ling strings? Consider that it
takes 32 hex characters to express a 16-byte GUID value.

Some of the same pitfalls apply to self-generated session ids as to GUIDs,
BTW. Their length makes them make poor primary keys, for example.

For what it's worth, script-based random number generation is not exactly
random.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #8
You can create a GUID in an ASP script using the scripting.typel ib object. I
don't have the exact code handy but it should be on some of the ASP sites.

One thing to note however is that a GUID is built according to specific
rules so it is not "unguessabl e". It is very unlikely to be guessed however.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Stephanie Stowe" <st***@whackthi svsac.org> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..

"Dave Anderson" <GT**********@s pammotel.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
"Stephanie Stowe" wrote:

My question is, is there any way a hacker can spoof a cookie
in a request?
>
> Yes.

Darn. How? NOW I do not want to spoof anyone. I want to make
sure I do not create spoofable stuff.
It rather depends on what you mean by "spoofable" . Are you trying to

prevent
someone from guessing a cookie value? Are you trying to prevent multiple
users from sharing (knowingly or not) access to the same session/record?


Both. The accessing the same session/record I am concerned about in a
separate post that I will be making after replying to this one. The

question I asked was about guessing the session id.
I assume from your original post that this is a session management

question,
in which case you may be concerned about either of the above.

If your ASP and JSP services have access to the same data store, you can
pass the session id through the cookie (or even the QueryString) and store shared session variables in the DB. A SQL Server GUID might be useful for generating "unguessabl e" session IDs. See this for pros and cons:
http://www.devx.com/dbzone/Article/10167

I am not at liberty to do this as I do not have SQL Server. We use DB2 on
the iSeries. More in a new post this am.
As for restricting access, the receiving script can compare various

Request
headers (REMOTE_HOST, USER_AGENT, HTTP_ACCEPT, etc.) to those stored in

the
DB by the sending script (in the record matching the shared session ID).
Some of the headers to consider are in this list of ServerVariables :
http://msdn.microsoft.com/library/en...rvariables.asp


Thanks.

S

Jul 19 '05 #9
"Mark Schupp" wrote:

One thing to note however is that a GUID is built according to
specific rules so it is not "unguessabl e". It is very unlikely
to be guessed however.


I would think the ability to guess it would be considerably easier if the
MAC address used to generate it is known. So here's a challenge -- tell me
the MAC Address that generated this GUID:

89C9B0FE-2EDE-4BA9-96F0-84C629EA1146
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1471
by: Matt | last post by:
I want to know how ASP prevents "Spoofing" to happen?? Someone told me in ASP.NET, the server validation can prevent "Spoofing" to happen. Please advise.
11
15755
by: Rod Hilton | last post by:
Hey everyone, Does anyone know if it's possible to spoof a referral using Javascript - as in, when I go from web site A to web site B, if B uses php or javascript or something to see the referring site, instead of site A they see site C, which A does something to make B see? I'm trying to write a script for a site that will allow someone...
1
2144
by: CW | last post by:
It's recommended that when signing on using FormsAuthentication, one should do so over a secure (SSL) channel. If I understand FormsAuthentication mechanism correctly, the Authentication ticket generated is then appended to every single page requests that need to be authorized. Thus, if I only use SSL to protect the SignIn page but not the...
79
3729
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially...
4
1675
by: Mufasa | last post by:
I have a website that somebody is trying to hack with SQL Injection. (He was already successful but I have fixed the vulnerability) I have already fixed the website so it's 'safe' from the injection. I even have it redirect to another web site (not mine but an innocuous third party) when it get's things that don't match my criteria. Is...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.