{"id":143,"date":"2010-01-27T10:40:17","date_gmt":"2010-01-27T15:40:17","guid":{"rendered":"http:\/\/zitstif.no-ip.org\/?p=143"},"modified":"2010-01-28T01:43:21","modified_gmt":"2010-01-28T06:43:21","slug":"blocking-your-wp-admin-log-in-page-from-strangers","status":"publish","type":"post","link":"http:\/\/zitstif.no-ip.org\/?p=143","title":{"rendered":"Blocking your wp-admin log in page from strangers.."},"content":{"rendered":"<pre lang=\"php\">######Redirect strangers away from the page#######\r\n\r\n  $client = $_SERVER['REMOTE_ADDR'];\r\n  $reg = \"\/192\\.168\\.10\\.*\/\";\r\n  $home = `printf $(cat \/location to where you can get your WANIP\/)`;\r\n\r\n  if (preg_match($reg, $client))\r\n   {\r\n        echo \"\";\r\n   }\r\n  elseif (mb_ereg($home, $client))\r\n   {\r\n        echo \"\";\r\n   }\r\n  else\r\n   {\r\n     header(\"Location: http:\/\/yoursite\");\r\n   }<\/pre>\n<p>Wanting to cut off access from strangers to my wp-admin login page, I spent a night toiling around with a few possible solutions, while repairing a laptop for a client, whom was quite computer illiterate. I would consider myself illiterate in the sense of programming in assembly language.  Ergo, at some level, in all things we are ignorant, which is the deviated point I&#8217;m trying to establish. Sorry to meander..<\/p>\n<p>Considering the fact that if you don&#8217;t have SSL setup on your server , and even if you do, you still are susceptible to MITM attacks via programs like Ettercap-ng, in certain scenarios. (i.e. Malicious networks) So for my own sense of peace, decided to block of access to the rest of the world to my wp-admin page. You might be able to still access it if you can modify your HTTP requests to make yourself look like me&#8230;.<\/p>\n<p>If you want to use this, I put this piece of code at about line 25, and I would test it from different proxies just to be safe. More info and tutorials to come.<\/p>\n<p>Let me know if you have any questions, comments or concerns.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>######Redirect strangers away from the page####### $client = $_SERVER[&#8216;REMOTE_ADDR&#8217;]; $reg = &#8220;\/192\\.168\\.10\\.*\/&#8221;; $home = `printf $(cat \/location to where you can get your WANIP\/)`; if (preg_match($reg, $client)) { echo &#8220;&#8221;; } elseif (mb_ereg($home, $client)) { echo &#8220;&#8221;; } else { header(&#8220;Location: http:\/\/yoursite&#8221;); } Wanting to cut off access from strangers to my wp-admin login page, &hellip; <a href=\"http:\/\/zitstif.no-ip.org\/?p=143\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Blocking your wp-admin log in page from strangers..<\/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":[11,3],"tags":[23],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-code","category-posts","tag-wordpress"],"_links":{"self":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":5,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":145,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/145"}],"wp:attachment":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}