{"id":2253,"date":"2010-10-18T01:14:57","date_gmt":"2010-10-18T07:14:57","guid":{"rendered":"http:\/\/gregsowell.com\/?p=2253"},"modified":"2010-10-18T07:10:56","modified_gmt":"2010-10-18T13:10:56","slug":"redirect-users-to-a-fake-speed-test-site","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=2253","title":{"rendered":"Redirect Users To A Fake Speed Test Site"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"\/images\/speedtest\/speedtest5.gif\" title=\"Speedtest\" class=\"alignnone\" width=\"571\" height=\"111\" \/><\/p>\n<p>For some ISPs, speed test sites can be their best friend.  It shows a user that he is reaching his potential speed.  For others it&#8217;s a nightmare as it gives ammunition for users.  While at MUM this year my lunch table was having a friendly discussion about just this.  Some suggestions were offered on various things you can do to speed test sites.  One person explained how a WISP was blocking every speed test site they could think of, just to keep users from accessing any solid material to complain with.  I then suggested that I could make a fake speed test site and redirect all users to that.  Everyone had a good laugh, but&#8230;I though it would be fun to do it for real, so here it is!<\/p>\n<p>In a nutshell what happens is this:<\/p>\n<li>The user tries to browse to a webpage that contains the word speedtest or bandwidth test in the url<\/li>\n<li>The server IP gets added to an address list of known speed test servers.<\/li>\n<li>Subsiquent access to these addresses hit a destination nat rule that will shoot them over to our webserver, which happens to be hosting our custom webpage.<\/li>\n<figure style=\"width: 640px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"\/images\/speedtest\/speedtest.jpg\" title=\"Speedtest-Baby\" width=\"640\" height=\"420\" \/><figcaption class=\"wp-caption-text\">You average user will believe it...hehehe<\/figcaption><\/figure>\n<p>The webpage is just simple HTML, nothing fancy.  The speed test is really just an animated GIF file that plays once and proudly displays &#8220;Speed is Broadband&#8221; hehehehe.<\/p>\n<figure style=\"width: 640px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"\/images\/speedtest\/speedtest-done.jpg\" title=\"Speedtest-done-Baby\" width=\"640\" height=\"420\" \/><figcaption class=\"wp-caption-text\">Broadband is best band<\/figcaption><\/figure>\n<p>If you hit the &#8220;run test again&#8221; button, it just refreshes the cached page and replays the GIF.<\/p>\n<p>The files can be downloaded here:  <div class=\"wp-block-button\">\n<a  data-e-Disable-Page-Transition=\"true\" class=\"dlm-download-link dlm-download-default wp-block-button__link wp-element-button\" title=\"\" href=\"https:\/\/gregsowell.com?download=5699&amp;tmstv=1784740021\" rel=\"nofollow\" id=\"download-link-5699\" data-redirect=\"false\" >\n\tSpeedtest-HTML\t(3809 downloads\t)\n<\/a>\n<\/div>\n<br \/>\nYou need to run any webserver that will use this folder at the default page.<\/p>\n<h2>Here&#8217;s the router code to make it happen<\/h2>\n<p><strong>Layer 7 match for an URL that contains speedtest or bandwidthtest.<\/strong><\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">\/ip firewall layer7-protocol\r\nadd comment=&quot;&quot; name=speedtest-url regexp=\\\r\n    &quot;^.*(get|GET).+\/(speed|bandwidth).*test.*\\$&quot;<\/code><\/pre>\n<p><strong>Here&#8217;s the mangle rule to add the speed test IP to an address list.<\/strong><\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">\/ip firewall mangle\r\nadd action=add-dst-to-address-list address-list=speedtest-al \\\r\n    address-list-timeout=0s chain=prerouting comment=\\\r\n    &quot;speedtest mark connection&quot; disabled=no dst-port=80 \\\r\n    layer7-protocol=speedtest-url protocol=tcp<\/code><\/pre>\n<p><strong>Here&#8217;s the NAT statement to grab the traffic and send it to our webserver.<\/strong><br \/>\nOur webserver is 1.1.1.1 in this example.<\/p>\n<pre class=\"gs-code\"><code class=\"language-plaintext\">\/ip firewall nat\r\nadd action=dst-nat chain=dstnat comment=&quot;&quot; disabled=no dst-address-list=\\\r\n    speedtest-al to-addresses=1.1.1.1<\/code><\/pre>\n<p>Let me close by saying I&#8217;m not advocating you lie to your users, I just did this as a proof of concept.  If you had an actual internal speed test server, this might be just the sort of rule set you are looking for.  The joke has now completed its journey&#8230;you can now throw the ring into the lava.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some ISPs, speed test sites can be their best friend. It shows a user that he is reaching his potential speed. For others\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,6],"tags":[],"class_list":["post-2253","post","type-post","status-publish","format-standard","hentry","category-fun","category-mikrotik"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/2253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2253"}],"version-history":[{"count":28,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/2253\/revisions"}],"predecessor-version":[{"id":2281,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/2253\/revisions\/2281"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}