{"id":8903,"date":"2014-11-16T14:01:34","date_gmt":"2014-11-16T14:01:34","guid":{"rendered":"http:\/\/scifiempire.net\/wordpress\/?p=8903"},"modified":"2014-11-16T14:01:34","modified_gmt":"2014-11-16T14:01:34","slug":"reconnaissance-with-maltego-whois-nslookup","status":"publish","type":"post","link":"https:\/\/scifiempire.net\/wordpress\/reconnaissance-with-maltego-whois-nslookup\/","title":{"rendered":"Reconnaissance with Maltego WHOIS Nslookup on pentest targets"},"content":{"rendered":"<p>For those who have read my first chapter on my book on the Linux Command Line will know it will also cover the basics on Penetration Testing. The objective of the book is to teachers readers to use the Linux Terminal, program simple projects and learn about the Internet. All three skills are valuable and taken together they form an essential set of skills for those working as computer scientist, engineering and data science. The book I am writing consist of a series of short tutorials I wrote some time ago for myself to make up for what I wasn&#8217;t learning in class. Later on I gave these tutorials to my own students to use as primer on a particular topic. For this book I have expanded them slightly but they are still in essence short tutorials. To read the chapter on the<a title=\"Linux command line tutorial\" href=\"http:\/\/scifiempire.net\/wordpress\/chapter-1-of-linux-programming-and-hacking-for-beginners-released\/\"> Linux command line <\/a>follow the link.<\/p>\n<p>As for Pen testing. I start off with a simple chapter on reconnaissance that will feature tools such as Maltego, theHarvester, WHOIS and Nslookup. I will also show how to filter Google Search results with commands such as &#8216;site:&#8217;, &#8216;filetype:&#8217; and &#8216;inurl:&#8217;. Consider this to be the first draft of the chapter. So if you find any errors please let me known in the comment section.<\/p>\n<p>&nbsp;<\/p>\n<h1>Chapter 1 Reconnaissance<\/h1>\n<p>The first step in performing a penetration test is to better get to know your target system. A target company may have a website through which they communicate with customers and perform transactions. Visiting this website can give glimpses of possible entry points but in all likelihood you are not allowed access to sensitive areas, but you may be able to glean much information nonetheless.<\/p>\n<h2>Paragraph 1 Using Google<\/h2>\n<p>Just like when you visited the target website and used your mark 1 eyeball Google also visits websites to index their content for its search engine. The google crawler will scan everything, even security holes. However, you will have to know how to ask the search engine the relevant information. So far you just type keywords into the google search bar, but it also accepts filter commands.<\/p>\n<p>Using <em>site:<\/em> you can see indexed pages of only your target and not just about the target. As an example, input the following with www.targetwebsite.com being a random website of you\u2019re choosing.<\/p>\n<p>site:www.targetwebsite.com<\/p>\n<p>We can further limit results by using keywords separated by spaces.<\/p>\n<p>site:www.targetwebsite.com secretfiles<\/p>\n<p>The latter will only return pages of the target website that contain the phrase secretfiles<\/p>\n<p>With <em>intitle:<\/em>\u00a0you can search for only those websites with the phrase secretfiles in their title<\/p>\n<p>intitle:secretfiles<\/p>\n<p>With<em>\u00a0inurl: <\/em>the search is restricted\u00a0to finding websites with keywords in the url.<\/p>\n<p>inurl:admin<\/p>\n<p>This example will search the url\u00a0for the word admin and perhaps reveal configuration files.<\/p>\n<p>With the filter <em>filetype:<\/em> you can search for specific file types on websites. An example could be<\/p>\n<p>site:www.targetwebsite.com filetype:pdf<\/p>\n<p>Which searches for PDF files at targetwesbite.com. Another common filetype\u00a0that may contain sensitive information is ppt (powerpoint). Use filetype:ppt to find those.<\/p>\n<h2>Paragraph 2 Using WHOIS<\/h2>\n<p>WHOIS is a simple tool built into most versions of Linux. It returns information about a website, not what is on it. There is also a website Whois.net that offers similar functionality. In the command line type in the following string to activate the WHOIS command against your target.<\/p>\n<p><a href=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Whois-on-Google.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8908\" src=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Whois-on-Google.jpg\" alt=\"Whois on Google Reconnaissance with Maltego WHOIS Nslookup\" width=\"866\" height=\"678\" srcset=\"https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Whois-on-Google.jpg 866w, https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Whois-on-Google-500x391.jpg 500w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/a><\/p>\n<p><em>whois targetwebsite.com<\/em><\/p>\n<p>An example of output is a follows<\/p>\n<p>Domain Name: TARGETWEBSITE.NET<\/p>\n<p>Registrar: ASCIO\u00a0TECHNOLOGIES, INC. DANMARK\u00a0&#8211; FILIAL AF ASCIO TECHNOLOGIES, INC. USA<\/p>\n<p>Whois Server: whois.ascio.com<\/p>\n<p>Referral URL: http:\/\/www.ascio.com<\/p>\n<p>Name Server: NS01.ONE.COM<\/p>\n<p>Name Server: NS02.ONE.COM<\/p>\n<p>Status: ok<\/p>\n<p>Updated Date: 03-jun-2014<\/p>\n<p>Creation Date: 03-jul-2011<\/p>\n<p>Expiration Date: 03-jul-2015<\/p>\n<p>The first line just returns the official domain name that is registered by the\u00a0target, but you would already know that. The second returns the registrar that has the website name registered, in this case ASCIO. The two lines containing the words Name Server refer to web servers used by the hosting company to resolve you IP address with a name address. The last three lines are self-evident and describe when the site was created, it status was updated\u00a0and when it will expire. Going down further in the whois results will reveal\u00a0personal details about the registrant and the hosting company.<\/p>\n<h2>Paragraph 3 Using Nslookup<\/h2>\n<p>Nslookup (or name server lookup) is handy tool not dissimilar to WHOIS. It allows users, network administrators, to query the Domain Name System (DNS) used to resolve a domain name such as www.targetwebsite.com with an IP address. The tool has a manual that can be viewed with <em>man nslookup<\/em>.<\/p>\n<p><a href=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/nslookup-on-Google.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8907\" src=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/nslookup-on-Google.jpg\" alt=\"nslookup on Google Reconnaissance with Maltego WHOIS Nslookup\" width=\"863\" height=\"679\" srcset=\"https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/nslookup-on-Google.jpg 863w, https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/nslookup-on-Google-500x393.jpg 500w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/a><\/p>\n<p>To query a website just type in <em>nslookup targetwebsite.com<\/em><\/p>\n<p>Example output is as follows<\/p>\n<p>Non-authoritative answer:<\/p>\n<p>Name:\u00a0 targetwebsite.net<\/p>\n<p>Address: 123.123.123.1<\/p>\n<p>To use nslookup with just an IP address would get the following result<\/p>\n<p>Nslookup 123.123.123.1<\/p>\n<p>Example output would look as follows<\/p>\n<p>Non-authoritative answer:<\/p>\n<p>39.212.30.46.in-addr.arpa\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 name = webcluster39.one.com.<\/p>\n<p>You may notice the non-authoritative answer, this simply means the name-server queried does not hold the entire zone for the domain.<\/p>\n<p>We can also look at other more exotic records, such as the MX record for email. If a domain such as targetwebsite.com has only one mail server, then the MX record would be mail.targetwebsite.com. With more than one record for a domain the preference number of a MX record is used\u00a0to indicate\u00a0where the email should be sent.<\/p>\n<p>nslookup -querytype=mx bbc.co.uk<\/p>\n<p>In the case of the bbc, there are two mx records<\/p>\n<p>bbc.co.uk\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mail exchanger = 20 cluster1a.eu.messagelabs.com.<\/p>\n<p>bbc.co.uk\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mail exchanger = 10 cluster1.eu.messagelabs.com.<\/p>\n<h2>Paragraph 4 Using theHarvester<\/h2>\n<p>TheHarvester\u00a0is a little tool written in Python by Christian Martorella. With it you can scan the web for email addresses that are related\u00a0to your target website. Most businesses at least leave some connection to the outside world open such as with FTP, SSH, VPN and webmail\u00a0to do their business. This leaves them vulnerable to attack from username and password guessing. You would be surprised by the number of people who use the same username for every webservice\u00a0they use (me included). I strongly suggest you use theHarvester on yourself to discover your own exposure.<\/p>\n<p>To use theHarvester\u00a0you enter into the terminal the following command<\/p>\n<p><em>theharvester \u2013d <\/em><a href=\"http:\/\/www.targetwebsite.com\/\"><em>www.targetwebsite.com<\/em><\/a><em> \u2013l 300 \u2013b all<\/em><\/p>\n<p>Here \u2013d is followed by your target domain, -l\u00a0limits the search with any specific search engine you use and with \u2013b all you signal to use all search engines. The search will include Bing, Google, PGP Key server, Exalead and LinkedIn. Optionally you can include the following behind the command. \u2013f filename which will store results in a file names filename. Adjust the number after \u2013l flag to get more results, but the search will take longer.<\/p>\n<h2>Paragraph 5 Using Maltego<\/h2>\n<p>Maltego\u00a0is an open source intelligence and forensics tool developed by Paterva. It uses data mining on information gathered from open sources and visualizes targets in graphs. For the purpose of this tutorial you will need to create a free account. Type in <em>maltego<\/em>\u00a0in the Terminal and complete your account details when prompted. After clicking away more prompts expand you end up with a blank Maltego canvas as seen in the figure below.<\/p>\n<p><a href=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Maltego-blank-canvas.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8906\" src=\"http:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Maltego-blank-canvas.jpg\" alt=\"Maltego blank canvas Reconnaissance with Maltego WHOIS Nslookup\" width=\"1543\" height=\"799\" srcset=\"https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Maltego-blank-canvas.jpg 1543w, https:\/\/scifiempire.net\/wordpress\/wp-content\/uploads\/2014\/11\/Maltego-blank-canvas-500x258.jpg 500w\" sizes=\"auto, (max-width: 1543px) 100vw, 1543px\" \/><\/a><\/p>\n<p>In order to use Maltego\u00a0on a target expand the Palette bar on your left. Drag a Domain on to the canvas in the middle. You will see a Domain entity has been created\u00a0with paterva.com as its domain. Change this to your target domain by double-clicking the text. To perform \u2018transforms\u2019 or queries just right-click on the Domain entity in the canvas and select <em>Run Transforms<\/em>. You can immediately select <em>Run All Transforms<\/em> but if you\u2019re target is a large entity this action could take a while. Otherwise select <em>To Website [Quick lookup]<\/em> or <em>To DNS Name \u2013 MX (mail server)<\/em>\u00a0to perform\u00a0a search on the website address or google mail server respectively.<\/p>\n<p>Maltego is a very expensive tool and this tutorial just scratches the surface, but it should give you a mapping of your target domain.<\/p>\n<h2>Conclusion<\/h2>\n<p>These five tools concludes the reconnaissance part of this book. In practice the number of tool used is countless and all tools described here have many\u00a0options and flags you can use. Nonetheless, it is counterproductive to get swamped in information on your target. Use these tools initially in an ad hoc way\u00a0to get an impression of\u00a0how your target is organized and where they may be weak. Be sure to document all relevant output. Sometimes I print out result and go over them with a red pen to mark possible weaknesses. In the next chapter we will actively scan part of the target system to uncover weak points.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>That was it for the draft of the first chapter on penetration testing. Please do use the comment section below if you see any gross errors. This was Reconnaissance with Maltego\u00a0WHOIS Nslookup<\/p>\n<p><strong>Source;<\/strong> <a title=\"maltego website\" href=\"https:\/\/www.paterva.com\/web6\/\">https:\/\/www.paterva.com\/web6\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For those who have read my first chapter on my book on the Linux Command&#8230;<\/p>\n","protected":false},"author":1,"featured_media":8910,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[518,509],"class_list":["post-8903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-literature","tag-linux","tag-penetration-testing"],"_links":{"self":[{"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/posts\/8903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/comments?post=8903"}],"version-history":[{"count":5,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/posts\/8903\/revisions"}],"predecessor-version":[{"id":8912,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/posts\/8903\/revisions\/8912"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/media\/8910"}],"wp:attachment":[{"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/media?parent=8903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/categories?post=8903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scifiempire.net\/wordpress\/wp-json\/wp\/v2\/tags?post=8903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}