Scriptvirus

Deutschsprachiger Support für CMS Made Simple
Post Reply
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm

Scriptvirus

Post by TeXnik »

Ich musste meine Seite von Netz nehemen. Ein Scriptvirus (Dank an Nan fuer die Entdeckung) JS/Dldr.IFrame.IT hat sich dort eingenistet.

DerVirus JS/Dldr.IFrame.xxx befaellt die index.htm und haengt sich dort an. Das script oeffenet ein I-Frame der Groesse 0 und laedt dann von einer anderen Seite Schadsoftware runter.
This trojan creates 2 invisible iframes in infected HTML pages. An iframe is a component that allows a browser to display web-pages inside other web-pages. This trojan will load infected web-pages inside other (possibly clean) pages. It will first create an invisible iframe (height = 0), and then will attempt to detect what browser is he running in. Depending on the detected browser, it will load infected web-pages in the iframe. It will also mark the machines where it was already ran by creating a cookie.
Vor einiger Zeit war mir schon eine Veraenderung in den indedx.htm aufgefallen, ohne, dass ich ein Virus dachte, ich vermutete einen Hack. Hab dann alle files geloescht und neu installiert, .htaccess eingerichtet, alle index.htm manuell auf 444 gesetzt und auch das admin-verzeichnis umbenannt. 6 Monate fast hatte ich Ruhe, bis gestern wieder die index.htm geaendert wurden.

Gibt es einen Virenscanner Webspace? Ich will nicht schon Naechte um die Ohren schlagen und alles manuell ausfuehren. Und gibt es weitere Tips solche Einschleusungen zu unterbinden?
Ich kann zwar meinen Webspace als virtuelles Laufwerk einbinden, aber alle Scanner haengen sich auf, wenn dieses virtuelle Laufwerk untersucht werden soll.
nockenfell
Power Poster
Power Poster
Posts: 751
Joined: Fri Sep 12, 2008 2:34 pm

Re: Scriptvirus

Post by nockenfell »

Google Analytics bietet seit neustem einen Service mit dem man seine Seite überwachen kann.

Hast du die Sicherheitseinstellungen von CMSms in der .htaccess eingebaut?
http://forum.cmsmadesimple.org/index.php/topic,25541.0.html
[this message is written with 100% recycled bits]
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm

Re: Scriptvirus

Post by TeXnik »

Ich hab den ganzen Webspace mit einer solchen .htaccess gesichert.

Nachtrag:
Die Version  xxxx.IT beschreibt nicht nur index.ht* sondern auch index.php

Koennte man nicht mit einem cronjob alle index.* auf dieses Script durchsuchen:

Code: Select all

<__script__>var fr=unescape('...');document.write(fr);</__script>
Wenn das auftaucht ueber phpmail benachrichtigen, sodass man zuegig eingreifen kann.

Meine beiden Rechner, mit denen ich zugreife sind frei von Malware, naja so sicher sich man mit den aktuellen Scannern sein kann. Nur ich greife darauf zu und habe auch erst vor kurzem die PW und den FTP-Zugang veraendert. Ich verstehe nicht, wie die Files von aussen geaendert werden koennen? Da nach dem letzten Mal alles haendischh auf 444 gestzt wurde. So kommt eigentlich nur ein FTP Zugriff in Frage.
Last edited by Anonymous on Sat Oct 17, 2009 3:19 pm, edited 1 time in total.
nockenfell
Power Poster
Power Poster
Posts: 751
Joined: Fri Sep 12, 2008 2:34 pm

Re: Scriptvirus

Post by nockenfell »

TeXnik wrote: Koennte man nicht mit einem cronjob alle index.* auf dieses Script durchsuchen:

Code: Select all

<__script__>var fr=unescape('zensiert');document.write(fr);</__script>
Als erstes solltest du hier keinen Schad-Code posten! Du kannst diesen verstückeln, aber nicht komplett posten.
Ein Cronjob könntest du durchaus einrichten. Du könntest dabei mit 'find' nach 'unescape' suchen. Dies wird als Suchbegriff reichen, da wahrscheinlich nur solche Scriptvirus sich so verstecken wollen. Anhaltspunkte dazu findest du z.B. hier:
http://linuxnetz.wordpress.com/2009/07/24/findgrep/

