Footprinting and Reconnaissance
Footprinting is the first step when attacking a system, in this phase the attacker gathers information that is publicly available. This kind of attack can be passive or pseudonymous. Here are some of the of information you can gathered about a target during footprinting.
- Alternative Websites
- Domain names
- Network blocks
- Specific IP addresses
- Network services and applications
- System architecture
- Authentication mechanisms
- Access control mechanisms
- Employee email & Phone numbers
- Contact addresses
In this lab we will use tools like ping, tracert and search engines to obtain information about a our target.
lets start with the basic ping command. In this lab series i will use www.hackthissite.org to try out my attacks.
“Hack This Site is a free training ground for users to test and expand their hacking skills. Our community is dedicated to facilitating an open learning environment by providing a series of hacking challenges, articles, resources, and discussion of the latest happenings in hacker culture. We are an online movement of artists, activists, hackers and anarchists who are organizing to create new worlds.”
Open CMD and ping a your favorite site, i am pinging www.hackthissite.org
C:\>ping www.hackthissite.org Pinging www.hackthissite.org [220.127.116.11] with 32 bytes of data: Reply from 18.104.22.168: bytes=32 time=40ms TTL=45 Reply from 22.214.171.124: bytes=32 time=40ms TTL=45 Reply from 126.96.36.199: bytes=32 time=40ms TTL=45 Reply from 188.8.131.52: bytes=32 time=40ms TTL=45 Ping statistics for 184.108.40.206: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 40ms, Maximum = 40ms, Average = 40ms C:\>
We can see that the site replied with its IP address which is 220.127.116.11.
Now when we have the IP address we can use tracert to see the path the trafic is taking from your client to www.hackthissite.org
C:\>tracert 18.104.22.168 Tracing route to hackthissite.org [22.214.171.124] over a maximum of 30 hops: 1 <1 ms <1 ms <1 ms 192.168.10.1 2 1 ms 1 ms 1 ms h85-209-118-1.cust.a3fiber.se [126.96.36.199] 3 1 ms 1 ms 1 ms gsl-bbr-1-be102.net.comhem.se [188.8.131.52] 4 4 ms 9 ms 6 ms gbg1.dr2.a3network.se [184.108.40.206] 5 1 ms 1 ms 1 ms gbg1.a3network.se [220.127.116.11] 6 1 ms 1 ms 1 ms gbg1.cr1.a3network.se [18.104.22.168] 7 7 ms 7 ms 7 ms sto2.cr1.a3network.se [22.214.171.124] 8 29 ms 18 ms 18 ms s-b10-link.telia.net [126.96.36.199] 9 18 ms 17 ms 19 ms s-bb4-link.telia.net [188.8.131.52] 10 33 ms 33 ms 33 ms ffm-bb4-link.telia.net [184.108.40.206] 11 34 ms 51 ms 30 ms ffm-b1-link.telia.net [220.127.116.11] 12 39 ms 39 ms 39 ms be100-163.fra-5-a9.de.eu [18.104.22.168] 13 222 ms 44 ms 45 ms be103.rbx-g2-nc5.fr.eu [22.214.171.124] 14 * * * Request timed out. 15 * 40 ms * vl7.vss-10b-6k.fr.eu [126.96.36.199] 16 40 ms 40 ms 40 ms hackthissite.org [188.8.131.52] Trace complete. C:\>
With the tracert command we can fallow the trafic trough all routers and firewalls until we arrive to the website.
Use www.netcraft.com To Obtain More Data
Open www.netcraft.com in your web browser, In the right menu under “What’s that site running?” enter www.hackthissite.org the result page will open. Here we can see all the subdomains the site have.
On the result page click on the site report next to the domain name, a new page will load with information like email address, physical addresses, OS versions, Web Server version and a lot more.
Use WHOIS to obtain domain name information
WHOIS is a database that have information about domains and information about the people that own them. Using this tool give you the potential to gather personal information about the people that you can later use when doing social engineering. As well as collecting information as:
- Information about the owner
- Contact information
- Domain name servers
- The IP address
- When the domain was created
- When it was last updated
There several ways to use “WHOIS” like online services, applications and from command line, use the method that you are that you are comfortable with. If you are using a windows client then you need to download WHOIS, there is no need to install anything if you are using Kali Linux.
In this example we will show you how to use WHOIS from windows command line. Download WHOIS from Microsoft from https://docs.microsoft.com/en-us/sysinternals/downloads/whois and extract the files to the C:\ drive root.
Open CMD and type in whois [-v] domainname [whois.server]
C:\>whois -v hackthissite.org Whois v1.20 - Domain information lookup Copyright (C) 2005-2017 Mark Russinovich Sysinternals - www.sysinternals.com Connecting to ORG.whois-servers.net... Server ORG.whois-servers.net returned the following for HACKTHISSITE.ORG Domain Name: HACKTHISSITE.ORG Registry Domain ID: D99641092-LROR Registrar WHOIS Server: whois.enom.com Registrar URL: http://www.enom.com Updated Date: 2019-01-14T03:31:05Z Creation Date: 2003-08-10T15:01:25Z Registry Expiry Date: 2019-08-10T15:01:25Z Registrar Registration Expiration Date: Registrar: eNom, Inc. Registrar IANA ID: 48 Registrar Abuse Contact Email: firstname.lastname@example.org Registrar Abuse Contact Phone: +1.4252982646 Reseller: Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited Registrant Organization: Whois Privacy Protection Service, Inc. Registrant State/Province: WA Registrant Country: US Name Server: C.NS.BUDDYNS.COM Name Server: F.NS.BUDDYNS.COM Name Server: G.NS.BUDDYNS.COM Name Server: H.NS.BUDDYNS.COM Name Server: J.NS.BUDDYNS.COM DNSSEC: unsigned URL of the ICANN Whois Inaccuracy Complaint Form https://www.icann.org/wicf/) >>> Last update of WHOIS database: 2019-02-09T22:32:34Z <<< For more information on Whois status codes, please visit https://icann.org/epp
Use internet archives to get old versions of websites
“The Internet Archive, a 501(c)(3) non-profit, is building a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, the print disabled, and the general public”
Use internet archives like the wayback machine to get old versions of sites and check if you can find vulnerabilities or if you can extract other useful information from old versions of the site.
Use Google Hacking
Google hacking is an information gathering technique that uses Google search queries to identify vulnerabilities in web applications, gather information of individual targets, discover errors, disclosing sensitive data, discover credentials and other sensitive information. Use https://www.exploit-db.com to practice and have some fun.
Use the cache operator to find what the recent cache of a website is.
Use the link operator to list pages linking to a specific domain or URL.
Use the info operator to display information about a page.
Use the site operator to restrict the search to a specific site.
Use the allinurl operator to only return specified keyword in URL.
Use the allintitle operator to return specified keyword in title.
Website gathering tools
There are many tools one can use to extract and gather information from the targets websites. Below are some examples of browsers plugins and applications that you can use.
Gathering information from DNS
If the target have some kind of public facing server then they will have some kind of a DNS servers, we can use DNS to gather information about email servers and other servers that the target is utilizing by analyzing the record types of the DNS server. List of DNS records typs.
There are many tools online and offline you can use to gather information about DNS, in this example we are using nslookup, to use nslookup open command line in windows or shell in linux and type in nslookup and the FQDN or the IP address of the target.
Below are some examples of DNS query’s.
# Check DNS A record C:\>nslookup Default Server: 184.108.40.206 Address: 220.127.116.11 > set type=a > www.google.se Server: 18.104.22.168 Address: 22.214.171.124 Non-authoritative answer: Name: www.google.se Address: 126.96.36.199
# Check DNS mx record C:\>nslookup Default Server: 188.8.131.52 Address: 184.108.40.206 > set type=mx > live.se Server: 220.127.116.11 Address: 18.104.22.168 Non-authoritative answer: live.se MX preference = 10, mail exchanger = eur.olc.protection.outlook.com eur.olc.protection.outlook.com internet address = 22.214.171.124 eur.olc.protection.outlook.com internet address = 126.96.36.199