Use Crt.Sh To Identify Domains And Sub-Domains That Belong To An Organization
Using CRT.sh to gather information about the organization.
Background:
Exercise:
Example:
Script:
```
# Copyright (c) 2021 Andrew Hay
import requests
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
#Setting the domain and the request
domain = 'monkeytype.com'
payload = {'q': domain}
req = requests.get('https://crt.sh/?', params=payload)
#Defining the Parser
soup = BeautifulSoup(req.text)
tbody = soup.find_all("table")[2]
td_list = tbody.find_all("td")
features="html.parser"
pyt
itlist = []
for i in td_list:
itlist.append(i.text)
itlist = np.asarray(itlist)
itlist = np.split(itlist, len(itlist)/7)
#Gathering the columns that were parsed
df = pd.DataFrame(itlist, columns = ['crt.sh ID','Logged At','Not Before','Not After','Common Name','Matching Identities','Issuer Name'])
print('Rows: ', len(df))
df = df.drop_duplicates(subset=['Common Name'])
print('Rows: ', len(df))
#Print out the domain name
print(df['Common Name'].to_csv(index=False, header=False))
```Output:
PreviousUse Shodan.io To Passively Map An Organization's External Facing AssetsNextSearch For Information Leaks On Github Using Grep.App
Last updated

