Merge pull request #38 from sundowndev/develop
[Fix] Google search results & add source
This commit is contained in:
commit
cb823066b4
|
@ -1,13 +1,13 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"site": "numinfo.net",
|
"site": "numinfo.net",
|
||||||
"request": "site:\"numinfo.net\" intext:\"$n\" | intext:\"$i\"",
|
"request": "site:\"numinfo.net\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"dialCode": null,
|
"dialCode": null,
|
||||||
"stop": 2
|
"stop": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "sync.me",
|
"site": "sync.me",
|
||||||
"request": "site:\"sync.me\" intext:\"$n\" | intext:\"$i\"",
|
"request": "site:\"sync.me\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"dialCode": null,
|
"dialCode": null,
|
||||||
"stop": 1
|
"stop": 1
|
||||||
},
|
},
|
||||||
|
@ -19,19 +19,19 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "pastebin.com",
|
"site": "pastebin.com",
|
||||||
"request": "site:\"pastebin.com\" intext:\"$n\" | intext:\"$i\"",
|
"request": "site:\"pastebin.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"dialCode": null,
|
"dialCode": null,
|
||||||
"stop": 5
|
"stop": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "whycall.me",
|
"site": "whycall.me",
|
||||||
"request": "site:\"whycall.me\" intext:\"$n\" | intext:\"$l\"",
|
"request": "site:\"whycall.me\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"dialCode": null,
|
"dialCode": null,
|
||||||
"stop": 1
|
"stop": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "locatefamily.com",
|
"site": "locatefamily.com",
|
||||||
"request": "site:locatefamily.com intext:\"$n\" | intext:\"$l\"",
|
"request": "site:locatefamily.com intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"dialCode": null,
|
"dialCode": null,
|
||||||
"stop": 1
|
"stop": 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"title": "reputation report on whosenumber.info",
|
"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
|
"stop": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "phone fraud footprints",
|
"title": "phone fraud footprints",
|
||||||
"request": "intitle:\"Phone Fraud\" intext:\"$n\" | intext:\"$i\"",
|
"request": "intitle:\"Phone Fraud\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"stop": 5
|
"stop": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "reputation report on findwhocallsme.com",
|
||||||
|
"request": "site:findwhocallsme.com intext:\"$n\" | intext:\"$i\"",
|
||||||
|
"stop": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"site": "facebook.com",
|
"site": "facebook.com",
|
||||||
"request": "site:\"facebook.com\" intext:\"$i\" | intext:\"$n\"",
|
"request": "site:\"facebook.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"stop": 5
|
"stop": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "twitter.com",
|
"site": "twitter.com",
|
||||||
"request": "site:\"twitter.com\" intext:\"$i\" | intext:\"$n\"",
|
"request": "site:\"twitter.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"stop": 5
|
"stop": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "linkedin.com",
|
"site": "linkedin.com",
|
||||||
"request": "site:\"linkedin.com\" intext:\"$i\" | intext:\"$n\"",
|
"request": "site:\"linkedin.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"stop": 5
|
"stop": 5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"site": "instagram.com",
|
"site": "instagram.com",
|
||||||
"request": "site:\"instagram.com\" intext:\"$i\" | intext:\"$n\"",
|
"request": "site:\"instagram.com\" intext:\"$i\" | intext:\"$n\" | intext:\"$l\"",
|
||||||
"stop": 5
|
"stop": 5
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
__version__ = 'v1.0.1'
|
__version__ = 'v1.0.2'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import sys
|
import sys
|
||||||
|
@ -119,7 +119,7 @@ def search(req, stop):
|
||||||
|
|
||||||
chosenUserAgent = random.choice(uagent)
|
chosenUserAgent = random.choice(uagent)
|
||||||
|
|
||||||
s = requests.Session()
|
reqSession = requests.Session()
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': chosenUserAgent,
|
'User-Agent': chosenUserAgent,
|
||||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||||
|
@ -134,19 +134,20 @@ def search(req, stop):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
REQ = urlencode({'q': req})
|
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)
|
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(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 +
|
print('\n' + code_info +
|
||||||
'Need help ? Read https://github.com/sundowndev/PhoneInfoga/wiki')
|
'Need help ? Read https://github.com/sundowndev/PhoneInfoga/wiki')
|
||||||
token = input('\nGOOGLE_ABUSE_EXEMPTION=')
|
token = input('\nGOOGLE_ABUSE_EXEMPTION=')
|
||||||
googleAbuseToken = '&google_abuse=' + token
|
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")
|
results = soup.find("div", id="search").find_all("div", class_="g")
|
||||||
|
|
||||||
links = []
|
links = []
|
||||||
|
@ -167,12 +168,14 @@ def search(req, stop):
|
||||||
if re.match(r"^(?:\/search\?q\=)", url) is not None:
|
if re.match(r"^(?:\/search\?q\=)", url) is not None:
|
||||||
url = 'https://google.com' + url
|
url = 'https://google.com' + url
|
||||||
|
|
||||||
if links is not None:
|
if url is not None:
|
||||||
return links
|
links.append(url)
|
||||||
else:
|
|
||||||
return []
|
return links
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(code_error + 'Request failed. Please retry or open an issue on https://github.com/sundowndev/PhoneInfoga.')
|
print(code_error + 'Request failed. Please retry or open an issue on https://github.com/sundowndev/PhoneInfoga.')
|
||||||
|
print(e)
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def formatNumber(InputNumber):
|
def formatNumber(InputNumber):
|
||||||
|
@ -202,10 +205,11 @@ def localScan(InputNumber):
|
||||||
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace('+', '')
|
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace('+', '')
|
||||||
numberCountryCode = phonenumbers.format_number(
|
numberCountryCode = phonenumbers.format_number(
|
||||||
PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL).split(' ')[0]
|
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(
|
localNumber = phonenumbers.format_number(
|
||||||
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace(numberCountryCode, '')
|
PhoneNumberObject, phonenumbers.PhoneNumberFormat.E164).replace(numberCountryCode, '0')
|
||||||
internationalNumber = phonenumbers.format_number(
|
internationalNumber = phonenumbers.format_number(
|
||||||
PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL)
|
PhoneNumberObject, phonenumbers.PhoneNumberFormat.INTERNATIONAL)
|
||||||
|
|
||||||
|
@ -368,8 +372,7 @@ def osintIndividualScan():
|
||||||
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
||||||
|
|
||||||
for result in search(dorkRequest, stop=dork['stop']):
|
for result in search(dorkRequest, stop=dork['stop']):
|
||||||
if result:
|
print((code_result + "URL: " + result))
|
||||||
print((code_result + "URL: " + result))
|
|
||||||
else:
|
else:
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
@ -390,8 +393,7 @@ def osintReputationScan():
|
||||||
|
|
||||||
print((code_info + "Searching for {}...".format(dork['title'])))
|
print((code_info + "Searching for {}...".format(dork['title'])))
|
||||||
for result in search(dorkRequest, stop=dork['stop']):
|
for result in search(dorkRequest, stop=dork['stop']):
|
||||||
if result:
|
print((code_result + "URL: " + result))
|
||||||
print((code_result + "URL: " + result))
|
|
||||||
|
|
||||||
|
|
||||||
def osintSocialMediaScan():
|
def osintSocialMediaScan():
|
||||||
|
@ -412,8 +414,7 @@ def osintSocialMediaScan():
|
||||||
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
||||||
|
|
||||||
for result in search(dorkRequest, stop=dork['stop']):
|
for result in search(dorkRequest, stop=dork['stop']):
|
||||||
if result:
|
print((code_result + "URL: " + result))
|
||||||
print((code_result + "URL: " + result))
|
|
||||||
|
|
||||||
|
|
||||||
def osintDisposableNumScan():
|
def osintDisposableNumScan():
|
||||||
|
@ -428,10 +429,9 @@ def osintDisposableNumScan():
|
||||||
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
(code_info + "Searching for footprints on {}...".format(dork['site'])))
|
||||||
|
|
||||||
for result in search(dorkRequest, stop=dork['stop']):
|
for result in search(dorkRequest, stop=dork['stop']):
|
||||||
if result:
|
print((code_result + "Result found: {}".format(dork['site'])))
|
||||||
print((code_result + "Result found: {}".format(dork['site'])))
|
print((code_result + "URL: " + result))
|
||||||
print((code_result + "URL: " + result))
|
askForExit()
|
||||||
askForExit()
|
|
||||||
|
|
||||||
|
|
||||||
def osintScan(rerun=False):
|
def osintScan(rerun=False):
|
||||||
|
@ -460,16 +460,16 @@ def osintScan(rerun=False):
|
||||||
|
|
||||||
print((code_info + '---- Web pages footprints ----'))
|
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:
|
if customFormatting:
|
||||||
req = '{} | intext:"{}" | intext:"{}" | intext:"{}"'.format(
|
req = '{} | intext:"{}" | intext:"{}" | intext:"{}"'.format(
|
||||||
number, number, internationalNumber, customFormatting)
|
number, number, internationalNumber, customFormatting)
|
||||||
else:
|
else:
|
||||||
req = '{} | intext:"{}" | intext:"{}"'.format(
|
req = '{} | intext:"{}" | intext:"{}"'.format(
|
||||||
number, number, internationalNumber)
|
number, number, internationalNumber)
|
||||||
for result in search(req, stop=5):
|
|
||||||
if result:
|
for result in search(req, stop=10):
|
||||||
print((code_result + "Result found: " + result))
|
print((code_result + "Result found: " + result))
|
||||||
|
|
||||||
# Documents
|
# Documents
|
||||||
print((code_info + "Searching for documents... (limit=10)"))
|
print((code_info + "Searching for documents... (limit=10)"))
|
||||||
|
@ -480,8 +480,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(
|
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)
|
internationalNumber, localNumber)
|
||||||
for result in search(req, stop=10):
|
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 ----'))
|
print((code_info + '---- Reputation footprints ----'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue