2019-01-06 17:50:07 +08:00
|
|
|
from lib.core import *
|
2019-01-11 10:09:47 +08:00
|
|
|
from parsers import myparser
|
|
|
|
import requests
|
2018-12-28 08:49:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
class search_virustotal:
|
|
|
|
|
|
|
|
def __init__(self, word):
|
|
|
|
self.word = word.replace(' ', '%20')
|
|
|
|
self.results = ""
|
|
|
|
self.totalresults = ""
|
2019-01-14 07:58:38 +08:00
|
|
|
self.server = 'www.google.com'
|
|
|
|
self.hostname = 'www.google.com'
|
|
|
|
self.quantity = '100'
|
2018-12-28 08:49:56 +08:00
|
|
|
self.counter = 0
|
|
|
|
|
|
|
|
def do_search(self):
|
|
|
|
try:
|
2019-01-14 07:58:38 +08:00
|
|
|
urly = 'https://www.virustotal.com/en/domain/' + self.word + '/information/'
|
2018-12-28 08:49:56 +08:00
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
2019-01-06 17:50:07 +08:00
|
|
|
headers = {'User-Agent': Core.get_user_agent()}
|
2018-12-28 08:49:56 +08:00
|
|
|
try:
|
|
|
|
r=requests.get(urly, headers=headers)
|
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
|
|
|
self.results = r.text
|
|
|
|
self.totalresults += self.results
|
|
|
|
|
|
|
|
def get_hostnames(self):
|
2019-01-06 17:50:07 +08:00
|
|
|
rawres = myparser.Parser(self.results, self.word)
|
2018-12-28 08:49:56 +08:00
|
|
|
return rawres.hostnames()
|
|
|
|
|
|
|
|
def process(self):
|
|
|
|
self.do_search()
|
2019-01-14 07:58:38 +08:00
|
|
|
print('\tSearching results.')
|