Wenn du ein Webhoster hast, der Cronjobs ausführt, gibt es dazu meist im ControlPanel eine Möglichkeit sich das Resultat des Cronjobs per Mail zusenden zu lassen. Falls du nur ein Mail bei gefundenem Suchbegriff haben willst, müsstest du das mit php und exec aufbauen. Habe ich selber noch nie gemacht, ich nehme jedoch an, dass man damit auch die Ausgabe der Konsole aufgreifen und weiterverarbeiten kann.
Ich verstehe nicht, wie die Files von aussen geaendert werden koennen? Da nach dem letzten Mal alles haendischh auf 444 gestzt wurde. So kommt eigentlich nur ein FTP Zugriff in Frage.
Hast du noch anderes als cmsms auf dem Webspace laufen? Wenn Apache mit den FTP Nutzerrechten läuft, ist eine Infektion natürlich einfacher.
Last edited by nockenfell on Sat Oct 17, 2009 10:30 am, edited 1 time in total.
[this message is written with 100% recycled bits]
cyberman

Re: Scriptvirus

Post by cyberman »

nockenfell wrote: Als erstes solltest du hier keinen Schad-Code posten!
Habs raus genommen!

@TeXnik

Hast du den Security-Thread vollständig umgesetzt, auch diesen Teil

http://forum.cmsmadesimple.org/index.ph ... #msg138655
replytomk3

Re: Scriptvirus

Post by replytomk3 »

TeXnik, will you understand instructions in English?
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm

Re: Scriptvirus

Post by TeXnik »

Sorry, war gedankenlos  von mir, es sollte eine Hilfe beim Durchsuchen sein, da ich nicht weiß was relevant und was nicht ist. Bin halt kein Virenprogrammierer.


Ich habe auf dem Webspace 3 cmsms laufen, alle sind betroffen, soweit ich bisher sehen kann, sind nicht nur index Dateien betroffen, sondern auch login.php und home.php.
Ich hab es endlich geschafft, daß ein AV den Webspace durchsucht, der Suchlauf ist nun schon 12h im Gang und immer noch beendet. Wenn weitere Dateien betroffen sind poste ich das.

Die .htaccess hatte ich im Serverroot, soll die in jedem Rootverzeichnis der Installationen sein?
Nachtrag, stimmt nicht dich hatte diese .htaccess in jedem Installationsroot:

Code: Select all

RewriteEngine On

#option to remove directory listings in all folder (avoid publishing unwanted contents)
Options -Indexes

# Deny access to config.php
# This can be useful if php ever breaks or dies
# Use with caution, this may break other functions of CMSms that use a config.php
# file.  This may also break other programs you have running under your CMSms
# install that use config.php.  You may need to add another .htaccess file to those
# directories to specifically allow config.php.

<Files "config.php">
    order allow,deny
    deny from all
</Files>


# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]

#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]

#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]

#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

#OR if the script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

#OR if any script is trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]

#OR if the URI contains UNION
RewriteCond %{QUERY_STRING} UNION [OR]

#OR if the URI contains a double slash
RewriteCond %{QUERY_STRING} // [OR]

#OR if the URI contains a *
RewriteCond %{QUERY_STRING} \*

#then deny the request (403)
RewriteRule ^.*$ - [F,L]

# End URL Filtering


# No sense advertising what we are running
ServerSignature Off

# HTTP response header forced to be "Server: Apache" only
# Sometimes this istruction must be saved inside httpd.conf or apache.conf or sites-enabled instead of .htaccess
ServerTokens Prod

# Spambots nach User_agent aussperren
RewriteCond %{HTTP_USER_AGENT} ^.*Whacker.*$ [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
RewriteCond %{HTTP_USER_AGENT} ^.*FileHound.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*TurnitinBot.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*JoBo.*$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*adressendeutschland.*$
RewriteCond %{HTTP_USER_AGENT} ^libwww [OR]
RewriteCond %{QUERY_STRING} ^(.*)=http://(.*) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]

RewriteRule ^.* - [F]

php_flag allow_url_fopen on

@replytomk3
No problem to converse in English, most of my conversation are done in English and I am using the German Board mainly not loose my mothertongue. I really appreciate any help to get my sites running again.
Last edited by TeXnik on Sat Oct 17, 2009 10:19 pm, edited 1 time in total.
replytomk3

Re: Scriptvirus

Post by replytomk3 »

Question: why not just backup, install new cmsms, and restore from backup? The complicated route (or a static HTML site) is described below.

Here is a guideline that you can follow:

1) Disable the website with a site down notice. If you don't, people and cmsms using the php scripts will continue to spread the infection and give you problems

