forked from C3n7ral051nt4g3ncy/Prot1ntelligence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprot1ntelligence.py
381 lines (296 loc) · 17.9 KB
/
prot1ntelligence.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
#!/usr/bin/env python3
# File name : prot1ntelligence.py
# Author : GitHub: @C3n7ral051nt4g3ncy
# Creation Date : 09 June 2022 (Script started on 01/05/2022)
# Fork : 3 modules out of 7 Modules are based on ProtOSINT from PixelBubble: https://github.com/pixelbubble/ProtOSINT
# Last Update : Saturday 11th of June 2022, Adding Fork and another Module for Direct PGP Key download locally
# Py library
from bs4 import BeautifulSoup
import re
import requests
import ipaddress
import datetime
from datetime import datetime
from googlesearch import search
import webbrowser
import readline
# Script Information in English
print("\u001b[32m[ENG] \033[1mProt1ntelligence\033[0m\u001b[32m is used to find information on:")
print("- ProtonMail account existence & Creation date")
print("- User PGP Key, creation date, Key Type: RSA 4096 or ECC Curve25519")
print("- Download PGP Key & add to your KeyChain to send encrypted mail to user")
print("- Check if the IP address is a ProtonVPN user")
print("- ProtonMail User Digital Footprints (clear & Dark Web)\n\n")
# Script Information in French
print("\u001b[33m[FR] \033[1mProt1ntelligence\033[0m\u001b[33m pour obtenir des infos sur:")
print("- Un compte ProtonMail et sa date de creation")
print("- Cle PGP de l'utilisateur, date de creation de la cle")
print("- Telechargement de la cle pour ajouter a votre KeyChain")
print("- Type de cle PGP: RSA 4096 ou ECC Curve25519")
print("- Adresse IP et savoir si c'est un utilisateur ProtonVPN")
print("- Empreinte Numerique de la cible (Source Ouverte et sur le Dark Net)\n")
# Prot1ntelligence banner
def printprot1ntelligencebanner():
"""
prot1ntelligence banner
"""
print("""\u001b[32m\033[1m
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ____ ____ ____ __________ ________________ __ _________________ ______________ *
* / __ \/ __ \/ __ \/_ __< / | / /_ __/ ____/ / / / / _/ ____/ ____/ | / / ____/ ____/ *
* / /_/ / /_/ / / / / / / / / |/ / / / / __/ / / / / / // / __/ __/ / |/ / / / __/ *
* / ____/ _, _/ /_/ / / / / / /| / / / / /___/ /___/ /____/ // /_/ / /___/ /| / /___/ /___ *
* /_/ /_/ |_|\____/ /_/ /_/_/ |_/ /_/ /_____/_____/_____/___/\____/_____/_/ |_/\____/_____/ *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠁⢠⣾⡿⣿⣿⣿⣛⡛⢟⣿⣿⣛⣻⣿⣿⣿⢿⣷⡅⠈⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠁⠀⠀⢠⣿⠋⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠹⣿⡀⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⣼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣧⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⡏⠀⠀⣀⣤⣤⣄⡀⠀⠀⠀⠀⠀⢀⣠⣤⣤⣀⠀⠀⢻⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⣤⣧⣾⣿⣿⣿⣿⣿⣿⣿⣖⣂⣲⣿⣿⣿⣿⣿⣿⣿⣶⣼⣄⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠉⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿
⣿⣿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⡿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿
⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠈⠻⢿⣿⣿⠿⢋⣀⣀⠀⣀⣀⡙⠿⣿⣿⡿⠟⢁⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿
⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⢀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⢸⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿
⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣧⣤⣿⣿⣿⣿⠟⠻⠿⠾⠿⠟⠻⣻⣿⣿⣷⣄⣾⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿
⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣿⡇⠀⢘⣻⣿⣟⡃⠀⢸⣿⣿⣿⣿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿
⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿⣶⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿
⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠩⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿
⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣶⣿⣿⣿⣿⠛⠿⣻⣿⣿⣿⣿⠏⠋⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿
⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠉⠉⠉⠀⠀⠀⣿⣿⣿⣿⣿⣷⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿
⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿
C3n7ral051nt4g3ncy
GitHub: https://github.com/C3n7ral051nt4g3ncy
Twitter: @OSINT_Tactical
Tool Contributions (₿TC): \u001b[31mbc1q66awg48m2hvdsrf62pvev78z3vkamav7chusde\u001b[32m
___________________________________________________________________ \033[0m\n""")
# Proton API Check/Verification
def checkprotonapistatus():
"""
Proton API Online or Offline Check
"""
requestprotonmailstatus = requests.get('https://api.protonmail.ch/pks/lookup?op=index&[email protected]')
if requestprotonmailstatus.status_code == 200:
print(
"\u001b[32m\033[1m\n\nGood to go! ProtonMail API is ONLINE!!!\u001b[32m \U0001F7E2 \U0001F680 \n\u001b[33mRAS! API ProtonMail est EN LIGNE!!! \033[0m \U0001F7E2 \U0001F680 \n\n")
else:
print(
"\u001b[31m Protonmail API is OFFLINE\U0001F534 | \u001b[31m ProtonMail API est HORS LIGNE \U0001F534")
# Script Choices Intro in English and French
def printprot1ntelligenceintro():
prot1ntelligenceintro = """
\u001b[31m\U0001F575\033[1m INTELLIGENCE COLLECTION METHOD: \n\u001b[31mCHOIX METHODE DE COLLECTE DE RENSEIGNEMENT:\n
\u001b[32m\U0001F50D \033[1mALPHA\033[0m\u001b[32m: Type alpha to check if a ProtonMail account exists\n\u001b[33m\033[1mALPHA\033[0m\u001b[33m: Tapez alpha pour verifier si un compte ProtonMail existe
\u001b[32m\U0001F4E1 \033[1mBRAVO\033[0m\u001b[32m: Type bravo to run a search on the Proton email to check digital footprints\n\u001b[33m\033[1mBRAVO\033[0m\u001b[33m: Tapez bravo pour lancer une verification sur le mail Proton et voir l'empreinte numérique
\u001b[32m\U0001F3F4 \033[1mCHARLIE\033[0m\u001b[32m: Type charlie to run a Dark Web search on the Proton Email\n\u001b[33m\033[1mCHARLIE\033[0m\u001b[33m: Tapez charlie pour lancer une verification Dark Net sur le mail
\u001b[32m\U0001F511 \033[1mDELTA\033[0m\u001b[32m: Type delta to get ProtonMail user PGP Key and Key creation date\n\u001b[33m\033[1mDELTA\033[0m\u001b[33m: Tapez delta pour obtenir la cle PGP de l'utilisateur et date de creation de la cle
\u001b[32m\U0001F4BB \033[1mECHO\033[0m\u001b[32m: Type echo to verify if an IP address belongs to a ProtonVPN user\n\u001b[33m\033[1mECHO\033[0m\u001b[33m: Tapez echo pour verifier si une adresse IP appartient a un utilisateur ProtonVPN\u001b[32m
"""
print(prot1ntelligenceintro)
# ProtonMail account validity check
def protonmailaccountcheck():
"""
ALPHA : Check if ProtonMail account exists
"""
invalidEmail = True
regexEmail = "([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)"
print(
"\033[1m\u001b[32m\nCheck if ProtonMail account exists \n\u001b[33mVerifier si compte ProtonMail existe:\033[0m\u001b[32m\n")
while invalidEmail:
mail = input("\033[1mEmail + Enter : ")
if (re.search(regexEmail, mail)):
invalidEmail = False
else:
print("\u001b[31m\n\nProtonMail user does not exist\u001b[32m")
invalidEmail = True
requestProton = requests.get('https://api.protonmail.ch/pks/lookup?op=index&search=' + str(mail))
bodyResponse = requestProton.text
protonmailaccountdoesnotexist = "info:1:0"
protonmailaccountexists = "info:1:1"
if protonmailaccountdoesnotexist in bodyResponse:
print("\u001b[31m\n\nProtonMail account is NOT VALID")
if protonmailaccountexists in bodyResponse:
print("\033[1m\n\nProtonMail Account is VALID!!!\033[0m\U0001F4A5")
# Run a search on the Email address and check for Digital Footprints
def emailtraces():
"""
BRAVO : Check Email Traces (Open Source) with Google Dork
"""
print("\033[1m\u001b[32m\nCheck server status/\u001b[33m Verification statut du serveur:\u001b[32m\n")
response = requests.get('https://google.com')
print(response)
if response.status_code == 200:
print('Status: Success!\n')
elif response.status_code == 404:
print('Not Found.')
searchfor = input(
"""\u001b[32mEnter Target Email in quotation marks!(Example:"[email protected]")\n\u001b[33mEntrez le Mail de la Cible dans des guillemets!:\u001b[32m """)
print("\nProcessing request... \u001b[33mRecherche en cours...\u001b[32m\n")
for result in search(searchfor, tld="com", num=200, stop=200, pause=2):
print(result)
# Run a DarkWeb search on the email address
def darkwebtraces():
"""
CHARLIE : Check Dark Web Email Traces
"""
print("\033[1m\u001b[32m\nCheck server status\n\u001b[33mVerification statut du serveur:\u001b[32m\n")
response = requests.get('https://ahmia.fi')
print(response)
if response.status_code == 200:
print('Status: Success!\n')
elif response.status_code == 404:
print('Not Found.')
choice = input(
"""\033[1mView results in Browser ("B") or Terminal ("T")?\n\u001b[33mVoir resultats dans Navigateur ("B") ou Terminal ("T")?\n\n\u001b[32mB/T: """)
if choice == "B":
darkwebbrowser()
if choice == "T":
darkwebterminal()
# Search with the Dark Web Browser opening automatically
def darkwebbrowser():
"""
Dark Web Browser Open
"""
query = input("""\nInput Target email or any query to search the Dark Web (example: [email protected])\n\u001b[33mMail de la cible\u001b[32m: """)
webbrowser.open("https://ahmia.fi/search/?q=%s" % query)
# Search from Terminal with search results displayed within the terminal
def darkwebterminal():
"""
Dark Web Terminal
"""
query = input("Input target email: ")
URL = ("https://ahmia.fi/search/?q=%s" % query)
page = requests.get(URL)
request = requests.get(URL)
if request.status_code == 200:
print("\n\nRequest went through\n")
soup = BeautifulSoup(page.content, "html.parser")
for a_href in soup.find_all("a", href=True):
print(a_href["href"])
# Get ProtonMail User PGP Key
def pgpkeyinformation():
"""
DELTA: Get the ProtonMail user PGP Key and information
"""
choice = input(
"""\033[1m\nView PGP Key in Terminal ("T") or Download Key("D")?\n\u001b[33m\nVoir cle PGP dans Terminal ("T") ou Telechargement directe ("D")?\n\n\u001b[32mD/T: """)
if choice == "T":
pgpkeyview()
if choice == "D":
pgpkeydirectdownload()
def pgpkeydirectdownload():
"""
Download PGP Key Directly
"""
query = input(
"""\nInput Target email to Download PGP Key\n\u001b[33mEntrez le Mail de la cible pour Telechargement directe\u001b[32m: """)
webbrowser.open("https://api.protonmail.ch/pks/lookup?op=get&search=" + query)
def pgpkeyview():
"""
View PGP Key in Terminal
"""
invalidEmail = True
regexEmail = "([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)"
print(
"\033[1m\nInput the ProtonMail user email address to get the user PGP Key \n\u001b[33mObtenir la cle PGP de la cible avec le mail ProtonMail\033[0m\u001b[32m\n")
while invalidEmail:
mail = input("\033[1mProtonMail User Email + Enter: ")
if (re.search(regexEmail, mail)):
invalidEmail = False
else:
print("\u001b[31m\n\nProtonMail user does not exist\u001b[32m")
invalidEmail = True
requestProton = requests.get('https://api.protonmail.ch/pks/lookup?op=index&search=' + str(mail))
bodyResponse = requestProton.text
protonmailaccountdoesnotexist = "info:1:0"
protonmailaccountexists = "info:1:1"
if protonmailaccountdoesnotexist in bodyResponse:
print("\u001b[31m\n\nProtonMail account is NOT VALID")
if protonmailaccountexists in bodyResponse:
print("\033[1m\nProtonMail Account PGP Key Found!!!\n \033[0m\u001b[32m")
regexPattern1 = "2048:(.*)::" # RSA 2048-bit (Older but faster)
regexPattern2 = "4096:(.*)::" # RSA 4096-bit (Secure but slow)
regexPattern3 = "22::(.*)::" # X25519 (Modern, fastest, secure)
try:
timestamp = int(re.search(regexPattern1, bodyResponse).group(1))
dtObject = datetime.fromtimestamp(timestamp)
print("\nPGP Key Date and Creation Time:", dtObject)
print("Encryption Standard : RSA 2048-bit")
except:
try:
timestamp = int(re.search(regexPattern2, bodyResponse).group(1))
dtObject = datetime.fromtimestamp(timestamp)
print("PGP Key Date and Creation Time:", dtObject)
print("Encryption Standard : RSA 4096-bit ")
except:
timestamp = int(re.search(regexPattern3, bodyResponse).group(1))
dtObject = datetime.fromtimestamp(timestamp)
print("PGP Key Date and Creation Time:", dtObject)
print("Encryption Standard : ECC Curve25519 ")
# Get the USER PGP Key
invalidResponse = True
print("\033[1m\n\nGet User PGP Key? / \u001b[33mObtenir la cle PGP ?\033[1m\u001b[32m ")
while invalidResponse:
# Input
responseFromUser = input("""\033[1m "\033[1mY"/"N":\033[0m """)
# Text if the input is valid
if responseFromUser == "Y":
invalidResponse = False
requestProtonPublicKey = requests.get('https://api.protonmail.ch/pks/lookup?op=get&search=' + str(mail))
bodyResponsePublicKey = requestProtonPublicKey.text
print(bodyResponsePublicKey)
elif responseFromUser == "N":
invalidResponse = False
else:
print("Input Not Valid")
invalidResponse = True
# Check if the user IP address belongs to ProtonVPN
def protonvpnipsearch():
"""
ECHO : Find out if the IP address you have for the user makes him a ProtonVPN user
"""
while True:
try:
ip = ipaddress.ip_address(input(
'\033[1m\n\nEnter Target IP address: (Example: "185.159.157.1")\n\u001b[33mAdresse IP de la Cible: \033[0m\u001b[32m '))
break
except ValueError:
continue
requestProton_vpn = requests.get('https://api.protonmail.ch/vpn/logicals')
bodyResponse = requestProton_vpn.text
if str(ip) in bodyResponse:
print(
"\033[1m\n\nThis IP belongs to a ProtonVPN user!!! \U0001F4A5 \U0001F4BB \n\u001b[33mCette adresse IP appartient a un utilisateur ProtonVPN!!! \U0001F4A5 \U0001F4BB \033[0m\u001b[32m ")
else:
print(
"\u001b[31m\033[1m\n\nThis IP address does not belong to ProtonVPN user \nCette adresse IP n'appartient pas a un utilisateur ProtonVPN\033[0m\u001b[32m ")
def main():
printprot1ntelligencebanner()
choice = input(
"""\033[1m\u001b[32mType "c" to check API Status: """)
if choice == "c":
checkprotonapistatus()
choice = input("""\033[1m\u001b[32mView Modules? /\u001b[33m Voir Modules?\u001b[32m "Y" or "N":\033[0m\u001b[32m """)
if choice == "Y":
printprot1ntelligenceintro()
while True:
choice = input(
"""\033[1mMake Choice by typing the letter (Example:"A"): \u001b[33m\nFaire un Choix en tapant la lettre (Exemple:"A"): \u001b[32m\033[1m\n\n[A] ALPHA | [B] BRAVO | [C] CHARLIE | [D] - DELTA | [E] - ECHO : \033[0m\u001b[32m""")
if choice == "A":
protonmailaccountcheck()
if choice == "B":
emailtraces()
if choice == "C":
darkwebtraces()
if choice == "D":
pgpkeyinformation()
if choice == "E":
protonvpnipsearch()
inp = input("\n\n\u001b[32m\033[1mContinue Y/N: ")
if inp.lower() == 'n':
break
if __name__ == '__main__':
main()