Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
Jan 2009 Free Giveaway Sponsor - Black Hat DC
Scooby Doo and the Crypto Caper - Answers and Winners
Daemon - A Contest Revealed
Hacking: The Art of Exploitation 2nd Edition
Nov 2008 Free Giveaway - Winners
Dec 2008 Free Giveaway Sponsor - SANS
Santa Claus is Hacking to Town
Plug-N-Play Network Hacking
Nov 2008 Free Giveaway Sponsor - CWNP
Daemon - A Contest Begins Now
It Happened One Friday - Answers and Winners
Daemon - A Contest
Scooby Doo and the Crypto Caper
MS Blue Hat Hackers Headline Chicago Security Con
The Pen Testing Perfect Storm Webcast Series with Skoudis, Wright, Johnson
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 21 guests and 3 members online
EH-Net Donations
Enter Amount:
$
CAD
USD
GBP
AUD
JPY
EUR
Google Ads
EH-Net News Feeds
Latest Additions
Book Recommendations
You are here:
Home
Forum
Ethical Hacking Discussions and Related Certifications
Network Pen Testing
cookie problem
Ethical Hacker Community Forums
January 09, 2009, 05:15:25 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: ChicagoCon 2009 - May 4 - 9. Boot Camps & an Ethical Hacking Conf.
www.chicagocon.com
Home
Help
Calendar
Login
Register
Ethical Hacker Community Forums
>
Ethical Hacking Discussions and Related Certifications
>
Network Pen Testing
(Moderator:
don
) >
cookie problem
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: cookie problem (Read 1674 times)
0 Members and 1 Guest are viewing this topic.
lovewadhwa
Newbie
Offline
Posts: 15
cookie problem
«
on:
November 08, 2008, 03:44:26 AM »
Hi all
Have a problem to discuss.I have ram cookies enabled instead of hard disk cookies for my application.Now while auditing my application, i opened the login page on a machine and login inside with the required credentials.Then on the other machine i copied the ram cookies from the browser into the browser running on other machine say machine2. The i fetched the url from the previous machine (which was the url which i got after logging in) and ran it on the machine2 browser.I got logged in.Believe though i used the ram cookies and copied it,but still need some way or idea to implement in my application so that even if someone could have my ram cookies for the running session, he should not be able to login.
What logic/intelligence should i insert in my application?
Logged
lovewadhwa@gmail.com
Craig
EH-Net Columnist
Jr. Member
Offline
Posts: 63
Re: cookie problem
«
Reply #1 on:
November 08, 2008, 12:02:57 PM »
From your post I am assuming that you are creating a Web application. I will also assume that when you talk about "RAM cookies" you are referring to session cookies. While session cookies will be destroyed when the browser closes, they are sent to a Web server in the exact same manner that any other cookie is sent, so there is no way for you to determine if a cookie has been saved to disk or not.
If you are concerned about the security of your session cookies, keep these points in mind:
Session cookies are usually captured by an attacker via packet sniffing or XSS attacks. Using SSL and sanitizing user input to prevent XSS will go a long way in ensuring the security of your cookies.
Cookies can also be marked as http-only, which prevents JavaScript code from accessing them.
I don't know what language you are writing your application in, but most languages have built in support for session cookies, and will automatically time out the session cookies after a pre-defined period. This way, even if a session cookie is compromised, it will only be useful for a finite period of time.
If you are concerned about preventing client impersonation, also ensure that you protect your application against CSRF attacks.
Hope this helps.
«
Last Edit: November 08, 2008, 12:04:33 PM by Craig
»
Logged
http://www.sourcesec.com
apollo
Jr. Member
Offline
Posts: 51
Re: cookie problem
«
Reply #2 on:
November 08, 2008, 01:23:29 PM »
I agree with Craig, but on top of the things that Craig mentioned, the answer partially depends on what you are trying to protect. If you were a banking institution then the answer would be different than an online forum.
Unfortunately due to proxy use in some of the larger ISP's, the IP address is a bad thing to use for security. There will be some users who will get denied just becase of their ISP.
The security is to have your sessions themselves timeout after a short period of time if you can. That is why if you go and get a cup of coffee while you are on a bank site you will find yourself logged out. Unfortunately allowing short session times doesn't work with everything. For instance, it isn't much fun when your session times out while you are trying to make a post on a forum. So you have to balance the two. For a bank, maybe 10 minute session timeouts. For forums, maybe 2 hour timeouts.
You can also tie some client information to the session if it is important that the information remain safe. This won't stop people who are very creative, but does raise the bar some, and for automated attacks may cause fewer problems. For instance, keep the user agent in the server stores session, if the user agent changes, log the person out. Browsers are also pretty noisy in many occasions as to what they will tell you when they make a request. Adding in something random like the Accept-Charset field which is accessible from most applications may make it secure enough to deter someone who isn't overly intent on messing with you.
Overall, the best way to prevent session theft is to make sure that your website is properly coded and you have input validation issues handled. Making sure you have good input validation will go a long way to preventing XSS, SQL Injection and a few other types of attacks. Check out the OWASP top 10 for common ways to prevent application problems.
Hope this helps!
Logged
lovewadhwa
Newbie
Offline
Posts: 15
Re: cookie problem
«
Reply #3 on:
November 12, 2008, 06:50:47 AM »
Ok thats fine.But still have a problem.Take the scenario in this way.
I have an application in which the session cookies are stored.The application is commercial application and login is allowed only over a single machine.But i have cookies built for my application in such a way that a person in the same network can use the cookies and login over another machine.Now if i insert the logic of ip address in my cookie , means if i start accessing the ip from which the request was made, i cannot do so as ISPs and the client machine ip may change dynamically very frequently.So i need to know if i could insert any logic to build my cookies so that i have such information of the client that he cannot be impersonated by anybody else or the same login could be used on some another machine.Hope i have been able to explain the problem.
Logged
lovewadhwa@gmail.com
Craig
EH-Net Columnist
Jr. Member
Offline
Posts: 63
Re: cookie problem
«
Reply #4 on:
November 12, 2008, 07:28:12 PM »
I understand what you're saying, but I'm afraid your logic is flawed; you want to be able to send some un-encrypted token (i.e., the cookie) across an un-secured network, and have that token tied to only your IP address, even though the Web server has no way of knowing for sure what your IP address is. I think the better solution is to simply encrypt the traffic to prevent cookie theft in the first place. However, if you really want to tie it to some dynamic IP address, you could set up a dynamic DNS solution where your computer, no matter where it is or what IP address it has, updates a specific DNS entry whenever its IP address changes. When your web application sees a request come in, it can lookup the DNS entry and see if the IP that the entry resolves to is the same IP that made the request. Of course, you have to ensure that whatever dynamic DNS solution you choose is secure, because otherwise someone could sniff your credentials for that and update your DNS host name with their own IP address (starting to get into the chicken-and-egg problem here). Remember also that this will not protect you against XSS and CSRF attacks.
I think that the best solution to your problem is to follow the guidelines that apollo and myself have already laid out: protect your application against XSS and CSRF, prevent JavaScript from accessing your cookies, and encrypt your traffic. This will help keep third parties from getting your cookie in the first place. Of course, you could also set up an SSH tunnel to your Web server that then connects back to itself on port 80 of the loop back interface - it would probably be slow, but really secure!
Logged
http://www.sourcesec.com
lovewadhwa
Newbie
Offline
Posts: 15
Re: cookie problem
«
Reply #5 on:
November 14, 2008, 03:43:18 AM »
Thanx a lot 4 the response.One more scenario i have 4 which i need solution.It goes as below:
I have a login page of my application.The action associated with the login page is to call authentication check script which checks the username and password from my database and if valid allows login.Now If someone builds the same page on some other domain and specifies the action of that page as my application script being called on my server.This will allow him to access the username and paswords and then redirect to actual page on my server which is shown when the login is correct.Can i check if the login request is being made from my domain or some other.I have the option of seeing referrer but believe the same can be blocked/played with to launch the attack.I need a solution so that the same can be stopped.Please help.
Logged
lovewadhwa@gmail.com
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Special Events
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009
=> News Items and General Discussion About EH-Net
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> Certification
===> The Charter Study Group - Pen Test
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
=====> CEH - Official Course Modules v4
=====> CEH - Official Course Modules v5
=====> CEH - Official Course Modules v6
===> CPTS - Certified Pen Testing Specialist
=====> CPTS - Official Course Modules v5
===> CPTE - Certified Pen Testing Expert
=====> CPTE - Official Course Modules v1
===> ECSA - EC-Council Certified Security Analyst
=====> ECSA - Official Course Modules v1.2
=====> ECSA / LPT - Official Course Modules v3
===> OSCP - Offensive Security Certified Professional
===> GPEN - GIAC Certified Penetration Tester
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
=====> CHFI - Official Course Modules v2
===> EnCE - EnCase® Certified Examiner
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Hardware
=> Malware
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Gates
=> Heffner
=> Hoffman
=> RichM
=> Murray
=> J. Peltier
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
Loading...
Sponsors
Polls
How many security events including conferences and training do you attend a year:
1 - 2
3 - 4
5 - 6
7+
None - But want to
None - Choose not to
Support EH-Net
Support EH-Net by
Buying all of your
Amazon items using
the search bar above.
Try CBT Nuggets Free!
Recent Forum Topics
Wireless
: WEP cracking, how to ping router?
(2) by
duffman984
Oct 2008 - Scooby Doo and the Crypto Caper
: Skillz October 08 Winning Entry - Creative
(2) by
rforsythe
Other
: Windows 7 Beta Available Tomorrow
(3) by
jason
Book Reviews
: Need a book suggestion!
(5) by
unicityd
OSCP - Offensive Security Certified Professional
: Offensive Security Releases Sample Pen Testing Report
(2) by
Chan
Web Applications
: Determine URL from IP address
(3) by
scottr
Malware
: uninstall trend mciro officescan clients
(2) by
Hack_80
Other
: openSUSE 11.1 Released
(0) by
don
Other
: Insanity?
(5) by
jason
Other
: Fedora Hits the 10 Spot
(0) by
don
Other
: FreeBSD 7.1 Released
(0) by
don
OSCP - Offensive Security Certified Professional
: Next Up OSCP101 v2.0
(39) by
don
Tools
: Core Impact Essentials
(0) by
sgt_mjc
News from the Outside World
: Google branching out a little further...
(3) by
jason
Physical Security
: Magnetic stripe card spoofing
(5) by
jason
Gates
: Oracle version module for metasploit
(3) by
RoleReversal
Malware
: THe website is Evil but what to do??
(3) by
NickFnord
CEH - Certified Ethical Hacker
: Helow... help some tutorials...
(7) by
K3lV1n
CEH - Certified Ethical Hacker
: CEH is a scam
(20) by
K3lV1n
Mass Media
: Daniel Suarez Interview
(9) by
blackazarro
Malware
: Security Forecast for 2009
(5) by
jason
News from the Outside World
: Is this acceptable?
(9) by
jason
Wireless
: Wireless Pen Testing Cards
(6) by
jason
Oct 2008 - Scooby Doo and the Crypto Caper
: Skillz October 08 Winning Entry - Technical
(1) by
jason
Book Reviews
: [Article]-Mitnick - The Art Of Intrusion: Ch 1 - Hacking The Casinos For A Million Bu...
(5) by
jason
Links to cool sites.
: Free Computer Engineering Classes From Stanford
(3) by
jason
Oct 2008 - Scooby Doo and the Crypto Caper
: [Article]-Scooby Doo and the Crypto Caper - Answers and Winners
(2) by
jason
News Items and General Discussion About EH-Net
: [Article]-Jan 2009 Free Giveaway Sponsor - Black Hat DC
(1) by
jason
News Items and General Discussion About EH-Net
: EH-Net Milestone - 2 Articles Cross 1 Million Page Views
(3) by
BillV
Other
: What kind of lab, machines you have for your security testing?
(12) by
charlottebandit
Malware
: Network Virus Problem
(9) by
RoleReversal
Wireless
: WUSB600N good usb ?
(2) by
nap191
Other
: FBI code cracking challenge
(3) by
jimbob
Calendar Of Events
: RSA 2009
(0) by
don
Forensics
: Network Forensic tools/practice/techniques
(2) by
jimbob
Malware
: Autoplay when i try to open the drive.
(4) by
jimbob
CEH - Certified Ethical Hacker
: Any Practice Environment for learning tool for CEH?
(15) by
don
Wireless
: a petri-dish bridge
(2) by
don
CEH - Certified Ethical Hacker
: TFTP Tranfer time out
(5) by
jason
Tools
: tool to trace users
(8) by
pseud0
Vote For EH-Net
progenic.com
binarica.com
technorati fave
Privacy Notice
for TDCC & All Properties
© 2009 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.