2) FTP download all files from your server. Your antivirus software may block downloads of some files if it detects an IFrame or obfuscated Java infection. You might have to turn off antivirus or do this on another computer.

3) Scan the downloaded files with an antivirus software like Avast!. Important: although several types of files will be infected (php and html), only script files (.php) you should pay attention to.

4) If the number of files is not large, you can manually delete all occurances of iframe code from those files.

5) Upload the desinfected script files to website, overwriting the infected versions.

6) The infection will not spread anymore. Then, you can mop up with a desinfection of .html files.

Note: restoring from a good backup and implementing good security guidelines is easier than the method above

Note: be careful of script/batch/automated iframe deletion solutions on the internet. For example, read my page http://mkrd.info/services-available/rep ... fixes.html.
Last edited by replytomk3 on Mon Oct 19, 2009 4:28 pm, edited 1 time in total.
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm

Re: Scriptvirus

Post by TeXnik »

replytomk3 wrote:

1) Disable the website with a site down notice. If you don't, people and cmsms using the php scripts will continue to spread the infection and give you problems
That was the first I did and manually worked on all the changed files. Fortunately my site has a low traffic and the time between infection and reaction was comparable short, the files had been easy to recognize with the time stamp. The infection spreads only to the 3rd level, the 4th level was clean. I was using an old WinCommander and searched the files for the unescape string. I can configure the webspace as a virtual drive and scanning the webspace with Avira Antivir (only Avira Antivir and Norman recognize this!). My internet connection is awfully slow and now 28h I only scanned ~40% :-[.
All files with index.* (if there was no index-files, index.html was created!), all log*.php, all home*.php and all auth*.php had the virus inserted. The index files had been set to 444 previously, nevertheless the files had been changged. Now I set them to 400.
With quite a number of AV programs I checked my computer, which was clean. Then I checked the page with Paros and got a high alert of an possible sql injection by googleads. I informed my hoster, whose first response was quite stupid. Now I am waiting for the response of their HQ.

Die Infektion ging nur 3 Verzeichnisebenen tief, alle Dateien mit index.*, log*.php, home*.php und auth*.php waren betroffen, obwohl die Index Dateien zuvor schon die Berechtigung 444 hatten. Bei dieser Berechtigung kann ich selbst über ftp die Datei nicht ändern! Ich mußte erst wieder ins cPanel und auf 644 ändern, jetzt stehen alle auf 400.
Der Hoster mit dem24/7 support in Englisch war ziemlich schwach, nun nahm ich Kontakt mit dem deutschen Support auf und warte auf deren Antwort. Dort hatte ich eigentlich nur gute Erfahrung gemacht.
Alle PW wurden geändert, auch die der Datenbank, jetzt bin mal gespannt, ob und wie lange ich Ruhe habe.
Das Scriptvirus wurde nur von Avira Antivir und Norman erkannt.
replytomk3

Re: Scriptvirus

Post by replytomk3 »

Well done!
aijaz
New Member
New Member
Posts: 3
Joined: Sat Aug 08, 2009 9:54 am

Re: Scriptvirus

Post by aijaz »

plz help me to remove my erroe . ya i know this not cms . i want hepl bacause this is first time i got such type of error. plz solve this or give me good clue or what should i change.
replytomk3

Re: Scriptvirus

Post by replytomk3 »

aijaz wrote: plz help me to remove my erroe . ya i know this not cms . i want hepl bacause this is first time i got such type of error. plz solve this or give me good clue or what should i change.
Why didn't this post help?
Last edited by replytomk3 on Mon Oct 19, 2009 4:26 pm, edited 1 time in total.
Post Reply

Return to “German - Deutsch”