diff --git a/web/reNgine/common_func.py b/web/reNgine/common_func.py index 6c91b878..15347660 100644 --- a/web/reNgine/common_func.py +++ b/web/reNgine/common_func.py @@ -5,9 +5,12 @@ import random import requests import tldextract import logging +import shutil from threading import Thread +from urllib.parse import urlparse + from bs4 import BeautifulSoup from lxml import html @@ -665,20 +668,26 @@ def get_whois(ip_domain, save_db=False, fetch_from_db=True): def get_cms_details(url): # this function will fetch cms details using cms_detector response = {} - cms_detector_command = 'python3 /usr/src/github/CMSeeK/cmseek.py -u {} --random-agent --batch'.format(url) + cms_detector_command = 'python3 /usr/src/github/CMSeeK/cmseek.py -u {} --random-agent --batch --follow-redirect'.format(url) output_lines = os.popen(cms_detector_command).read().splitlines() - result = [r for r in output_lines if "Result:" in r] response['status'] = False response['message'] = 'Could not detect CMS!' - if result: - result_path = re.search('32m(.*)0m', result[0]) - if result_path: - cms_json_path = result_path.group(1)[:-2] - cms_file_content = json.loads(open(cms_json_path, 'r').read()) - response = {} - response = cms_file_content - response['status'] = True + domain_name = urlparse(url).netloc + + cms_dir_path = '/usr/src/github/CMSeeK/Result/{}'.format(domain_name) + cms_json_path = cms_dir_path + '/cms.json' + + if os.path.isfile(cms_json_path): + cms_file_content = json.loads(open(cms_json_path, 'r').read()) + response = {} + response = cms_file_content + response['status'] = True + # remove cms dir path + try: + shutil.rmtree(cms_dir_path) + except Exception as e: + print(e) return response diff --git a/web/static/custom/custom.js b/web/static/custom/custom.js index 81d92b22..dda6dca8 100644 --- a/web/static/custom/custom.js +++ b/web/static/custom/custom.js @@ -1476,9 +1476,8 @@ function get_domain_whois(domain_name, show_add_target_btn=false) { 'Content-Type': 'application/json' }, }).then(response => response.json()).then(function(response) { - console.log(response); + swal.close(); if (response.status) { - swal.close(); display_whois_on_modal(response, show_add_target_btn=show_add_target_btn); } else { Swal.fire({ diff --git a/web/static/custom/toolbox.js b/web/static/custom/toolbox.js index 01aff074..cb2714cb 100644 --- a/web/static/custom/toolbox.js +++ b/web/static/custom/toolbox.js @@ -32,7 +32,7 @@ function cms_detector(){ $('#modal-content').append(`
${response.cms_name}
+ +${response.detection_param}
+ +
+ (Includes redirected URL)
+ ${response.url}
+
+ ${response.wp_readme_file} +
`; + } + + if (response.wp_uploads_directory) { + content += `+ ${response.wp_uploads_directory} +
`; + } + + if (response.wp_users) { + content += `+ ${response.wp_users} +
`; + } + + if (response.wp_version) { + content += `+ ${response.wp_version} +
`; + } + + if (response.joomla_version) { + content += `+ ${response.joomla_version} +
`; + } + + if (response.joomla_debug_mode) { + content += `+ ${response.joomla_debug_mode} +
`; + } + + if (response.joomla_readme_file) { + content += `+ ${response.joomla_readme_file} +
`; + } + + if (response.joomla_backup_files) { + content += `+ ${response.joomla_backup_files} +
`; + } + + if (response.directory_listing) { + content += `+ ${response.directory_listing} +
`; + } + + if (response.joomla_config_files) { + content += `+ ${response.joomla_config_files} +
`; + } + + if (response.user_registration_url) { + content += `