> For the complete documentation index, see [llms.txt](https://666isildur.gitbook.io/ethical-hacking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://666isildur.gitbook.io/ethical-hacking/web-app-pentesting/recon.md).

# Recon

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEVT-Aq4hk_1GXPio1T%2F-MEYq-LWX6W837yezaFY%2FRECON.png?alt=media\&token=d2442a63-9237-4741-b282-d50b571dab85)

## Discover IP Space

### Finding ASNs

<https://bgp.he.net/>

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME4lX7bO7i84nUHwvfh%2Fimage.png?alt=media\&token=e54aad2d-684e-4d8a-abdb-229364ae9d87)

Here we can see all domains and respective IP adresses hypothetically in scope.

#### whois

We can use the `whois` command to find the CIDR notation for `tesla.com` (the actual domain).

`whois -h whois.cymru.com $(dig +short tesla.com)`

&#x20;Running this whois command with a dig command within it will help us make sure that we find the exact IP address of `tesla.com`.

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME4nM6iuNSgbDieHbpx%2Fimage.png?alt=media\&token=c33346d2-e58e-41f5-a587-2f3b64e45220)

We need to be wary that we dont actually get the ASN for things like VPS (DigitalOcean, AWS, etc)

#### Finding subdomains in ASNs using amass

`amass intel -org tesla`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME4pnRJmZEoh7RNpBpH%2Fimage.png?alt=media\&token=e626350f-f2de-45fa-96cf-902907a04f8a)

With this command we can get the ASN, and then we can do a intel command with ASN specified that will give us every single subdomain in that range.

`amass intel -asn 394161`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5EcaZkm8FznERlQhE%2Fimage.png?alt=media\&token=aee1b67a-e386-45ce-a543-a4dabf6a65c2)

### ARIN & RIPE

{% embed url="<https://whois.arin.net/ui/>" %}

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5LQbzcsXYoNfU_Db7%2Fimage.png?alt=media\&token=e1948263-bb56-4342-baf9-e4fc0ab86ac1)

{% embed url="<https://apps.db.ripe.net/db-web-ui/query?searchtext>" %}

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5Lv1xtsEfDFSPTvIB%2Fimage.png?alt=media\&token=2001be0d-cabe-412b-8943-36774eaf2b17)

### Shodan

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5NQEh0uX-UgsdTbCI%2Fimage.png?alt=media\&token=8e70ab81-c67d-4baa-8339-2235ee3dfe10)

Shodan may bring in some false positives since it will show every organization with "Tesla" in its name.

## TLDs, Acquisitions & Relations

![BugCrowd University diagram](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5O39fXiCk-C3NU0Mu%2Fimage.png?alt=media\&token=c08b0474-a6b1-4ba5-97cc-bdd6376b0aef)

The diagram above displays how to find different brands and top level domains.&#x20;

The first we can do is find different acquisitions, where we can see whether there is an attack surface that many other people may not have discovered. Keeping an eye on acquisitions is great, but usually acquisitions are not in scope until 6 months after the acquisition.&#x20;

After that we can look at related domains. This can be related in things like analytics, whois information, dorks, etc.

### Acquisitions

#### Wikipedia

We can search for Tesla.inc on wikipedia and look for subsidiaries.

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5PnG7wYlfazp32yvG%2Fimage.png?alt=media\&token=48967be0-296a-4c91-b15a-51bb2932f70b)

#### Crunchbase

<https://www.crunchbase.com/>

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5QvDB4Fr4_5Re3eKO%2Fimage.png?alt=media\&token=a4bdd602-f658-445f-9571-2077788a2295)

If it is an open scope, we have all this acquisitions to attack which increases the attack surface significantly.

#### Owler

{% embed url="<https://www.owler.com/company/>" %}

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5SJP3EWi8A7El13KT%2Fimage.png?alt=media\&token=e334af33-c2ec-4716-90be-fff7c2cf4a56)

#### AcquiredBy

{% embed url="<https://acquiredby.co>" %}

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5T9SF5UPc_h-17e-o%2Fimage.png?alt=media\&token=a6f3d361-0240-4be9-9cc8-9d0465776d3d)

### Related

