Vulnerability scans - wie wehre ich mich dagegen?

icecoldkilla

Registered User
Hallo,

Ein ausschnitt aus meiner apache error.log

Code:
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/pma
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/web
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/xampp
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/web
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/php-my-admin
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/websql
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpmyadmin
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/php-my-admin
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.2.3
[Wed Sep 01 14:23:56 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.2.6
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.1
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.4
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.5-rc1
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.5-rc2
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.5
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.5-pl1
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.6-rc1
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.6-rc2
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.6
[Wed Sep 01 14:23:57 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.7
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.7-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-alpha
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-alpha2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-beta1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-beta2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-rc2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-rc3
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-pl2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.0-pl3
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1-rc2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1-pl2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.1-pl3
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.2-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.2-beta1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.2-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.2-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.3
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.3-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.3
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.3-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.4-rc1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.4-pl1
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.4-pl2
[Wed Sep 01 14:23:58 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.4-pl3
[Wed Sep 01 14:23:59 2010] [error] [client 62.193.249.180] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.6.4-pl4

Es scheint so als würde jemand versuchen unsere PHPMyAdmin Version ausfindig zu machen, ohne jetzt paranoid klingen zu wollen, aber wer sie herausfinden möchte, möchte sie warscheinlich nicht bestaunen und bewundern sondern exploiten.

desweiteren wird immer wieder mit DFind gescannt...

Code:
[Thu Sep 02 14:30:32 2010] [error] [client 93.97.181.104] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:)
[Thu Sep 02 16:26:50 2010] [error] [client 94.231.190.46] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.test0:)

Viele ähnliche Threads fand ich über die Suche, keines wurde aber entgültig geklärt.

Meine schritte waren :

- Update im Plesk manager
- Hosts.deny : ALL: w00tw00t.at

Diese Scans treiben unsern Server in die Knie, das wirkt schon fast Ddos Like.


Bitte um hilfe.
 
Sieh dir mal Lösungen wie mod_cband für apache oder fail2ban an, mit denen du die Zugriffe pro IP beschränken kannst.
 
Sieh dir mal Lösungen wie mod_cband für apache oder fail2ban an, mit denen du die Zugriffe pro IP beschränken kannst.

Hallo,

Was wäre eine sinnvolle einstellung? Sodass wir hier in der Firma noch normal unsere 8-12 Stunden am Tag arbeiten können, und die User der einzelnen Seiten noch normal zugreifen können, aber der "hacker" nicht weit kommt?
 
Hallo!
- Hosts.deny : ALL: w00tw00t.at
Um bei deinem Beispiel zu bleiben: Der Client, der den Request sendet ist 93.97.181.104 (93-97-181-104.zone5.bethere.co.uk). w00tw00t.at in die hosts.deny einzutragen bringt da relativ wenig.

mfG
Thorsten
 
Um bei deinem Beispiel zu bleiben: Der Client, der den Request sendet ist 93.97.181.104 (93-97-181-104.zone5.bethere.co.uk). w00tw00t.at in die hosts.deny einzutragen bringt da relativ wenig.

würde es eher was bringen wenn ich *.bethere.co.uk banne?
Unsere Webseiten sind eigentlich nur Regional interessannt, daher hat der da eh nix verloren.

Der Inhalt meine Hosts.deny lautet nun :

Code:
ALL: w00w00t.at, .w00tw00t.at
ALL: 93-97-181-104.zone5.bethere.co.uk, .bethere.co.uk
 
Bist du sicher? Wie viel Last erzeugen denn diese Scans und wie hast du das gemessen?

ich hab es nicht gemessen aber seit dem Zeitpunkt der scans gibt es öfter mal eine Netzwer-Zeitüberschreitung
 
Hallo!
Meiner Meinung nach gehört dies in den Bereich Allgemeines Hintergrundrauschen. Natürlich kannst du damit beginnen, diese Zugriffe manuell | halb manuell | automatisch zu unterbinden. Sollte es sich wirklich um ein Performance Problem handeln, glaube ich nicht das diese Zugriffe dafür verantwortlich sind.

Lies dir auch mal diese Diskussion durch. Dort wird noch einiges zu den Hintergründen erklärt.

mfG
Thorsten
 
Also ich setze dafür OSSEC ein, vielleicht ist das ja was für dich. Damit wird ein Angreifer automatisch für X Minuten von der Firewall komplett geblockt, wenn er eine Seite einige male hintereinander anfordert, die es nicht gibt.
die Zeit X ist dabei frei wählbar.
 
Hallo!
Wenn man solche User denn unbedingt aussperren möchte, bietet sich etwas wie
Code:
for ip in `cat /var/log/apache2/error_log |grep w00tw00t | awk '{print $8}' | sed 's/]//g'  | sort -ug` ; do
   countoff=$[$countoff+1]
   countwoot=$[$countwoot+1]
   iptables -I INPUT -s $ip -j DROP
   iptables -I OUTPUT -s $ip -j DROP
done
an.

Wie performant diese Lösung ist mag ich nicht beurteilen.

mfG
Thorsten

Quelle: http://www.homepage-community.de/dfind_scanner_in_den_apachelogs_w00tw00tatiscsansdfind-t175.0.html
 
HiHo,

Ich habe da was Änliches.

[Mon Aug 30 12:43:07 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4-rc1
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4-pl1
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4-pl2
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4-pl3
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4-pl4
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.6.4
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.7.0-beta1
[Mon Aug 30 12:43:08 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.7.0-rc1
[Mon Aug 30 12:43:09 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.7.0-pl1
[Mon Aug 30 12:43:09 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.7.0-pl2
[Mon Aug 30 12:43:09 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.7.0
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0-beta1
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0-rc1
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0-rc2
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0.1
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0.2
[Mon Aug 30 12:43:10 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0.3
[Mon Aug 30 12:43:11 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.0.4
[Mon Aug 30 12:43:11 2010] [error] [client 85.158.253.153] File does not exist: /var/www/phpMyAdmin-2.8.1-rc1

Allerdings ist das nur ein Auzug. Beim Groben überfliegen habe ich innerhalt von 2 Tagen mehr 8000 Einträge, nicht nur was phpmyadmin angeht.
Im Grunde nix schlmmes wie ich finde, allerdings doch dann schon recht unübersichtlich in den Logs.

Nun stellt sich mir die Frage, diese anfragen geschehen ja Automatisch innerhalb von wenigen Secunden. Laut meinen Logs pro Sekunde zwichen 6 und 13 Anfragen von der selben IP.
Währe es da nicht Sinnvoller auf mod_evaise zu setzen?
 
Hallo,

Selbst wenn es nur unwichtiges Zeug ist, es geht in die performance und es passiert, und weil es passiert muss es einen Sinn geben, bzw jemand hat ein Ziel und diese Sachen störn.

Ich mein selbst wenn jemand versuchen würde in meine Wohnung zu kommen, nur weil er es nicht auf anhieb schafft find ichs nicht grad okay.

es geht jedenfalls weiter...

Code:
[Fri Sep 03 13:21:17 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.8.1-rc1
[Fri Sep 03 13:21:17 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.8.1
[Fri Sep 03 13:21:17 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.8.2
[Fri Sep 03 13:21:18 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/sqlmanager
[Fri Sep 03 13:21:18 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/mysqlmanager
[Fri Sep 03 13:21:18 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/p
[Fri Sep 03 13:21:18 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/PMA2005
[Fri Sep 03 13:21:19 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/pma2005
[Fri Sep 03 13:21:19 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/phpmanager
[Fri Sep 03 13:21:19 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/php-myadmin
[Fri Sep 03 13:21:19 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/phpmy-admin
[Fri Sep 03 13:21:20 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/webadmin
[Fri Sep 03 13:21:20 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/sqlweb
[Fri Sep 03 13:21:20 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/websql
[Fri Sep 03 13:21:20 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/webdb
[Fri Sep 03 13:21:21 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdocs/mysqladmin
[Fri Sep 03 13:21:21 2010] [error] [client 72.232.211.42] File does not exist: /var/www/vhosts/default/htdoc
s/mysql-admin

ich bin grad dabei alles manuell zu blocken was in irgend ner Form verdächtig ist...
 
Hallo!
Stellt sich nur noch die Frage, was mehr Performance verbraucht: Das senden eines 404 deines Webservers oder eine Ganze Armada von nachgelagerten Scripten, die letztendlich via iptables eine IP Adresse droppen.

Hinzu komm, dass die (unerwünschte) Verbindung bereits zustande gekommen ist, die Ressource bereits belegt und der Traffic verbraucht ist. Das ist aber meine ganz persönliche Meinung.

mfG
Thorsten
 
Um DFind auszusperren, würde ich eher mod_setenvif in Kombination mit mod_authz_host einsetzen und etwas in dieser Richtung versuchen:
Code:
SetEnvIfNoCase User-Agent "w00tw00t" no_way_in
SetEnvIfNoCase Request_URI "w00tw00t" no_way_in
Deny from env=no_way_in
Ein effektiver Schutz vor Scans ist das aber nicht. Wenn Du die Region eingrenzen kannst (GeoIP), aus der die Angriffe kommen und Du auf Besucher aus besagter Region verzichten kannst, könntest Du noch statische iptables-Regeln auf Basis von GeoIP einsetzen - das ist unter Ressourcen-Gesichtspunkten nicht ganz so unangenehm wie das dynamische Generieren von Regeln. Bei einem echten DDoS hilft das aber auch nicht wirklich.
 
hi,

also ich verwende fail2ban um das ganze etwas zu kontrollieren. wohl fühle ich mich bei diesen scans nämlich ebenfalls nicht.

also meine config dafür sieht so aus:

/etc/fail2ban/filter.d/apache-w00tw00t.conf:

Code:
[Definition]

# Option: failregex
# Notes.: regex to match the w00tw00t scan messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching.
# Values: TEXT
failregex = ^<HOST> -.*"GET \/w00tw00t\.at\.ISC\.SANS\.DFind\:\).*".*

# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT

#ignoreregex =

/etc/fail2ban/jail.conf

Code:
[apache-w00tw00t]

enabled         = true
filter          = apache-w00tw00t
action          = iptables-allports[name=w00tw00t]
                  mail-whois[name=w00tw00t, dest=john.doe@unkown.com]
logpath         = /var/log/apache*/*access.log
maxretry        = 1
bantime         = 345600
findtime        = 86400

so bin ich die scanner erstmal vier tage los. jeden tag stehen so zwischen 5 und 10 hosts in den iptables. :(
 
Ihr wisst aber, dass man den String in DFind und den anderen Tools dieser Art ganz einfach ändern oder komplett entfernen kann?
Desweiteren verraten Eure IPTables mehr über Euer System, als die 404er vom HTTPd und ab einer relativ geringen Anzahl von Chains ist IPTables zudem belastender fürs System, als die 404er. Security by Obscurity funktioniert auch bei Scriptkiddies und deren Tools schon lange nicht mehr...
 
Back
Top