Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Cookie Bug Exploit.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cookie Bug Exploit.

 Post Reply Post Reply Page  12>
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: Cookie Bug Exploit.
    Posted: 10 August 2005 at 2:05pm
I suffered a pretty severe hack recently and I've been talking to the hacker since. He disclosed to me that he gained access to the site by a "cookie bug." Using this he was able to get admin. access then using that he uploaded some scripts, which gave him access to my system. Any ideas?
David.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2005 at 4:05pm
is he willing to share his method for the security of the forum software?
where is this cookie bug .

somewhere he has tried to get the Usercode and insert the cookie into his system and therefore able to access admin area

not sure, ask if he will share more info
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2005 at 5:49pm
There are tons of exploits out there.  If you're on a shared hosting server, then your site is only as secure the server itself and the least secure site running on that same machine.  Hackers are liars and con artists who train continuously to improve their skills at deception and misdirection.  They'll intentionally leave trails that lead to the wrong conclusion about the source of insecurity.  While you're focusing on the security of your forum, you and your host are NOT looking at the file and folder permissions to C:\Windows (or c:\winnt on your server).
 
Not to say that WWF is not a vector for attack, it absolutely is one way to escalate access to a site and server.  Especially if WWF has not been installed and configured in a secure method.
 
I recently had one of the sites I maintain get hacked.  I was using an older version of WWF that didn't yet have the upload capability, yet the hacker still chose to cause damage only to the forum.  I suspect they do that because forums are the most visited part of most sites that have forums.  I found a hacker tool planted in the forum folder.  But, knowing that WWF could not have been used to upload the hacker tool and that I had no anonymous FTP account, I began searching for the origin.  With only the anonymous IIS user account, I was able to navigate to the root of the c: drive, see all files there and in the windows and system32 folders.  I could download, upload, and delete files.  I could get to all other sites sharing the same server and modify the contents of their folders.  Still as anonymous, I could download the forum's MDB file, make changes, including changing the password, then upload the changes replacing the original MDB.  Basically, there was almost nothing I could NOT do.  I could have utterly destroyed the entire server.  I suspect that the hacker dropped his utility on my site from another site hosted on the same machine.
 
If the hacker will give you more details, we'll all be better off.  My feeling is that a real hacker would not talk to you at all, while a wanna-bee, script kiddie, is probably mis-directing you.
 
Make sure you follow the WWF installation directions to the end to make your data as secure as possible.  Keep incremental backups of the data.  Periodically check the Admin email address and password hash & salt for changes.  Ask your host if the "Everyone" account can read the root of C:, C:\Winnt; and C:\Winnt\System32.  Your host might not even admit it, but most hosts have the default user rights still and are at extreme risk.
 
My 2 cents.
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2005 at 5:31am
I'm always on a quest to further enhance, further secure my applications, specially user authentication/authorization, and one cause for concern I have is this cookie impersonation bussiness.

All my apps use cookies to maintain login state, I know there's tools out there that can write custom cookies in ones system, but the user still have to know the victims user ID and whatever else, which makes me think that there's more to this than just set a cookie with the victims data on it.

I have changed all my apps to store cookie logged info encoded [ messThis(usrID) ] then just unmessThis() to read back, this should make it more difficult for a hacker to understand cookie data and therefore re-create it.

Cookie wise, what else can one do to secure cookies?
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2005 at 5:48am
The problem with using encoding for the cookie in an application that can be downloaded by anyone, like web wiz forums, is that you also have to include the code to un-encode the cookie.

This means that a hacker can simply use the un-encode part of the forums code to un-encode any cookies
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2005 at 6:09am
That can be solved using a salt, now this salt can be generated on app install and stored on the Author table as cookSalt or something, and you could make this salt unique in space and time by using the user IP and system time (no one in the world would be using the same IP at the same time) then a hacker can't decode because he doesn't know the salt.

I'm talking about encoding here not encryption, encoding can do a good job and it's processing penalties are negligible compared to more complex encryption.
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2005 at 11:44am
Originally posted by theSCIENTIST theSCIENTIST wrote:

...one cause for concern I have is this cookie impersonation bussiness. 

I know there's tools out there that can write custom cookies in ones system, but the user still have to know the victims user ID and whatever else, which makes me think that there's more to this than just set a cookie with the victims data on it.

I have changed all my apps to store cookie logged info encoded [ messThis(usrID) ] then just unmessThis() to read back, this should make it more difficult for a hacker to understand cookie data and therefore re-create it.

Cookie wise, what else can one do to secure cookies?
 
I think the meaningful cookie here is the one that is stored to automatically log a user in.  But the vulnerability here is not WWF, but everywhere else.  Take the Admin account for example.  The cookie contains the user_code which is the username ("administrator") with a randomly generated minimum 10 digit hex code appended to the end ("824AAZE76F", for example).  So in order to create a fake cookie that will log in someone else as the admin, the attacker must also guess the user_code, not just the username.  Even knowing the algorithm that built the hex extension, guessing the hex extension is no trivial task.  It seems to me that it is more likely that a hacker will acquire the cookie by dumb luck or by exploiting some other vulnerability outside of the WWF code.  Cross-site scripting and a couple dozen other security holes IE, Outlook, IIS, and Windows, viruses, spyware, trojans, man-in-th-middle, packet sniffing, etc. etc. could all be used to attack the PC used by the administrator or the server itself.  The hacker is probably not going to tell you how he did it.
 
However, that made me think of your last question.  What can be done to make cookies more secure?
 
The point of such a cookie is to eliminate the need to log in, so it would be self defeating to require a password of any kind.  Even if you encrypt the cookie contents with an unbreakable cipher, what happens if someone else acquires that exact cookie?  The trick, I guess, is to make that cookie meaningless if it's used from a different computer and preventing modification or construction of a cookie that WOULD work somewhere else.
 
If the encrypted cookie contained some information that was unique to the PC that asked for the cookie, the cookie could be made useless anywhere else.  But how do you get reliably unique information about the person's PC?  You could use a Java applet to pull hardware data from the system, but that probably will not work for a significant number of computer devices in the world.
 
Instead of storing the user_code, you could store some encrypted representation that includes the user's IP address, that way, an attacker has to decrypt the cookie to get the user_code and encrypt their own fake cookie, or guess the user_code and spoof the IP.  This wouldn't change the vulnerability to all the other attacks, but forging a meaningful cookie would be even more difficult.
 
Or, create an encrypted code to store in the cookie and log the code and the IP address in a separate database.  When someone tries to use that cookie, the server will only allow it if it comes from the stored IP.
 
All is lost if the data is compromised at the server level though.
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 11 August 2005 at 3:41pm
Interesting reading.

The problem here is that I hear time and time again about how some app was hacked bacause the cookie was stealed, how the heck so?

The other part of the problem is that I can't re-create this hack, therefore can't effectively secure against it, what I'm doing, is, securing based on guess work, if someone was to create a fake cookie he would need these variables with these values, so lets get those values all scrambled up and variables with less meaningful names of what they do.

Comparing against the IP, defies the purpose of using cookies to auto-login, since many ISPs still assign IPs dinamically, not fixed, maybe when IP v6 comes into place, ISPs will then assign a fixed IP to all customers, which in it-self should allow us developers to go into many new directions.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.