#### ReverseWhois

We can perform a reversewhois with amass and the `-d` specifyinf the domain we want to search for, and the `-whois` flag to specify we are doing a reversewhois check.

`amass intel -d tesla.com -whois`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5UKB5G315P6yhILS0%2Fimage.png?alt=media\&token=f4604722-a9e9-4343-985e-381d8ff73680)

In green we can see the different domains related to `tesla.com`.

#### BuiltWith

{% embed url="<https://builtwith.com>" %}

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5V2hcn7gI_KQWGw02%2Fimage.png?alt=media\&token=677864e0-a58f-4eda-953a-7d0085cddc4a)

#### Google Dorks

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5VUHFK09mVa9vdZyV%2Fimage.png?alt=media\&token=6dd3ac45-6063-4b75-a95b-46f2b878a4ea)

This wont increase the attack surface, but will show us different places with information about the company and that the company acknowledges as source of information about itself.

## Subdomain Enumeration

This tools will return a lot of the same subdomains, so we need to clean the results at the end.

### Amass Enum

`amass enum -d teslamotors.com`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5_E8XeywHGBqpX7gW%2Fimage.png?alt=media\&token=a24b562a-d1d7-49b6-8bcc-7a88c4d043fd)

### Findomain

&#x20;`./findomain-linux -t teslamotors.com`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEOpzqbbLzEkNPn8932%2F-METzS2mD9n4s-Efdc7a%2Fimage.png?alt=media\&token=61d37b82-876d-4492-bce3-fe12073b6f77)

### crtsh script

`python3 crtsh_enum.py teslamotors.com`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEOpzqbbLzEkNPn8932%2F-MEU-OlyILyiyvftOoCC%2Fimage.png?alt=media\&token=6d44f539-f030-41c6-89fb-b8679c7b4920)

### Assetfinder

`./assetfinder --subs-only teslamotors.com`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEOpzqbbLzEkNPn8932%2F-MEU2ZXtWk0CfQ4pB0_u%2Fimage.png?alt=media\&token=f31ba53b-36a4-4f26-9dfd-c7c5386a106e)

### subbrute.py

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEOpzqbbLzEkNPn8932%2F-MEU7qu-cWlB3yTlnHVZ%2Fimage.png?alt=media\&token=0db223c9-e9c4-419a-bafc-21b3cef440a7)

### HTTPROBE

Probe for live targets

`cat results.txt | httprobe -c 100 > alive.txt`

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MEOpzqbbLzEkNPn8932%2F-MEUHcKi6uViZkdgTlrj%2Fimage.png?alt=media\&token=528dbf43-fd86-49a6-ae74-2724e382d156)

## Fingerprinting

### Wappalyzer

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5dOsLdJF29a5Zvlva%2Fimage.png?alt=media\&token=06a2880b-8115-43bf-bbee-60db55a0c12d)

### whatweb

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5di66rOoEwh-A7-0r%2Fimage.png?alt=media\&token=7c2e4a2b-da19-4d4f-8f31-9f298f63b273)

### Masscan & Nmap

Find Ports

`sudo masscan -p1-65535 $(dig +short tesla.com) --rate 10000`

Scan those ports

`sudo nmap -sV -p <ports from masscan> tesla.com`

### WayBack Enumeration

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5gbIjGOMEx2jjUGvZ%2Fimage.png?alt=media\&token=77fe819f-6895-4cd1-964e-5bb1b2b56290)

{% embed url="<https://web.archive.org/>" %}

## Content Discovery

### Gobuster

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5iSZikPDZmWf40d8n%2Fimage.png?alt=media\&token=514dcfbe-b688-4caf-aba9-b4f0d0218053)

### otxurls

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5jtQI8j84NSIJZ5B8%2Fimage.png?alt=media\&token=8d13eded-2d42-4bc5-997b-a5d8ac63c59e)

### waybackurls

![](https://3889206050-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6DIEHtstePxj4NCmCC%2F-MDzdj0M0DJmnsIyM8Zn%2F-ME5kMXu75Wu0ctGWn-D%2Fimage.png?alt=media\&token=528bb22f-f303-4203-97a6-b57a5efde5bf)
