{"id":389,"date":"2010-05-24T17:23:21","date_gmt":"2010-05-24T22:23:21","guid":{"rendered":"http:\/\/zitstif.no-ip.org\/?p=389"},"modified":"2010-05-24T17:23:21","modified_gmt":"2010-05-24T22:23:21","slug":"bruteforcing-subdomain-names-with-john-the-ripper","status":"publish","type":"post","link":"http:\/\/zitstif.no-ip.org\/?p=389","title":{"rendered":"Bruteforcing subdomain names with John the ripper"},"content":{"rendered":"<p>A key phase in the steps to penetration testing is reconnaissance.\u00a0Without reconnaissance, pentesters would be essentially blind.<\/p>\n<p>In addition to this, pentesters have myriad of tools to help them with the recon phase.<\/p>\n<p>When hunting down hosts that belong to an organization, <a title=\"http:\/\/code.google.com\/p\/dnsmap\/\" href=\"http:\/\/code.google.com\/p\/dnsmap\/\" target=\"_blank\">dnsmap<\/a> is a wonderful tool for finding subdomains.<\/p>\n<p>After doing some experimenting with this tool, I stumbled upon a limitation. Dnsmap does not have the capability to read from stdin for keywords to use in the subdomain bruteforcing. It requires a word list. Well what if I want to use john the ripper?<\/p>\n<p>So, I pondered to myself, &#8220;What&#8217;s wrong with just &#8216;host&#8217; and &#8216;john&#8217; in tandem to bruteforce subdomains?&#8221;. Well my friends, here&#8217;s an example:<\/p>\n<pre lang=\"bash\">\r\njohn --incremental --stdout | while read words; \r\n   do host ${words}.google.com &> \/dev\/null; \r\n      if [ $? -eq 0 ]; \r\n          then echo \"${words}.google.com\"; \r\n      fi; \r\n   done\r\n<\/pre>\n<p>Of course you could change this to accordingly, but here&#8217;s it as a function and you could even add this to your .bashrc file.<\/p>\n<pre lang=\"bash\">\r\nfunction dnsbrute {\r\n if [ ${#} -lt 1 ];\r\n   then \r\n      echo \"I need a domain name...\";\r\n      return 1;\r\n fi\r\n john --incremental --stdout | while read words; \r\n   do host ${words}.${1} &> \/dev\/null; \r\n     if [ $? -eq 0 ]; \r\n        then echo \"${words}.${1}\"; \r\n     fi; \r\n   done\r\n return 0;\r\n}\r\n<\/pre>\n<p>More to come as usual.. <\/p>\n<p>(I&#8217;m still dragging my feet on ettersploit.. \ud83d\ude42 )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A key phase in the steps to penetration testing is reconnaissance.\u00a0Without reconnaissance, pentesters would be essentially blind. In addition to this, pentesters have myriad of tools to help them with the recon phase. When hunting down hosts that belong to an organization, dnsmap is a wonderful tool for finding subdomains. After doing some experimenting with &hellip; <a href=\"http:\/\/zitstif.no-ip.org\/?p=389\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Bruteforcing subdomain names with John the ripper<\/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":[53,211,210,212,213,215,214],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-code","category-posts","tag-dns","tag-dnsmap","tag-domain-name-system","tag-host","tag-john","tag-john-the-ripper","tag-jtr"],"_links":{"self":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/389","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=389"}],"version-history":[{"count":3,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":392,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions\/392"}],"wp:attachment":[{"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zitstif.no-ip.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}