diff --git a/README.md b/README.md index 2a60852..999fef0 100644 --- a/README.md +++ b/README.md @@ -148,5 +148,5 @@ docker build -t social-analyzer . && docker run -p 9005:9005 -it social-analyzer ## Disclaimer\Notes - Make sure to download this tool from GitHub - This is a security project (Treat it as a security project) -- This tool meant to be used locally (It does not have any type of Access Control) - If you want your website to be excluded from this project list, please reach out to me +- This tool meant to be used locally not as a service (It does not have any type of Access Control) diff --git a/app.js b/app.js index 39e336c..8730ef2 100644 --- a/app.js +++ b/app.js @@ -426,12 +426,17 @@ async function check_user_cli(argv) { var temp_options = "GetUserProfilesFast,FindUserProfilesFast" if (argv.method != "") { if (argv.method == "find") { - temp_options = "FindUserProfilesFast" + temp_options = ",FindUserProfilesFast," } else if (argv.method == "get") { - temp_options = "GetUserProfilesFast" + temp_options = ",GetUserProfilesFast," } } - + if (argv.extract){ + temp_options += ",ExtractPatterns," + } + if (argv.metadata){ + temp_options += ",ExtractMetadata," + } var req = { 'body': { 'uuid': random_string, @@ -475,7 +480,7 @@ async function check_user_cli(argv) { item = clean_up_item(item,argv.options) temp_detected.detected.push(item) } else { - item = delete_keys(item,['found','rate','status','method','good']) + item = delete_keys(item,['found','rate','status','method','good','extracted','metadata']) item = clean_up_item(item,argv.options) temp_detected.unknown.push(item) } @@ -486,11 +491,11 @@ async function check_user_cli(argv) { temp_detected.detected.push(item) } } else if (item.method == "get") { - item = delete_keys(item,['found','rate','status','method','good']) + item = delete_keys(item,['found','rate','status','method','good','extracted','metadata']) item = clean_up_item(item,argv.options) temp_detected.unknown.push(item) } else if (item.method == "failed") { - item = delete_keys(item,['found','rate','status','method','good','text','language','title','type']) + item = delete_keys(item,['found','rate','status','method','good','text','language','title','type','extracted','metadata']) item = clean_up_item(item,argv.options) temp_detected.failed.push(item) } diff --git a/modules/fast-scan.js b/modules/fast-scan.js index 7213ceb..584f4cf 100644 --- a/modules/fast-scan.js +++ b/modules/fast-scan.js @@ -25,7 +25,9 @@ async function find_username_normal(req) { } all_results = all_results.filter(item => item) - return all_results.sort((first, second) => {return helper.compare_objects(first, second, 'rate')}) + return all_results.sort((first, second) => { + return helper.compare_objects(first, second, 'rate') + }) } async function get_failed(req, failed) { @@ -131,13 +133,11 @@ async function find_username_site(uuid, username, options, site) { if (temp_profile.good == "true") { var temp_value = ((temp_profile["found"] / detections_count) * 100).toFixed(2) temp_profile.rate = "%" + temp_value; - if (temp_value >= 100.00){ + if (temp_value >= 100.00) { temp_profile.status = "good" - } - else if (temp_value >= 50.00 && temp_value < 100.00){ + } else if (temp_value >= 50.00 && temp_value < 100.00) { temp_profile.status = "maybe" - } - else{ + } else { temp_profile.status = "bad" } } @@ -145,18 +145,20 @@ async function find_username_site(uuid, username, options, site) { temp_profile.link = site.url.replace("{username}", username); temp_profile.type = site.type - if (temp_profile.status == "good"){ - var temp_metadata_list = [] - temp_metadata_list = await extraction.extract_metadata(site,source) - if (temp_metadata_list.length > 0) - { - temp_profile.metadata = temp_metadata_list + if (temp_profile.status == "good") { + if (options.includes("ExtractPatterns")) { + var temp_extracted_list = [] + temp_extracted_list = await extraction.extract_patterns(site, source) + if (temp_extracted_list.length > 0) { + temp_profile.extracted = temp_extracted_list + } } - var temp_extracted_list = [] - temp_extracted_list = await extraction.extract_patterns(site,source) - if (temp_extracted_list.length > 0) - { - temp_profile.extracted = temp_extracted_list + if (options.includes("ExtractMetadata")) { + var temp_metadata_list = [] + temp_metadata_list = await extraction.extract_metadata(site, source) + if (temp_metadata_list.length > 0) { + temp_profile.metadata = temp_metadata_list + } } } diff --git a/modules/slow-scan.js b/modules/slow-scan.js index bb8b037..fe1e910 100644 --- a/modules/slow-scan.js +++ b/modules/slow-scan.js @@ -1,4 +1,5 @@ -var helper = require('./helper.js') +var helper = require('./helper.js'); +var extraction = require('./extraction.js') var async = require("async"); var sanitizeHtml = require("sanitize-html"); var sanitizeHtml = require("sanitize-html"); @@ -122,6 +123,24 @@ async function find_username_site(uuid, username, options, site) { temp_profile.status = "bad" } } + + if (temp_profile.status == "good") { + if (options.includes("ExtractPatterns")) { + var temp_extracted_list = [] + temp_extracted_list = await extraction.extract_patterns(site, source) + if (temp_extracted_list.length > 0) { + temp_profile.extracted = temp_extracted_list + } + } + if (options.includes("ExtractMetadata")) { + var temp_metadata_list = [] + temp_metadata_list = await extraction.extract_metadata(site, source) + if (temp_metadata_list.length > 0) { + temp_profile.metadata = temp_metadata_list + } + } + } + temp_profile.link = site.url.replace("{username}", username); temp_profile.type = site.type resolve(temp_profile); diff --git a/public/app.html b/public/app.html index 058feb1..d940526 100644 --- a/public/app.html +++ b/public/app.html @@ -219,11 +219,11 @@ padding-right: 2px; } - .selectize-dropdown .optgroup{ + .selectize-dropdown .optgroup { border-top: 1px solid #666666; } - .optgroup-header{ + .optgroup-header { border: none !important; background-color: #383939 !important; color: #d0d0d0 !important; @@ -603,17 +603,16 @@ opacity: 0.1 !important; } - #div-right-icon{ - float:right; + #div-right-icon { + float: right; font-size: 16px; } - #logs-section pre{ + #logs-section pre { color: #d0d0d0 !important; font-size: 12px !important; font-family: monospace !important; } - @@ -708,26 +707,30 @@
@@ -839,8 +842,11 @@