Skip to content

Commit

Permalink
Merge pull request #1249 from yogeshojha/fix/infoga-removal
Browse files Browse the repository at this point in the history
Fix/infoga removal
  • Loading branch information
yogeshojha authored May 9, 2024
2 parents a06846c + c04f29e commit 470f352
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
6 changes: 0 additions & 6 deletions web/celery-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ then
pip install -r /usr/src/github/CMSeeK/requirements.txt
fi

if [ ! -d "/usr/src/github/Infoga" ]
then
echo "Cloning Infoga"
git clone https://github.com/m4ll0k/Infoga /usr/src/github/Infoga
fi

# clone ctfr
if [ ! -d "/usr/src/github/ctfr" ]
then
Expand Down
54 changes: 0 additions & 54 deletions web/reNgine/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,6 @@ def osint_discovery(config, host, scan_history_id, activity_id, results_dir, ctx
grouped_tasks = []

if 'emails' in osint_lookup:
emails = get_and_save_emails(scan_history, activity_id, results_dir)
emails_str = '\n'.join([f'• `{email}`' for email in emails])
# self.notify(fields={'Emails': emails_str})
# ctx['track'] = False
_task = h8mail.si(
config=config,
host=host,
Expand Down Expand Up @@ -4329,56 +4325,6 @@ def get_and_save_dork_results(lookup_target, results_dir, type, lookup_keywords=

return results


def get_and_save_emails(scan_history, activity_id, results_dir):
"""Get and save emails from Google, Bing and Baidu.
Args:
scan_history (startScan.ScanHistory): Scan history object.
activity_id: ScanActivity Object
results_dir (str): Results directory.
Returns:
list: List of emails found.
"""
emails = []

# Proxy settings
# get_random_proxy()

# Gather emails from Google, Bing and Baidu
output_file = f'{results_dir}/emails_tmp.txt'
history_file = f'{results_dir}/commands.txt'
command = f'python3 /usr/src/github/Infoga/infoga.py --domain {scan_history.domain.name} --source all --report {output_file}'
try:
run_command(
command,
shell=False,
history_file=history_file,
scan_id=scan_history.id,
activity_id=activity_id)

if not os.path.isfile(output_file):
logger.info('No Email results')
return []

with open(output_file) as f:
for line in f.readlines():
if 'Email' in line:
split_email = line.split(' ')[2]
emails.append(split_email)

output_path = f'{results_dir}/emails.txt'
with open(output_path, 'w') as output_file:
for email_address in emails:
save_email(email_address, scan_history)
output_file.write(f'{email_address}\n')

except Exception as e:
logger.exception(e)
return emails


def save_metadata_info(meta_dict):
"""Extract metadata from Google Search.
Expand Down

0 comments on commit 470f352

Please sign in to comment.