Skip to content

Commit

Permalink
fixed tab/spaces issue and edited code according to PEP8 standart
Browse files Browse the repository at this point in the history
  • Loading branch information
omererdem committed Sep 19, 2020
1 parent 7f98298 commit 49b375b
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions analyzers/TalosReputation/TalosReputation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import cloudscraper
from cortexutils.analyzer import Analyzer
import json


class TalosReputation(Analyzer):

Expand All @@ -12,7 +12,7 @@ def __init__(self):

def summary(self, raw):
taxonomies = []
level = 'info' #If there's a change of naming, will be presented as info
level = 'info' # If there's a change of naming, will be presented as info
namespace = 'Talos'
predicate = 'Reputation'
value = raw.get('email_score_name')
Expand All @@ -30,29 +30,29 @@ def run(self):
if self.data_type == 'ip':
try:
data = self.get_data()

scraper = cloudscraper.CloudScraper()

headers={
'Host':'talosintelligence.com',
'Referer':'https://talosintelligence.com/reputation_center/lookup?search={}'.format(data),
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36',
'Accept':'application/json'
scraper = cloudscraper.CloudScraper()

headers = {
'Host': 'talosintelligence.com',
'Referer': 'https://talosintelligence.com/reputation_center/lookup?search={}'.format(data),
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36',
'Accept': 'application/json'
}

response_details = scraper.get('https://talosintelligence.com/sb_api/query_lookup',
headers = headers,
params = {
'query':'/api/v2/details/ip/',
'query_entry':data
'query': '/api/v2/details/ip/',
'query_entry': data
}
)

response_location = scraper.get('https://talosintelligence.com/sb_api/query_lookup',
headers = headers,
params = {
'query':'/api/v2/location/ip/',
'query_entry':data
'query': '/api/v2/location/ip/',
'query_entry': data
}
)

Expand All @@ -68,7 +68,8 @@ def run(self):
except Exception as e:
self.unexpectedError(e)
else:
self.notSupported()
self.notSupported()


if __name__ == '__main__':
TalosReputation().run()

0 comments on commit 49b375b

Please sign in to comment.