modify and rename should_i_... function
> remove :port from D > check if octets are within a correct range
This commit is contained in:
17
ppf.py
17
ppf.py
@@ -126,15 +126,16 @@ def proxyfind(sqlite = None):
|
|||||||
|
|
||||||
sqlite.commit()
|
sqlite.commit()
|
||||||
|
|
||||||
def should_i_append_this_item(ip):
|
def is_usable_proxy(proxy):
|
||||||
octets = ip.split('.')
|
octets = proxy.split(':')[0].split('.')
|
||||||
A = int(octets[0])
|
A = int(octets[0])
|
||||||
B = int(octets[1])
|
B = int(octets[1])
|
||||||
if (octets[0] < 1 or octets[0] > 254) or \
|
C = int(octets[2])
|
||||||
(octets[1] < 0 or octets[1] > 255) or \
|
D = int(octets[3])
|
||||||
(octets[2] < 0 or octets[2] > 255) or \
|
|
||||||
(octets[3] < 1 or octets[3] > 254): return False
|
if (A < 1 or A > 254) or \
|
||||||
if A == 10 or A == 127 or A == 0 or \
|
(B > 255 or C > 255 or D > 255) or \
|
||||||
|
(A == 10 or A == 127 or A == 0) or \
|
||||||
(A == 192 and B == 168) or \
|
(A == 192 and B == 168) or \
|
||||||
(A == 172 and B >= 16 and B <= 31): return False
|
(A == 172 and B >= 16 and B <= 31): return False
|
||||||
return True
|
return True
|
||||||
@@ -153,7 +154,7 @@ def proxyleech(sqlite, rows):
|
|||||||
|
|
||||||
uniques = []
|
uniques = []
|
||||||
for p in uniques_dict.keys():
|
for p in uniques_dict.keys():
|
||||||
if should_i_append_this_item(p): uniques.append(p)
|
if is_usable_proxy(p): uniques.append(p)
|
||||||
|
|
||||||
hash = hashlib.md5(''.join(uniques)).hexdigest()
|
hash = hashlib.md5(''.join(uniques)).hexdigest()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user