From be44f64d58ff748ebe80febc33b03ef9d670c566 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 21 Feb 2019 13:12:28 +0100 Subject: [PATCH 1/5] Add findwhocallsme.com source --- osint/reputation.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osint/reputation.json b/osint/reputation.json index 8cc8e64..03def6a 100644 --- a/osint/reputation.json +++ b/osint/reputation.json @@ -1,12 +1,17 @@ [ { "title": "reputation report on whosenumber.info", - "request": "site:\"whosenumber.info\" intext:\"$n\" intitle:\"who called\"", + "request": "site:whosenumber.info intext:\"$n\" intitle:\"who called\"", "stop": 1 }, { "title": "phone fraud footprints", "request": "intitle:\"Phone Fraud\" intext:\"$n\" | intext:\"$i\"", "stop": 5 + }, + { + "title": "reputation report on findwhocallsme.com", + "request": "site:findwhocallsme.com intext:\"$n\" | intext:\"$i\"", + "stop": 1 } ] From 2e174531439da09011a91b526bd8767dc326857b Mon Sep 17 00:00:00 2001 From: sundowndev Date: Thu, 21 Feb 2019 14:41:37 +0100 Subject: [PATCH 2/5] Use local format in OSINT scan --- osint/individuals.json | 10 +++++----- osint/reputation.json | 2 +- osint/social_medias.json | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osint/individuals.json b/osint/individuals.json index 2779724..41322ec 100644 --- a/osint/individuals.json +++ b/osint/individuals.json @@ -1,13 +1,13 @@ [ { "site": "numinfo.net", - "request": "site:\"numinfo.net\" intext:\"$n\" | intext:\"$i\"", + "request": "site:\"numinfo.net\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "dialCode": null, "stop": 2 }, { "site": "sync.me", - "request": "site:\"sync.me\" intext:\"$n\" | intext:\"$i\"", + "request": "site:\"sync.me\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "dialCode": null, "stop": 1 }, @@ -19,19 +19,19 @@ }, { "site": "pastebin.com", - "request": "site:\"pastebin.com\" intext:\"$n\" | intext:\"$i\"", + "request": "site:\"pastebin.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "dialCode": null, "stop": 5 }, { "site": "whycall.me", - "request": "site:\"whycall.me\" intext:\"$n\" | intext:\"$l\"", + "request": "site:\"whycall.me\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "dialCode": null, "stop": 1 }, { "site": "locatefamily.com", - "request": "site:locatefamily.com intext:\"$n\" | intext:\"$l\"", + "request": "site:locatefamily.com intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "dialCode": null, "stop": 1 } diff --git a/osint/reputation.json b/osint/reputation.json index 03def6a..337e95d 100644 --- a/osint/reputation.json +++ b/osint/reputation.json @@ -6,7 +6,7 @@ }, { "title": "phone fraud footprints", - "request": "intitle:\"Phone Fraud\" intext:\"$n\" | intext:\"$i\"", + "request": "intitle:\"Phone Fraud\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "stop": 5 }, { diff --git a/osint/social_medias.json b/osint/social_medias.json index f36adfb..217a40a 100644 --- a/osint/social_medias.json +++ b/osint/social_medias.json @@ -1,22 +1,22 @@ [ { "site": "facebook.com", - "request": "site:\"facebook.com\" intext:\"$i\" | intext:\"$n\"", + "request": "site:\"facebook.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "stop": 5 }, { "site": "twitter.com", - "request": "site:\"twitter.com\" intext:\"$i\" | intext:\"$n\"", + "request": "site:\"twitter.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "stop": 5 }, { "site": "linkedin.com", - "request": "site:\"linkedin.com\" intext:\"$i\" | intext:\"$n\"", + "request": "site:\"linkedin.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "stop": 5 }, { "site": "instagram.com", - "request": "site:\"instagram.com\" intext:\"$i\" | intext:\"$n\"", + "request": "site:\"instagram.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"", "stop": 5 } ] From 3a63bd036d366b070c5061459c991b94db5c500a Mon Sep 17 00:00:00 2001 From: sundowndev Date: Thu, 21 Feb 2019 14:42:18 +0100 Subject: [PATCH 3/5] [Fix] Google search results --- phoneinfoga.py | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 5750ecf..6e558a6 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -119,7 +119,7 @@ def search(req, stop): chosenUserAgent = random.choice(uagent) - s = requests.Session() + reqSession = requests.Session() headers = { 'User-Agent': chosenUserAgent, 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', @@ -134,19 +134,20 @@ def search(req, stop): try: REQ = urlencode({'q': req}) - URL = 'https://www.google.com/search?tbs=li:1&{}&gws_rd=ssl'.format( + URL = 'https://www.google.com/search?tbs=li:1&{}&gws_rd=ssl&gl=us '.format( REQ) - r = s.get(URL + googleAbuseToken, headers=headers) + r = reqSession.get(URL + googleAbuseToken, headers=headers) - while r.status_code == 503: + while r.status_code != 200: print(code_warning + 'You are temporary blacklisted from Google search. Complete the captcha at the following URL and copy/paste the content of GOOGLE_ABUSE_EXEMPTION cookie : {}'.format(URL)) print('\n' + code_info + 'Need help ? Read https://github.com/sundowndev/PhoneInfoga/wiki') token = input('\nGOOGLE_ABUSE_EXEMPTION=') googleAbuseToken = '&google_abuse=' + token - r = s.get(URL + googleAbuseToken, headers=headers) + r = reqSession.get(URL + googleAbuseToken, headers=headers) + + soup = BeautifulSoup(r.text, 'html5lib') - soup = BeautifulSoup(r.content, 'html.parser') results = soup.find("div", id="search").find_all("div", class_="g") links = [] @@ -167,12 +168,14 @@ def search(req, stop): if re.match(r"^(?:\/search\?q\=)", url) is not None: url = 'https://google.com' + url - if links is not None: - return links - else: - return [] + if url is not None: + links.append(url) + + return links except Exception as e: print(code_error + 'Request failed. Please retry or open an issue on https://github.com/sundowndev/PhoneInfoga.') + print(e) + return [] def formatNumber(InputNumber): @@ -202,10 +205,11 @@ def localScan(InputNumber): PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace('+', '') numberCountryCode = phonenumbers.format_number( PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL).split(' ')[0] - numberCountry = phonenumbers.region_code_for_country_code(int(numberCountryCode)) + numberCountry = phonenumbers.region_code_for_country_code( + int(numberCountryCode)) localNumber = phonenumbers.format_number( - PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace(numberCountryCode, '') + PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace(numberCountryCode, '0') internationalNumber = phonenumbers.format_number( PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL) @@ -368,8 +372,7 @@ def osintIndividualScan(): (code_info + "Searching for footprints on {}...".format(dork['site']))) for result in search(dorkRequest, stop=dork['stop']): - if result: - print((code_result + "URL: " + result)) + print((code_result + "URL: " + result)) else: return -1 @@ -390,8 +393,7 @@ def osintReputationScan(): print((code_info + "Searching for {}...".format(dork['title']))) for result in search(dorkRequest, stop=dork['stop']): - if result: - print((code_result + "URL: " + result)) + print((code_result + "URL: " + result)) def osintSocialMediaScan(): @@ -412,8 +414,7 @@ def osintSocialMediaScan(): (code_info + "Searching for footprints on {}...".format(dork['site']))) for result in search(dorkRequest, stop=dork['stop']): - if result: - print((code_result + "URL: " + result)) + print((code_result + "URL: " + result)) def osintDisposableNumScan(): @@ -428,10 +429,9 @@ def osintDisposableNumScan(): (code_info + "Searching for footprints on {}...".format(dork['site']))) for result in search(dorkRequest, stop=dork['stop']): - if result: - print((code_result + "Result found: {}".format(dork['site']))) - print((code_result + "URL: " + result)) - askForExit() + print((code_result + "Result found: {}".format(dork['site']))) + print((code_result + "URL: " + result)) + askForExit() def osintScan(rerun=False): @@ -468,8 +468,7 @@ def osintScan(rerun=False): req = '{} | intext:"{}" | intext:"{}"'.format( number, number, internationalNumber) for result in search(req, stop=5): - if result: - print((code_result + "Result found: " + result)) + print((code_result + "Result found: " + result)) # Documents print((code_info + "Searching for documents... (limit=10)")) @@ -480,8 +479,7 @@ def osintScan(rerun=False): req = '[ext:doc | ext:docx | ext:odt | ext:pdf | ext:rtf | ext:sxw | ext:psw | ext:ppt | ext:pptx | ext:pps | ext:csv | ext:txt | ext:xls] && [intext:"{}" | intext:"{}"]'.format( internationalNumber, localNumber) for result in search(req, stop=10): - if result: - print((code_result + "Result found: " + result)) + print((code_result + "Result found: " + result)) print((code_info + '---- Reputation footprints ----')) From aaaf9304bdc7727c531c9a77a52ae98b20a7bc4f Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 21 Feb 2019 14:49:58 +0100 Subject: [PATCH 4/5] Increase web pages results limit to 10 --- phoneinfoga.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index 6e558a6..fba7a72 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -460,14 +460,15 @@ def osintScan(rerun=False): print((code_info + '---- Web pages footprints ----')) - print((code_info + "Searching for footprints on web pages... (limit=5)")) + print((code_info + "Searching for footprints on web pages... (limit=10)")) if customFormatting: req = '{} | intext:"{}" | intext:"{}" | intext:"{}"'.format( number, number, internationalNumber, customFormatting) else: req = '{} | intext:"{}" | intext:"{}"'.format( number, number, internationalNumber) - for result in search(req, stop=5): + + for result in search(req, stop=10): print((code_result + "Result found: " + result)) # Documents From 1c2ec491b5628d32dbd518a7cb2e8f070ffb69fb Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 21 Feb 2019 14:57:44 +0100 Subject: [PATCH 5/5] Version 1.0.2 --- phoneinfoga.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phoneinfoga.py b/phoneinfoga.py index fba7a72..6a9d15e 100644 --- a/phoneinfoga.py +++ b/phoneinfoga.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -__version__ = 'v1.0.1' +__version__ = 'v1.0.2' try: import sys