2018-12-18 13:21:05 +08:00
|
|
|
from discovery.constants import *
|
2019-01-06 17:50:07 +08:00
|
|
|
from lib.core import *
|
2019-01-11 10:09:47 +08:00
|
|
|
from parsers import cymonparser
|
|
|
|
import requests
|
2018-12-18 13:21:05 +08:00
|
|
|
import time
|
2018-12-10 01:44:28 +08:00
|
|
|
|
2018-12-28 08:49:56 +08:00
|
|
|
|
2018-12-10 01:44:28 +08:00
|
|
|
class search_cymon:
|
|
|
|
|
|
|
|
def __init__(self, word):
|
|
|
|
self.word = word
|
|
|
|
self.url = ""
|
|
|
|
self.results = ""
|
2019-01-14 07:58:38 +08:00
|
|
|
self.server = 'cymon.io'
|
2018-12-18 13:21:05 +08:00
|
|
|
|
2018-12-10 01:44:28 +08:00
|
|
|
def do_search(self):
|
|
|
|
try:
|
2019-01-06 17:50:07 +08:00
|
|
|
headers = {'user-agent': Core.get_user_agent(), 'Accept': '*/*', 'Referer': self.url}
|
2018-12-10 01:44:28 +08:00
|
|
|
response = requests.get(self.url, headers=headers)
|
2018-12-18 13:21:05 +08:00
|
|
|
time.sleep(getDelay())
|
2018-12-10 01:44:28 +08:00
|
|
|
self.results = response.content
|
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
|
|
|
|
|
|
|
def process(self):
|
|
|
|
try:
|
2019-01-14 07:58:38 +08:00
|
|
|
self.url = 'https://' + self.server + '/domain/' + str(self.word)
|
|
|
|
print('\tSearching results.')
|
2018-12-10 01:44:28 +08:00
|
|
|
self.do_search()
|
|
|
|
except Exception as e:
|
2019-01-06 17:50:07 +08:00
|
|
|
print(f'Error occurred: {e}')
|
2018-12-10 01:44:28 +08:00
|
|
|
|
|
|
|
def get_ipaddresses(self):
|
|
|
|
try:
|
2019-01-06 17:50:07 +08:00
|
|
|
ips = cymonparser.Parser(self)
|
2018-12-10 01:44:28 +08:00
|
|
|
return ips.search_ipaddresses()
|
|
|
|
except Exception as e:
|
2019-01-06 17:50:07 +08:00
|
|
|
print(f'Error occurred: {e}')
|