Malware notification

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
7/9/2012 4:17:53 AM
Gravatar
Total Posts 220

Malware notification

Hi Joe,

first of all: When I visit www.cafe-rizz.de (a mojo site), on every page my 'F-Secure Internet Security' works and after a while it tells me, that it removed a Trojan that was coming from that site.

My friend who is the owner of the site, received the following e-mail from Google Search Quality Team:

-------- Original-Nachricht --------
Datum: Mon, 09 Jul 2012 06:05:59 +0000
Von: noreply@google.com
An: abuse@cafe-rizz.de, admin@cafe-rizz.de, administrator@cafe-rizz.de, contact@cafe-rizz.de, info@cafe-rizz.de, postmaster@cafe-rizz.de, support@cafe-rizz.de, webmaster@cafe-rizz.de
Betreff: Malware notification regarding cafe-rizz.de

Dear site owner or webmaster of cafe-rizz.de,
We recently discovered that some of your pages can cause users to be infected with malicious software. We have begun showing a warning page to users who visit these pages by clicking a search result on Google.com.
Below are some example URLs on your site which can cause users to be infected (space inserted to prevent accidental clicking in case your mail client auto-links URLs):
http://cafe-rizz .de/
http://www.cafe-rizz .de/
Here is a link to a sample warning page:
http://www.google.com/interstitial?url=http%3A//cafe-rizz.de/
We strongly encourage you to investigate this immediately to protect your visitors. Although some sites intentionally distribute malicious software, in many cases the webmaster is unaware because:
1) the site was compromised
2) the site doesn't monitor for malicious user-contributed content
3) the site displays content from an ad network that has a malicious advertiser
If your site was compromised, it's important to not only remove the malicious (and usually hidden) content from your pages, but to also identify and fix the vulnerability. We suggest contacting your hosting provider if you are unsure of how to proceed. StopBadware also has a resource page for securing compromised sites:
http://www.stopbadware.org/home/security
Once you've secured your site, you can request that the warning be removed by visiting
http://www.google.com/support/webmasters/bin/answer.py?answer=45432
and requesting a review. If your site is no longer harmful to users, we will remove the warning.
Sincerely,
Google Search Quality Team

 

I cannot imagine, were this trojan resides within the site ....

Best
Matthias

 

 

7/9/2012 6:42:19 AM
Gravatar
Total Posts 18439

Re: Malware notification

Hi Mathias,

I tried to access your site to see if I could spot the malware but first I got a warning that it was compromised, I clicked to ignore that since I was using the Firefox noscript plugin to protect me but it then shows a 403 access denied. My goal was to view the source of the page and look for malicious scripts.

Most likely some malicious javascript is being served by pages in  your site. This could only happen if someone managed to upload, edit or replace files in your site or if they were able to login with edit permissions to ad content directly.

I would inspect the layout.master file of your skin and default.aspx in the root and other files to see if they contain any javascript that you did not put there yourself. For the infection to be on every page it is most likely in one of these files (rather than something added to the content by editing) since they are used for most pages.

You didn't mention what version of mojoPortal, do you know what version you are running?.

To protect your site, it is very very important to use a custom machine key and it is best to lock down as much of the file system as possible as indicated in our post installation checklist.

Without forensic analysis there is no way for me to know at this point how your site was compromised. It would be good to download your IIS web logs as it is possible that clues can be found there as to how the site was compromised. I'd be interested in reviewing those logs myself if you could zip them and send them to me.

Best,

Joe

 

7/9/2012 8:21:52 AM
Gravatar
Total Posts 220

Re: Malware notification

Hi Joe,

Thank you for your rapid and detailed response.
As a first aid I replaced the default.aspx in order to prevent further downloads of this Trojan.I
t's embarrassing enough that now in Google behind the links to the site it is written, that the site is dangerous.
I will gladly send you some logs.

Best
Matthias

 

7/9/2012 11:22:21 AM
Gravatar
Total Posts 18439

Re: Malware notification

Hi Mathias,

After inspecting your home page using the Firefox NoScript plugin which protects me by blocking all javascript from executing, I was ablke to determine that the following javascript files included on your home page have been infected with malicious javascript added to the end of the files:

/ClientScript/greybox/gbcombined.js
/ClientScript/jqmojo/jquery.cluetip.js
/ClientScript/oomph/oomph.min.js

possibly other files were also infected.

The best solution to fix the immediate problem would be to delete the entire /ClientScript folder and then upload it again from the mojoPortal package corresponding to your current version of mojoPortal.

But after that the concern remains about how those files got infected. I did not see any evidence of malicious activity in the IIS logs you sent but it is possible that older log files would have something.

However it is also possible that you were infected due to bad hosting configuration, ie if some other web site is using the same application pool or the same identity user as your application pool then that user has file system permissions beyond just your own site and the attack could have been launched on another site but from there it went through all folders that it had write permissions looking for js files to infect. I would ask your host if any other sites on that server have been infected.

Before deleting those files it would be good to note the last modified time to determine exactly when they were infected, this would help determine which log files to look in and may correspond to other site infection on this server that your host may already know about.

Hope that helps,

Joe

7/9/2012 1:26:39 PM
Gravatar
Total Posts 220

Re: Malware notification

Hi Joe,

the last modified time of the javascript files you listed below is 09.07.2012

Can the database be infected?
If not, wouldn't it be a good idea to delete all files on the server, upgrade the website to the latest version and obey your Post Installation Checklist? When the Trojan comes again, it is obviously, that it comes from another website on the server ...

Best
Matthias

7/9/2012 1:59:33 PM
Gravatar
Total Posts 18439

Re: Malware notification

Hi Mathias,

I saw no evidence of infection coming from database content. SQL injection would be a completely different type of attack and I'm very confident that there is no vulnerability for sql injection in mojoPortal code.

Your site was infected by a file system attack that modified files in your web site. Since the infection date is within range of the log files that you sent and since those log files contain no evidence of file uploads I would conclude that the files were infected by an attack on a different web site and that file system permissions allowed that attack to modify files in your web site. This means your host is using the same user on your application pool as on other sites or using the same application pool for other sites. Unless that is corrected the problem could come back. The only other explanation is if a real person with direct server access purposely infected your site, ie an employee at the host, but the first scenario of bad security configuration seems more likely. I don't want to accuse your host of poor configuration but this is what the evidence leads me to believe.

It would be best if your host can provide a unique user and a unique application pool for your site and remove all file system permission from your site folders and files for any other users except those needed to run and manage your site and not use the same app pool or user for other sites.

I agree that other files besides js files could have been infected though I did not see any evidence of it. It would be best to upgrade but I would want to make sure the permissions are fixed first so that you can be sure the problem won't happen again. The host may not want to admit to any problem with their configuration and if they deny any possibility of the configuration being insecure I would be very skeptical.

You could also look around the file system for any other files with the same modification date and that would make me suspect that other files have also been compromised.

The only other attack vector for files would be ftp but that seems very unlikely because the files were appended to rather than replaced and they still contain the original javascript that is supposed to be there but has bad javascript added to the bottom of each file. It seems much more likely to be some automated attack that went looking around the file system for any js files it could add code to. 

Actually that modified date 2012-07-09 is today which makes me think the infecting code is still active on the server and may still be infecting files and may re-infect them if you fix them. If I were your host I would be looking into that and looking for files (especially js files) in all customer sites that have recent updates to js files. So again before uploading new files I would want to be sure the underlying problem is fixed, something on that server has been compromised and is infecting sites on the server, it does not appear that your site was specifically attacked or that there is any mojoPortal vulnerability, but something on the server is infecting all the js files it has permission to infect. I think it is very very likely that other sites on the server are infected and one of those sites was the initial site that was compromised but poor file system security has allowed it to spread.

Hope your host can resolve the problem. Let me know if I can be of further help.

Best,

Joe

 

7/9/2012 2:02:35 PM
Gravatar
Total Posts 18439

Re: Malware notification

Also note that you can find out which folders are writable from Administration > Security  Advisor

and if possible in your web control panel mark all folders as read only except for /Data and /App_Data

If you can do that then no further infection should be possible and you can upgrade then check it again using Security Advisor to make sure nothing changed during upgrade.

Best,

Joe

7/10/2012 3:52:14 PM
Gravatar
Total Posts 220

Re: Malware notification

Hi Joe,

thank you very much for now.

I will keep you informed.

Meanwhile: Cheers!

Best Matthias

7/11/2012 8:04:41 AM
Gravatar
Total Posts 18439

Re: Malware notification

Hi Matthias,

Many thanks as always for the beers! Much appreciated.

Cheers,

Joe

7/11/2012 9:30:38 AM
Gravatar
Total Posts 220

Re: Malware notification

Hi Joe,

can I find the version number in the database?

Best
Matthias

7/11/2012 10:35:56 AM
Gravatar
Total Posts 18439

Re: Malware notification

Hi Matthias,

You can find it under Administration > System Info

or in the database in the mp_SchemaVersion table, the row for mojoportal-core

Thanks again for the beers!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.