Skip to content

Commit

Permalink
Update scout.py
Browse files Browse the repository at this point in the history
Removed skid code,
Pointless Variables,
Opening File,
  • Loading branch information
n4ncy committed Oct 3, 2018
1 parent 5bbdc8f commit 61ac4a0
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions scout.py
Expand Up @@ -33,13 +33,9 @@ def print_scout():
def censys_search(censys_query):

terms = ['ip', '80.http.get.metadata.description']
keyfile = open('secrets.txt', 'r')
API_KEY = keyfile.readline().rstrip()
API_SECRET = keyfile.readline().rstrip()
keyfile.close()
censys = CensysIPv4(api_id="API_KEY",
api_secret="API_SECRET")
return censys.search(censys_query, fields=terms)
fileOpen = open('secrets.txt', 'r').read().split(',')
return CensysIPv4(api_id=fileOpen[0],
api_secret=fileOpen[1]).search(censys_query, fields=terms)


def cpe_exception(cpe_string):
Expand All @@ -65,10 +61,8 @@ def cpe_exception(cpe_string):
cpe_better.append(entry_id)
elif len(setvar) == 2:
lens = list(setvar)
len_0 = lens[0]
len_1 = lens[1]
if len(len_1 if len(len_1) > len(len_0) else len_0) \
> editdistance.eval(len_0, len_1):
if len(lens[1] if len(lens[1]) > len(lens[0]) else lens[0]) \
> editdistance.eval(lens[0], lens[1]):
cpe_good.append(entry_id)
if len(cpe_better) == 1:
return cpe_better[0]
Expand Down Expand Up @@ -102,6 +96,5 @@ def search_results(results_dict, gen):
if __name__ == '__main__':
results_dict = {}
print_scout()
for x in censys_search(args.ip):
search_results(results_dict, x)
map(search_results, results_dict, censys_search(args.ip)
pprint(results_dict, indent=4)

0 comments on commit 61ac4a0

Please sign in to comment.