-
Notifications
You must be signed in to change notification settings - Fork 67
/
ghost_eye.py
408 lines (343 loc) · 17.1 KB
/
ghost_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
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
#!/usr/bin/env/python3
# This Python file uses the following encoding: utf-8
# ===== #
#
# ▀█████████▄ ▄████████ Websites: HackingPassion.com | Bullseye0.com
# ███ ███ ███ ███ Author: Jolanda de Koff | Bulls Eye
# ███ ███ ███ █▀ GitHub: https://github.com/BullsEye0
# ▄███▄▄▄██▀ ▄███▄▄▄ linkedin: https://www.linkedin.com/in/jolandadekoff
# ▀▀███▀▀▀██▄ ▀▀███▀▀▀ Facebook Group: https://www.facebook.com/groups/hack.passion/
# ███ ██▄ ███ █▄ Facebook: https://www.facebook.com/profile.php?id=100069546190609
# ███ ███ ███ ███ Twitter: https://twitter.com/bulls__eye
# ▄█████████▀ ██████████ LBRY: https://lbry.tv/$/invite/@hackingpassion:9
# Patreon: https://www.patreon.com/jolandadekoff
# Bulls Eye..!
# ===== #
# ===== #
# Created July 2019 | Copyright (c) 2019 - 2021 Jolanda de Koff.
# Update April 2021
# ===== #
########################################################################
# 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...
########################################################################
# install dnsutils
# install gnome-terminal
# install httpie
# install mtr
# sudo apt install dnsutils gnome-terminal httpie mtr
# sudo pacman -S dnsutils gnome-terminal httpie mtr
########################################################################
from bs4 import BeautifulSoup
import cfscrape
from collections import deque
import json
import nmap
import os
from os import system
import re
import requests
import requests.exceptions
import requests as res
from requests import get
import sys
import time
from time import gmtime, strftime
from urllib.error import URLError
from urllib.parse import urlsplit
import urllib3
import urllib.request
from urllib.request import urlopen
import urllib.parse
import webtech
def banner():
print(""" \033[1;34m
('-. .-. .-') .-') _ ('-. ('-.
( OO ) / Ghost ( OO ). ( OO) ) _( OO) Eye _( OO)
,----. ,--. ,--. .-'),-----. (_)---\_)/ '._ (,------. ,--. ,--.(,------.
' .-./-') | | | |( OO' .-. '/ _ | |'--...__) | .---' \ `.' / | .---'
| |_( O- )| .| |/ | | | |\ :` `. '--. .--' | | .-') /) | |
| | .--, \| |\_) | |\| | '..`''.) | | (| '--.(OO \ /. (| '--.
(| | '. (_/| .-. | \ | | | |.-._) \ | | | .--' | / / | .--'
| '--' | | | | | `' '-' '\ / | | | `---.`-./ / | `---.
`------' `--' `--' `-----' `-----' `--' V2 `------' `--' `------'
\033[1;m
\033[34mGhost Eye - Information Gathering Tool \033[0m
\033[34mAuthor: Jolanda de Koff aka Bulls Eye \033[0m
\033[34mGithub: https://github.com/BullsEye0 \033[0m
\033[34mWebsite: https://hackingpassion.com \033[0m
\033[34mPatreon: https://www.patreon.com/jolandadekoff \033[0m
Hi there, Shall we play a game..? 😃 """)
def menu():
print("\n\033[1;34m[+] 1. EtherApe – Graphical Network Monitor (root)\033[1;m")
print("\033[1;34m[+] 2. DNS Lookup\033[1;m")
print("\033[1;34m[+] 3. Whois Lookup \033[1;m")
print("\033[1;34m[+] 4. Nmap Port Scan\033[1;m")
print("\033[1;34m[+] 5. HTTP Header Grabber\033[1;m")
print("\033[1;34m[+] 6. Clickjacking Test - X-Frame-Options Header\033[1;m")
print("\033[1;34m[+] 7. Robots.txt Scanner\033[1;m")
print("\033[1;34m[+] 8. Cloudflare Cookie scraper\033[1;m")
print("\033[1;34m[+] 9. Link Grabber\033[1;m")
print("\033[1;34m[+] 10. IP Location Finder\033[1;m")
print("\033[1;34m[+] 11. Detecting CMS with Identified Technologies\033[1;m")
print("\033[1;34m[+] 12. Traceroute\033[1;m")
print("\033[1;34m[+] 13. Crawler target url + Robots.txt\033[1;m")
print("\033[1;34m[+] 14. Certificate Transparency log monitor\033[1;m")
print("\033[1;34m[x] 15. Exit\033[1;m\n")
def fun():
choice = ("1")
banner()
while choice != ("12"):
menu()
choice = input("\033[1;34m[+]\033[1;m \033[1;91mEnter your choice:\033[1;m ")
if choice == ("3"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Searching for Whois Lookup: \033[0m".format(target) + target)
time.sleep(1.5)
command = ("whois " + target)
proces = os.popen(command)
results = str(proces.read())
print(results + command)
except Exception:
pass
elif choice == ("2"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Searching for DNS Lookup: \033[0m".format(target) + target)
time.sleep(1.5)
command = ("dig " + target + " +trace ANY")
proces = os.popen(command)
results = str(proces.read())
print(results + command)
except Exception:
pass
elif choice == ("1"):
try:
os.system("reset")
os.system("gnome-terminal -e 'bash -c \"sudo etherape; exec bash\"'")
except Exception:
pass
elif choice == ("4"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Scanning Nmap Port Scan: \033[0m" + target)
print("This will take a moment... Get some coffee 😃 )\n")
time.sleep(1.5)
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(results + command + logPath)
print("\033[34mNmap Version: \033[0m", scanner.nmap_version())
except KeyboardInterrupt:
print("\n")
print("[-] User Interruption Detected..!")
time.sleep(1)
elif choice == ("5"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Scanning HTTP Header Grabber: \033[0m\n" + target)
time.sleep(1.5)
command = ("http -v " + target)
proces = os.popen(command)
results = str(proces.read())
print(results + command)
except Exception:
pass
elif choice == ("6"):
target = input("\033[1;91m[+] Enter the Domain to test: \033[1;m").lower()
os.system("reset")
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
print("\033[1;34m[~] Testing Clickjacking Test: \033[1;m" + target)
time.sleep(2)
try:
resp = requests.get(target)
headers = resp.headers
print("\nHeader set are: \n")
for item, xfr in headers.items():
print("\033[1;34m" + item + ":" + xfr + "\033[1;m")
if "X-Frame-Options" in headers.keys():
print("\n[+] \033[1;34mClick Jacking Header is present\033[1;m")
print("[+] \033[1;34mYou can't clickjack this site !\033[1;m\n")
else:
print("\n[*] \033[1;34mX-Frame-Options-Header is missing ! \033[1;m")
print("[!] \033[1;34mClickjacking is possible,this site is vulnerable to Clickjacking\033[1;m\n")
except Exception as ex:
print("\033[1;34mException caught: " + str(ex))
elif choice == ("7"):
try:
target = input("\033[1;91m[+] Enter Domain: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Scanning Robots.txt Scanner: \033[0m\n" + target)
time.sleep(1.5)
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
robot = target + "/robots.txt"
try:
bots = urlopen(robot).read().decode("utf-8")
print("\033[34m" + (bots) + "\033[1;m")
except URLError:
print("\033[1;31m[-] Can\'t access to {page}!\033[1;m".format(page=robot))
except Exception as ex:
print("\033[1;34mException caught: " + str(ex))
elif choice == ("8"):
target = input("\033[1;91m[+] Enter Domain: \033[1;m").lower()
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
os.system("reset")
print("[+] Cloudflare cookie scraper ")
time.sleep(1.5)
sess = cfscrape.create_scraper()
try:
print("[+] Target: " + target)
request = "GET / HTTP/1.1\r\n"
cookie_value, user_agent = cfscrape.get_cookie_string(target)
request += "Cookie: %s\r\nUser_Agent: %s\r\n" % (cookie_value, user_agent)
data = sess.get(target)
out = BeautifulSoup(data.content,'html.parser')
print("[+] Print Cookie\n")
print(request)
os.system('tput setaf 10')
print("\n[+] Scraper ")
print(out)
except ValueError:
print('[X] Unable to find Cloudflare cookies. This website does not have Cloudflare IUAM enabled.')
elif choice == ("9"):
try:
target = input("\033[1;91m[+] Enter Domain: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Scanning Link Grabber: \033[0m\n" + target)
time.sleep(2)
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
deq = deque([target])
pro = set()
try:
while len(deq):
url = deq.popleft()
pro.add(url)
parts = urlsplit(url)
base = "{0.scheme}://{0.netloc}".format(parts)
print("[+] Crawling URL " + "\033[34m" + url + "\033[0m")
try:
response = requests.get(url)
except (requests.exceptions.MissingSchema, requests.exceptions.ConnectionError):
continue
soup = BeautifulSoup(response.text, "lxml")
for anchor in soup.find_all("a"):
link = anchor.attrs["href"] if "href" in anchor.attrs else ''
if link.startswith("/"):
link = base + link
if not link in deq and not link in pro:
deq.append(link)
continue
except KeyboardInterrupt:
print("\n")
print("[-] User Interruption Detected..!")
time.sleep(1)
print("\n \t\033[34m[!] I like to See Ya, Hacking Anywhere ..!\033[0m\n")
except Exception:
pass
elif choice == ("10"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
url = ("http://ip-api.com/json/")
response = urllib.request.urlopen(url + target)
data = response.read()
jso = json.loads(data)
os.system("reset")
print("\033[34m[~] Searching IP Location Finder: \033[0m".format(url) + target)
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")
except URLError:
print("\033[1;31m[-] Please provide a valid IP address!\033[1;m")
elif choice == ("11"):
try:
target = input("\033[1;91m[+] Enter Domain: \033[1;m").lower()
if not (target.startswith("http://") or target.startswith("https://")):
target = "https://" + target
os.system("reset")
print("\033[34m[~] Detecting CMS with Identified Technologies and Custom Headers from target url: \033[0m")
time.sleep(5)
command = ("mtr " + "-4 -rwc 1 " + target)
obj = webtech.WebTech()
results = obj.start_from_url(target, timeout=1)
sys.stdout.write(results)
except Exception:
pass
elif choice == ("12"):
try:
target = input("\033[1;91m[+] Enter Domain or IP Address: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Searching for Traceroute \033[0m".format(target) + target)
print(">> This will take a moment... Get some coffee << )\n")
time.sleep(5)
command = ("mtr " + "-4 -rwc 1 " + target)
proces = os.popen(command)
results = str(proces.read())
print("\033[1;34m" + results + command + "\033[1;m")
fun()
except KeyError:
pass
elif choice == ("13"):
target = input("\033[1;91m[+] Enter Domain: \033[1;m").lower()
os.system("reset")
print("\033[34m[~] Start crawler... \033[0m")
time.sleep(5)
print("[+] Target: " + target)
if not (target.startswith("http://") or target.startswith("https://")):
target = "http://" + target
try:
content = get(target).text
regex_t = re.compile(r"<title>(.*?)<\/title>")
tit = re.findall(regex_t, content)
regex_l = re.compile(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+")
link = re.findall(regex_l, content)
robots = get(target + "/robots.txt").text
print("[+] Title: "+ ''.join(tit) + "\n")
print("[+] Extract links: \n" + '\n'.join(link) + "\n")
print("[+] Robots.txt: \n" + robots)
except KeyError:
pass
elif choice == ("14"):
target = input("\033[1;91m[+] Enter Domain: \033[0m")
os.system("reset")
print("\033[34m[~] Scanning Certificate Transparency log monitor: \033[0m\n" + target)
time.sleep(1.5)
print("[+] Target: " + target)
try:
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36', }
results = requests.get('https://api.certspotter.com/v1/issuances?domain='+target+'&expand=dns_names&expand=issuer&expand=cert | jq ".[].dns_names[]" | sed "s/\"//g" | sed "s/\*\.//g" | sort -u | grep '+target,headers=headers)
results = results.text.split('\n')
print(*results, sep = "\n")
except KeyError:
pass
elif choice == ("15"):
time.sleep(1)
print("\n\t\033[34mBlue Eye\033[0m DONE... Exiting... \033[34mLike to See Ya Hacking Anywhere ..!\033[0m\n")
sys.exit()
else:
os.system("reset")
print("\033[1;31m[-] Invalid option..! \033[1;m")
# =====# Main #===== #
if __name__ == "__main__":
fun()