
{"id":1425,"date":"2014-05-31T21:10:05","date_gmt":"2014-06-01T01:10:05","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=1425"},"modified":"2014-05-31T21:10:05","modified_gmt":"2014-06-01T01:10:05","slug":"program-to-restart-belkin-n300-wireless-n-router","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=1425","title":{"rendered":"Program to restart Belkin &#8211; N300 Wireless-N Router"},"content":{"rendered":"<p>Various Wi-Fi devices, especially mobile ones, started to &#8220;lose&#8221; the router. They can easily find the network, but then are stuck on obtaining the IP address. I guess this is some bug in the DHCP server. Restarting the router usually helps.<\/p>\n<p>I ended up writing a little C# program (<a href=\"http:\/\/www.ikriv.com\/dev\/dotnet\/RestartRouter\/RestartRouter.zip\">binaries<\/a>, <a href=\"http:\/\/www.ikriv.com\/dev\/dotnet\/RestartRouter\/RestartRouterSrc.zip\">full source<\/a>, <a href=\"http:\/\/www.ikriv.com\/dev\/dotnet\/RestartRouter\/Program.cs\">Program.cs<\/a>) to automate the process.<\/p>\n<p>This may sound awful, but this router has been working longer than my previous LinkSys router that <a href=\"http:\/\/yatur.livejournal.com\/86039.html\">just dies<\/a> after less than two years in service.<\/p>\n<p>While exploring the router&#8217;s built-in web server I found many gems. First off, the login page never returns 401 or 403. If the password is correct, it returns a redirect to the main page, if the password is not correct, it returns a redirect to an HTML page that, among other things, contains the text &#8220;Incorrect password&#8221;.<\/p>\n<p>Taking password&#8217;s MD5 hash is dubbed &#8220;encrypt password&#8221;:<\/p>\n<p>http:\/\/192.168.0.1\/login.stm<br \/>\n<code><\/p>\n<pre>\/\/Encrypt password\nif(typeof(bEncPassword) != 'undefined')\n{\n    document.tF.pws.maxLength = 32;\n    document.tF.pws.value = hex_md5(document.tF.pws.value);\n}<\/pre>\n<p><\/code><\/p>\n<p>The restart script (<code>\/cgi-bin\/restart.exe<\/code>) is even funnier. It returns an HTML page if the restart was successful, or <code>400 Bad Request<\/code> if the user is not logged in. By the way, no login cookie is sent to the client. The router probably just remembers logged on user&#8217;s IP. If someone then hijacks my IP and sends a nasty command from it, the router probably would not know the difference. But then, after all, it&#8217;s a home router, bulletproof security is not required.<\/p>\n<p>I also loved the comment in German in <code>\/routine_data.js<\/code>:<\/p>\n<p><code>\/\/ Vordefiniert: VoIP Providerdaten<br \/>\nvar voipprovname = new Array(\"VoIP Account\",\"Other offerer\");<br \/>\nvar voipprovtxt1 = new Array(\"DSL Telephone number\",\"Internet call number\");<\/code><\/p>\n<p>Overall, it was fun, and now I can finally restart the router with one click \ud83d\ude42 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Various Wi-Fi devices, especially mobile ones, started to &#8220;lose&#8221; the router. They can easily find the network, but then are stuck on obtaining the IP address. I guess this is <a href=\"https:\/\/ikriv.com\/blog\/?p=1425\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[22],"tags":[],"class_list":["entry","author-ikriv","post-1425","post","type-post","status-publish","format-standard","category-mytools"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1425"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1425\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}