forked from sundowndev/phoneinfoga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
footprints.py
208 lines (157 loc) · 6.61 KB
/
footprints.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : PhoneInfoga - Phone numbers OSINT tool
# @url : https://github.com/sundowndev
# @author : Raphael Cerveaux (sundowndev)
from urllib.parse import urlencode
from lib.output import *
from lib.format import *
from lib.request import send
from lib.googlesearch import search
numberObj = {}
number = ''
localNumber = ''
internationalNumber = ''
numberCountryCode = ''
customFormatting = ''
def osintIndividualScan():
global numberObj
global number
global internationalNumber
global numberCountryCode
global customFormatting
info('---- Phone books footprints ----')
if numberCountryCode == '+1':
info("Generating URL on True People... ")
plus('https://www.truepeoplesearch.com/results?phoneno={}'.format(
internationalNumber.replace(' ', '')))
dorks = json.load(open('osint/individuals.json'))
for dork in dorks:
if dork['dialCode'] is None or dork['dialCode'] == numberCountryCode:
if customFormatting:
dorkRequest = replaceVariables(
dork['request'], numberObj) + ' OR "{}"'.format(customFormatting)
else:
dorkRequest = replaceVariables(dork['request'], numberObj)
info("Searching for footprints on {}...".format(dork['site']))
for result in search(dorkRequest, stop=dork['stop']):
plus("URL: " + result)
else:
return -1
def osintReputationScan():
global numberObj
global number
global internationalNumber
global customFormatting
info('---- Reputation footprints ----')
dorks = json.load(open('osint/reputation.json'))
for dork in dorks:
if customFormatting:
dorkRequest = replaceVariables(
dork['request'], numberObj) + ' OR "{}"'.format(customFormatting)
else:
dorkRequest = replaceVariables(dork['request'], numberObj)
info("Searching for {}...".format(dork['title']))
for result in search(dorkRequest, stop=dork['stop']):
plus("URL: " + result)
def osintSocialMediaScan():
global numberObj
global number
global internationalNumber
global customFormatting
info('---- Social media footprints ----')
dorks = json.load(open('osint/social_medias.json'))
for dork in dorks:
if customFormatting:
dorkRequest = replaceVariables(
dork['request'], numberObj) + ' OR "{}"'.format(customFormatting)
else:
dorkRequest = replaceVariables(dork['request'], numberObj)
info("Searching for footprints on {}...".format(dork['site']))
for result in search(dorkRequest, stop=dork['stop']):
plus("URL: " + result)
def osintDisposableNumScan():
global numberObj
global number
info('---- Temporary number providers footprints ----')
try:
info("Searching for phone number on tempophone.com...")
response = send(
"GET", "https://tempophone.com/api/v1/phones")
data = json.loads(response.content.decode('utf-8'))
for voip_number in data['objects']:
if voip_number['phone'] == formatNumber(number):
plus("Found a temporary number provider: tempophone.com")
askForExit()
except Exception as e:
error("Unable to reach tempophone.com API. Skipping.")
dorks = json.load(open('osint/disposable_num_providers.json'))
for dork in dorks:
dorkRequest = replaceVariables(dork['request'], numberObj)
info("Searching for footprints on {}...".format(dork['site']))
for result in search(dorkRequest, stop=dork['stop']):
plus("Result found: {}".format(dork['site']))
plus("URL: " + result)
askForExit()
def osintScan(numberObject, rerun=False):
if not args.scanner == 'footprints' and not args.scanner == 'all':
return -1
global numberObj
global number
global localNumber
global internationalNumber
global numberCountryCode
global customFormatting
numberObj = numberObject
number = numberObj['default']
localNumber = numberObj['local']
internationalNumber = numberObj['international']
numberCountryCode = numberObj['countryCode']
test('Running OSINT footprint reconnaissance...')
if not rerun:
# Whitepages
info("Generating scan URL on 411.com...")
plus("Scan URL: https://www.411.com/phone/{}".format(
internationalNumber.replace('+', '').replace(' ', '-')))
askingCustomPayload = ask(
'Would you like to use an additional format for this number ? (y/N) ')
if rerun or askingCustomPayload == 'y' or askingCustomPayload == 'yes':
info('We recommand: {} or {}'.format(internationalNumber,
internationalNumber.replace(numberCountryCode + ' ', '')))
customFormatting = ask('Custom format: ')
info('---- Web pages footprints ----')
info("Searching for footprints on web pages... (limit=10)")
if customFormatting:
req = '{} OR "{}" OR "{}" OR "{}"'.format(
number, number, internationalNumber, customFormatting)
else:
req = '{} OR "{}" OR "{}"'.format(
number, number, internationalNumber)
for result in search(req, stop=10):
plus("Result found: " + result)
# Documents
info("Searching for documents... (limit=10)")
if customFormatting:
req = '(ext:doc OR ext:docx OR ext:odt OR ext:pdf OR ext:rtf OR ext:sxw OR ext:psw OR ext:ppt OR ext:pptx OR ext:pps OR ext:csv OR ext:txt OR ext:xls) AND ("{}")'.format(
customFormatting)
else:
req = '(ext:doc OR ext:docx OR ext:odt OR ext:pdf OR ext:rtf OR ext:sxw OR ext:psw OR ext:ppt OR ext:pptx OR ext:pps OR ext:csv OR ext:txt OR ext:xls) AND ("{}" OR "{}")'.format(
internationalNumber, localNumber)
for result in search(req, stop=10):
plus("Result found: " + result)
osintReputationScan()
info("Generating URL on scamcallfighters.com...")
plus('http://www.scamcallfighters.com/search-phone-{}.html'.format(number))
tmpNumAsk = ask(
"Would you like to search for temporary number providers footprints ? (Y/n) ")
if tmpNumAsk.lower() != 'n' and tmpNumAsk.lower() != 'no':
osintDisposableNumScan()
osintSocialMediaScan()
osintIndividualScan()
retry_input = ask(
"Would you like to rerun OSINT scan ? (e.g to use a different format) (y/N) ")
if retry_input.lower() == 'y' or retry_input.lower() == 'yes':
osintScan(numberObj, True)
else:
return -1