-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
162 lines (140 loc) · 5.1 KB
/
main.py
File metadata and controls
162 lines (140 loc) · 5.1 KB
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
import os
import sys
import threading
try:
import re, requests
except ModuleNotFoundError:
os.system('pip install re && pip install requests')
#----- Color Format -----#
R = '\033[31m'
G = '\033[32m'
Y = '\033[33m'
B = '\033[34m'
M = '\033[35m'
C = '\033[36m'
W = '\033[37m'
BR= '\033[91m'
BG= '\033[92m'
BY= '\033[93m'
BB= '\033[94m'
BM= '\033[95m'
BC= '\033[96m'
BW= '\033[97m'
#----- Table Format -----#
def tables(a,b,c,d):
return "{:10} {:10} {:10} {:10}".format(a,b,c,d)
def table(a,b,c,d,e):
return "{:22} {:20} {:20} {:20} {:13}".format(a,b,c,d,e)
if not os.path.exists('data'):
os.mkdir('data')
#----- Open TXT File -----#
tulis = open('data/proxy_result.txt','a+')
RouterOS = open('data/RouterOS.txt','a+')
Mikrotik = open('data/Mikrotik.txt','a+')
tempw = open('data/temp','a+')
tempr = open('data/temp','r+')
#----- All Variables Here -----#
mode = 'http://'
r1b = r1a = r2b = r2a = 0
count=1
succ=0
fail=0
to = 10
ip=[]
threads=[]
#----- All Functions -----#
def prints(teks):
sys.stdout.write(teks)
def welcome():
def printf(p1, p2):
return "{:<27} {:>0}".format(p1, p2)
os.system('clear')
print(G)
print(printf(f'{G} _____',f'| {Y}PROXY{W}'))
print(printf(f'{G} / // \\',f'| {Y}PORT{W}'))
print(printf(f'{G} / // /\\ \\',f'| {Y}SCANNER{W}'))
print(printf(f'{G} / // /__\\_\\',f'| {C}V1.0{W}'))
print(printf(f'{G} / //_______ \\','|'))
print(printf(f'{G} / //_/______\\ \\','| Created by.'))
print(printf(f'{G} / //____________\\',f'| {BR}Luthfi zXc{W}'))
print(printf(f'{G} \\_______________/','|'))
print('\n\033[31m Yt: \033[33mhttp://youtube.com/luthfizxc\n')
print(f'{Y}Make sure your internet connection stabil and fast before using this tool')
def menu():
global tb,ta,pb,pa
welcome()
print(C+'\n#------------------------------------------------#'+W)
print(f'{Y} Masukkan Range Proxy ')
print(f'{BM} Contoh: min = 127.28.88.0 | max = 127.28.91.255')
tb = str(input(f' {R}[!]{G} Masukkan Batas Bawah (min) : {Y}'))
tempw.write(tb+'\n')
ta = str(input(f' {R}[!]{G} Masukkan Batas atas (max) : {Y}'))
tempw.write(ta+'\n')
print(C+'#------------------------------------------------#'+W)
os.system('clear')
welcome()
print(C+'\n#------------------------------------------------#'+W)
print(f'{Y} Masukkan Range Port')
print(f'{BM} Contoh: from 80 to 1000 ')
pb = int(input(f' {R}[!]{G} From : {Y}'))
pa = int(input(f' {R}[!]{G} To : {Y}'))
print(C+'#------------------------------------------------#'+W)
os.system('clear')
welcome()
print(C+'\n#------------------------------------------------#'+W)
def filter():
global r1b,r1a,r2b,r2a
i=0
head = re.search(r'(.*)\.\d+\.\d+', tb).group(1)
r1b = re.search(r'\d+\.\d+\.(.*?)\.\d+', tb).group(1)
r1a = re.search(r'\d+\.\d+\.(.*?)\.\d+', ta).group(1)
r2b = re.search(r'\d+\.\d+\.\d+\.(.*)', tb).group(1)
r2a = re.search(r'\d+\.\d+\.\d+\.(.*)', ta).group(1)
for r1 in range(int(r1b), int(r1a) + 1):
for r2 in range(int(r2b), int(r2a) + 1):
v = f'{head}.{str(r1)}.{str(r2)}'
ip.append(v)
i = i + 1
return ip
def req(ip,port):
global count,succ,fail
try:
zz = 'http://' + str(ip) + ':'+str(port)
r = requests.get(zz, timeout=to)
tulis.write(ip + ':'+port+'\n')
if 'RouterOS' in r.text:
RouterOS.write(ip + ':'+port+'\n')
if 'Mikrotik' in r.text:
Mikrotik.write(ip + ':'+port+'\n')
succ = succ+1
except KeyboardInterrupt:
print('\nExit')
tulis.close()
exit()
except:
fail = fail+1
cck= table(f'\r{Y}|{BM} {count}',f'{Y}|{BG} {succ}',f'{Y}|{BR} {fail}',f'{Y}|{W} {str(threading.active_count())}',f' {Y}|{W}')
prints(cck)
count +=1
#----- RUN PROGRAM -----#
if __name__ == '__main__':
menu()
filter()
global cck
hitung = (int(r1a)-int(r1b)+1)*(int(r2a)-int(r2b)+1)*(pa-pb+1)
print(f'{Y}Proxy: {tb} - {ta} | Port: {pb} - {pa}')
print(f'{BG}Checking '+str(hitung)+' proxies\n')
print(f'{BY}Please wait....')
print(' ________________________________________________')
print(tables('| Checking','| Success','| Fail','| Thread Core |'))
for b in ip:
for d in range(pb,pa+1):
t= threading.Thread(target=req,args=(b,str(d),))
threads.append(t)
for t in threads:
t.start()
for t in threads:
t.join()
print(f'\n\n{W}Scanned Proxy saved to : {os.getcwd()}/data/proxy_result.txt')
tulis.write('\n')
tulis.close()