Merge pull request #197 from L1ghtn1ng/dev

Pep8 stuff
This commit is contained in:
J.Townsend 2019-02-17 00:56:06 +00:00 committed by GitHub
commit cbd701ef3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 12 deletions

View file

@ -6,7 +6,7 @@
* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | * * | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *
* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| * * \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *
* * * *
* theHarvester 3.0.6 v307 * * theHarvester 3.0.6 v308 *
* Coded by Christian Martorella * * Coded by Christian Martorella *
* Edge-Security Research * * Edge-Security Research *
* cmartorella@edge-security.com * * cmartorella@edge-security.com *

View file

@ -4,7 +4,8 @@
import requests import requests
import time import time
class search_intelx:
class SearchIntelx:
def __init__(self, word, limit): def __init__(self, word, limit):
self.word = word self.word = word
@ -21,18 +22,21 @@ def do_search(self):
try: try:
user_agent = Core.get_user_agent() user_agent = Core.get_user_agent()
headers = {'User-Agent': user_agent, 'x-key': self.key} headers = {'User-Agent': user_agent, 'x-key': self.key}
data = f'{{"term": "{self.word}", "maxresults": {self.limit}, "media": 0, "sort": 2 , "terminate": []}}'
# data is json that corresponds to what we are searching for, sort:2 means sort by most relevant # data is json that corresponds to what we are searching for, sort:2 means sort by most relevant
data = f'{{"term": "{self.word}", "maxresults": {self.limit}, "media": 0, "sort": 2 , "terminate": []}}'
r = requests.post(f'{self.database}phonebook/search', data=data, headers=headers) r = requests.post(f'{self.database}phonebook/search', data=data, headers=headers)
if r.status_code == 400: if r.status_code == 400:
raise Exception('Invalid json was passed in.') raise Exception('Invalid json was passed in.')
time.sleep(1) time.sleep(1)
# grab uuid to send get request to fetch data # grab uuid to send get request to fetch data
uuid = r.json()['id'] uuid = r.json()['id']
url = f'{self.database}phonebook/search/result?id={uuid}&offset=0&limit={self.limit}' url = f'{self.database}phonebook/search/result?id={uuid}&offset=0&limit={self.limit}'
r = requests.get(url, headers=headers) r = requests.get(url, headers=headers)
time.sleep(1) time.sleep(1)
# to add in future grab status from r.text and check if more results can be gathered
# TODO: add in future grab status from r.text and check if more results can be gathered
if r.status_code != 200: if r.status_code != 200:
raise Exception('Error occurred while searching intelx.') raise Exception('Error occurred while searching intelx.')
self.results = r.json() self.results = r.json()
@ -50,4 +54,3 @@ def get_emails(self):
def get_hostnames(self): def get_hostnames(self):
return self.info[1] return self.info[1]

View file

@ -45,12 +45,12 @@ def intelx_key():
def banner(): def banner():
print('\n\033[93m*******************************************************************') print('\n\033[93m*******************************************************************')
print("* _ _ _ *") print("* _ _ _ *")
print("* | |_| |__ ___ /\ /\__ _ _ ____ _____ ___| |_ ___ _ __ *") print(r"* | |_| |__ ___ /\ /\__ _ _ ____ _____ ___| |_ ___ _ __ *")
print("* | __| _ \ / _ \ / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *") print(r"* | __| _ \ / _ \ / /_/ / _` | '__\ \ / / _ \/ __| __/ _ \ '__| *")
print("* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *") print(r"* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *")
print("* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *") print(r"* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *")
print('* *') print('* *')
print('* theHarvester 3.0.6 v307 *') print('* theHarvester 3.0.6 v308 *')
print('* Coded by Christian Martorella *') print('* Coded by Christian Martorella *')
print('* Edge-Security Research *') print('* Edge-Security Research *')
print('* cmartorella@edge-security.com *') print('* cmartorella@edge-security.com *')

View file

@ -246,7 +246,7 @@ def start():
from discovery import intelxsearch from discovery import intelxsearch
# Import locally or won't work. # Import locally or won't work.
try: try:
search = intelxsearch.search_intelx(word, limit) search = intelxsearch.SearchIntelx(word, limit)
search.process() search.process()
emails = filter(search.get_emails()) emails = filter(search.get_emails())
all_emails.extend(emails) all_emails.extend(emails)
@ -504,7 +504,7 @@ def start():
from discovery import intelxsearch from discovery import intelxsearch
# Import locally or won't work. # Import locally or won't work.
try: try:
search = intelxsearch.search_intelx(word, limit) search = intelxsearch.SearchIntelx(word, limit)
search.process() search.process()
emails = filter(search.get_emails()) emails = filter(search.get_emails())
all_emails.extend(emails) all_emails.extend(emails)