You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 79 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Cookie RSA Encryption: the Ultimate protection! [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
djechelon
Nuke Soldier
Nuke Soldier


Joined: Nov 11, 2004
Posts: 10


PostPosted: Fri May 20, 2005 2:02 pm Reply with quoteBack to top

Hi there,
I'm an expert PHP coder with experience on the PHP-Nuke platform.

Im working at phpMyBitTorrent BMS [Bittorrent Management System] Project on http://phpmybittorrent.com.
A few minutes ago I just implemented RSA Cookie Encryption in phpMyBitTorrent. I know that fake cookies are a huge problem for PHP-Nuke Admins. This is why I had this idea for my PHP software.

As you may know, PHP Nuke cookies are base64 encoded, so it's easy to encode fake ones and try to bypass security. Once I made myself a UNION fix on admin.php, for an attack that submitted via HTTP POST a fake Admin cookie. Then I just blocked GET and POST submissions of $admin. I knew it was not enough. What if hackers open a socket and submit a fake cookie through there?

The final solution is to ENCRYPT authentication cookies using RSA algorithm by Rivest/Shamir/Adelman. RSA, for those who don't know, is based on two keys, one for encoding a text string, and one for decoding it.
The encryption key is usually made public. I won't deal with this matter more...

What if you encrypt a cookie with two PRIVATE keys? Nobody will be able, because they haven't the public key, to submit cookies made by them. Only webserver, after logging the user in, can generate a valid key. Like the activation key on PHP Nuke itself.

I found a PHP RSA library and I converted it into a class called "RSA" Very Happy. I added a few parameters on config.php (I mean phpMyBitTorrent's one) and edited cookie functions. These are
cookie_encode(&$cookie);
cookie_decode($cookie);
If RSA engine is enabled, cookies are encrypted that way!
I'm also providing phpMyBitTorrent of a smart and simple key generator, needed to use the engine. UNFORTUNATELY, I noticed that key length cannot be like the 3072 bits ones we can use on SSH, since PHP seems to not accept numbers coded on more than 24 bits for the key product.

A 24 bits key is really weak if compared even to 128 bits length. The primes array is also small so a hacker with a brute force attack can easily discover the key after a number of attempts I haven't computed yet, but I can assure to be not so long... Still, this encryption, because of the keys, helps reducing the effects of a new cookie attack if discovered. Unlike the HTML page used to hack my PHP Nuke, it will be more complicated to use a cookie attack since nobody is provided with the public key.

It can be an idea to port that script, after testing it for a while, to PHP Nuke. At this time you WON'T find ANY RSA on phpMyBitTorrent Release Package nor CVS Repository. Even if tests are going excellent, this is still experimental, and won't be commited to CVS until some days.
Meanwhile, I ask PHP Nuke Community's opinion on this encryption system. I'll take care of porting it to PHP Nuke in the most transparent way, if you help me find the files to edit.

_________________
DJ Echelon
Master of Bit Torrent

WEBMASTER OF http://www.p2pmania.it
CHIEF ENGINEER OF http://phpmybittorrent.com Open Source Bit Torrent Portal
Find all posts by djechelonView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Fri May 20, 2005 8:57 pm Reply with quoteBack to top

Looks rather interesting. You'd have to do the same with the phpBB files as well. But I think its quite feasible.

This is my attempt a modification for cookies, using the actual phpBB configuration to declare the cookie settings.
It should help you in figuring out what to edit too
http://www.nukecops.com/postt40947.html

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.284 Seconds - 361 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::