-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathblue_eye.py
331 lines (268 loc) · 11.5 KB
/
blue_eye.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
#!/usr/bin/env/python3
# This Python file uses the following encoding:utf-8
# Author: Jolanda de Koff Bulls Eye
# GitHub: https://github.com/BullsEye0
# Website: https://hackingpassion.com
# linkedin: https://www.linkedin.com/in/jolandadekoff
# Facebook: facebook.com/jolandadekoff
# Facebook Page: https://www.facebook.com/ethical.hack.group
# Facebook Group: https://www.facebook.com/groups/hack.passion/
# YouTube: https://www.youtube.com/BullsEyeJolandadeKoff
# Blue Eye Created June- August 2019
# Blue Eye v2 January 2020
# Copyright (c) 2019 - 2020 Jolanda de Koff.
########################################################################
# A notice to all nerds and n00bs...
# If you will copy the developer's work it will not make you a hacker..!
# Respect all developers, we doing this because it's fun...
########################################################################
import dns.resolver
import json
import nmap
import os
import re
import requests
import socket
import time
import urllib.request
from time import gmtime, strftime
banner = ("""
\033[1;34m
▄▄▄▄ ██▓ █ ██ ▓█████ ▓█████▓██ ██▓▓█████
▓█████▄ ▓██▒ ██ ▓██▒▓█ ▀ ▓█ ▀ ▒██ ██▒▓█ ▀
▒██▒ ▄██▒██░ ▓██ ▒██░▒███ ▒███ ▒██ ██░▒███
▒██░█▀ ▒██░ ▓▓█ ░██░▒▓█ ▄ ▒▓█ ▄ ░ ▐██▓░▒▓█ ▄
░▓█ ▀█▓░██████▒▒▒█████▓ ░▒████▒ ░▒████▒ ░ ██▒▓░░▒████▒
░▒▓███▀▒░ ▒░▓ ░░▒▓▒ ▒ ▒ ░░ ▒░ ░ ░░ ▒░ ░ ██▒▒▒ ░░ ▒░ ░
▒░▒ ░ ░ ░ ▒ ░░░▒░ ░ ░ ░ ░ ░ ░ ░ ░▓██ ░▒░ ░ ░ ░
░ ░ ░ ░ ░░░ ░ ░ ░ ░ ▒ ▒ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░
░ ░ ░ v2
\033[1;m
\033[34mBlue Eye\033[0m Recon Toolkit
Author: Jolanda de Koff Bulls Eye
Github: https://github.com/BullsEye0
Website: https://HackingPassion.com
\033[1;31mHi there, Shall we play a game..?\033[0m 😃
""")
print (banner)
time.sleep(0.4)
target = input("[+] \033[34mWhat domain do you want to search: \033[0m").strip()
compname = input("[+] \033[34mEnter the company name: \033[0m").strip()
company = target.partition(".")
comp = company[0]
time.sleep(1)
def jan():
try:
url = ("http://ip-api.com/json/")
response = urllib.request.urlopen(url + target)
data = response.read()
jso = json.loads(data)
time.sleep(1.5)
print("\n [+] \033[34mUrl: " + target + "\033[0m")
print(" [+] " + "\033[34m" + "IP: " + jso["query"] + "\033[0m")
print(" [+] " + "\033[34m" + "Status: " + jso["status"] + "\033[0m")
print(" [+] " + "\033[34m" + "Region: " + jso["regionName"] + "\033[0m")
print(" [+] " + "\033[34m" + "Country: " + jso["country"] + "\033[0m")
print(" [+] " + "\033[34m" + "City: " + jso["city"] + "\033[0m")
print(" [+] " + "\033[34m" + "ISP: " + jso["isp"] + "\033[0m")
print(" [+] " + "\033[34m" + "Lat & Lon: " + str(jso['lat']) + " & " + str(jso['lon']) + "\033[0m")
print(" [+] " + "\033[34m" + "Zipcode: " + jso["zip"] + "\033[0m")
print(" [+] " + "\033[34m" + "TimeZone: " + jso["timezone"] + "\033[0m")
print(" [+] " + "\033[34m" + "AS: " + jso["as"] + "\033[0m" + "\n")
print ("»"*60 + "\n")
time.sleep(1)
except Exception:
pass
except KeyboardInterrupt:
print("\n")
print("[-] User Interruption Detected..!")
time.sleep(1)
def header():
try:
print("\033[34mScanning.... HTTP Header \033[0m" + target)
time.sleep(1.5)
command = ("http -v " + target)
proces = os.popen(command)
results = str(proces.read())
print("\033[1;34m" + results + command + "\033[1;m")
print ("»"*60 + "\n")
except Exception:
pass
except KeyboardInterrupt:
print("\n")
print("[-] User Interruption Detected..!")
time.sleep(1)
def nmaps():
try:
print("\033[34mScanning.... Nmap Port Scan: \033[0m" + target)
print ("[+]\033[34m - --> \033[0mThis may take a moment \033[34mBlue Eye\033[0m gathers the data.....\n")
time.sleep(1)
scanner = nmap.PortScanner()
command = ("nmap -Pn " + target)
process = os.popen(command)
results = str(process.read())
logPath = "logs/nmap-" + strftime("%Y-%m-%d_%H:%M:%S", gmtime())
print("\033[34m" + results + command + logPath + "\033[0m")
print("\033[34mNmap Version: \033[0m", scanner.nmap_version())
print ("»"*60 + "\n")
except Exception:
pass
except KeyboardInterrupt:
print("\n")
print("[-] User Interruption Detected..!")
time.sleep(1)
def aug():
print ("[+] \033[34mMail Servers:\033[0m " + target + "\n")
time.sleep(0.5)
for sun in dns.resolver.query(target, "MX"):
print ("\t\033[34m" + (sun.to_text()) + "\033[0m")
print ("\n" + "»" * 60)
print ("[+] \033[34mDNS Text Records:\033[0m " + target + "\n")
time.sleep(0.2)
for sun in dns.resolver.query(target, "TXT"):
print ("\t\033[34m" + (sun.to_text()) + "\033[0m")
print ("\n" + "»" * 60)
print ("[+] \033[34mNameserver Records:\033[0m " + target + "\n")
time.sleep(0.2)
for sun in dns.resolver.query(target, "NS"):
print ("\t\033[34m" + (sun.to_text()) + "\033[0m")
print ("\n" + "»" * 60)
okta = comp + ".okta.com"
webmail = "webmail." + comp + ".com"
email = "email." + comp + ".com"
slack = "%s.slack.com" % comp
try:
if len(socket.gethostbyname(okta)) <= 15:
print ("\n\t\033[34mHost of interest:\033[0m " + okta)
time.sleep(0.3)
if len(socket.gethostbyname(webmail)) <= 15:
print ("\t\033[34mHost of interest:\033[0m " + webmail)
time.sleep(0.3)
if len(socket.gethostbyname(email)) <= 15:
print ("\t\033[34mHost of interest:\033[0m " + email)
time.sleep(0.3)
if len(socket.gethostbyname(slack)) <= 15:
print ("\t\033[34mHost of interest:\033[0m " + slack + "\n")
time.sleep(0.3)
except Exception:
pass
def june():
print ("»" * 60 + "\n")
print ("[+] \033[34mSearch Results for: \033[0m%s " % target)
url = ("https://ctsearch.entrust.com/api/v1/certificates?fields=subjectDN&domain=%s&includeExpired=false&exactMatch=false&limit=5000" % target)
useragent = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36")
headers = {"User-Agent": useragent}
try:
print ("[+]\033[34m - --> \033[0mThis may take a moment \033[34mBlue Eye\033[0m gathers the data.....\n")
time.sleep(1)
response = requests.get(url, headers=headers)
rain = re.findall(r'subjectDN": "cn\\u003d[a-zA-Z0-9.\-]{1,}', response.text)
babs = []
for item in rain:
xtra = re.sub("subjectDN\": \"cn\\\\u003d", '', item)
babs.append(xtra)
dmset = set(babs)
counter = 0
print ("")
for itemm in dmset:
counter = counter + 1
print ("%s. %s" % (str(counter), str(itemm)))
try:
ns = dns.resolver.query(str(itemm), "A")
if "dns.resolver" in str(ns):
for joo in ns.response.answer:
for aug in joo.items:
ip = str(aug)
print("\t[+]\033[34m %s resolves to: %s\033[0m" % (str(itemm), str(ip)))
except Exception:
pass
print ("")
print ("\033[34m[+] Total Domains: %s\033[0m" % str(counter))
print ("»"*60 + "\n")
time.sleep(1)
except KeyboardInterrupt:
print ("\n\033[1;91m[!]\033[0 User Interruption Detected..!")
time.sleep(1)
except Exception:
pass
mainhub = ("https://github.com/%s" % comp)
gitpeople = ("https://github.com/orgs/%s/people" % comp)
response = requests.get(mainhub)
response_text = response.text
resp = requests.get(gitpeople)
respon_text = resp.text
listusers = re.findall(r'self\" href=\"[a-zA-Z0-9\-/]{3,}', respon_text)
listuser = []
def list_users():
try:
for item in listusers:
x = re.sub("self\" href=\"/", "", item)
listuser.append(x)
usersset = set(listuser)
counter = 0
if listusers != []:
print ("\033[34m[+] List of %s github user pages:\033[0m" % target)
print ("»"*60 + "\n")
for user in usersset:
try:
counter = counter + 1
userpage = ("https://github.com/%s" % user)
print (str(counter) + " \t[+] " + "\033[34m " + userpage + "\033[0m")
except Exception as e:
print("Error: %s" % e)
print ("")
print ("\033[34m[+] Total Users Found: %s\033[0m" % str(counter))
print ("»"*60 + "\n")
time.sleep(1)
except KeyboardInterrupt:
print ("\n")
print ("\033[1;91m[!]\033[0 User Interruption Detected..!")
time.sleep(1)
except Exception:
pass
def mails():
listofusers2 = set(listuser)
try:
print ("[+] \033[34mList of possible company email addresses harvested")
print ("from %s github user pages & duckduckgo searches:\033[0m" % target)
time.sleep(0.5)
print ("»"*60 + "\n")
for user in listofusers2:
userpage = ("https://api.github.com/users/%s/events/public" % user)
respon = requests.get(userpage)
respons_text = respon.text
findemail = re.findall(r'[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+', respons_text)
if findemail != []:
emailset = set(findemail)
for each in emailset:
if target in each:
print ("\t[+] \033[34m" + (each) + "\033[0m")
time.sleep(0.1)
searchurl = ("https://duckduckgo.com/html/?q=site%3Alinkedin.com+email+%40%22" + target + '%22')
webresponse = requests.get(searchurl)
webresp = webresponse.text
findem = re.findall(r'[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+', webresp)
if findem != [1]:
setmail = set(findem)
for each in setmail:
if target in each:
print ("\t[+] \033[34m" + (each) + "\033[0m\n\n")
time.sleep(1)
print ("\n\n\t\033[34m[!] I like to See Ya, Hacking\033[0m 😃\n\n")
except KeyboardInterrupt:
print ("\n\033[1;91m[!] User Interruption Detected..!\033[0")
time.sleep(1)
print ("\n\n\t\033[34m[!] I like to See Ya, Hacking\033[0m\n\n")
except Exception:
pass
print ("\n\t\033[34m I like to See Ya, Hacking\033[0m 😃\n")
# =====# Main #===== #
if __name__ == "__main__":
jan()
header()
nmaps()
aug()
june()
list_users()
mails()