mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-06-07 05:39:06 +00:00
Update server.py
This commit is contained in:
parent
7fd65a9af7
commit
293ff9dc8b
10
server.py
10
server.py
|
@ -172,7 +172,7 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
|
||||||
# convert to text
|
# convert to text
|
||||||
text = data.decode(client_encoding, errors='ignore')
|
text = data.decode(client_encoding, errors='ignore')
|
||||||
|
|
||||||
# check ID with K-Anonymity
|
# check ID with VowelRatio10 strategy
|
||||||
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'
|
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'
|
||||||
matches = list(set(re.findall(pattern, text)))
|
matches = list(set(re.findall(pattern, text)))
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
|
@ -183,14 +183,14 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
|
||||||
print ("[*] K-Anonymity strategy not working! %s" % (str(e)))
|
print ("[*] K-Anonymity strategy not working! %s" % (str(e)))
|
||||||
filtered = True
|
filtered = True
|
||||||
|
|
||||||
# check vowel ratio
|
# check ID with VowelRatio10 strategy
|
||||||
if filtered and len(matches) > 0:
|
if filtered and len(matches) > 0:
|
||||||
def vowel_ratio_test(s):
|
def vowel_ratio_test(s):
|
||||||
ratio = calculate_vowel_ratio(s)
|
ratio = calculate_vowel_ratio(s)
|
||||||
return ratio > 0.2 and ratio < 0.7
|
return ratio > 0.2 and ratio < 0.7
|
||||||
filtered = not all(map(vowel_ratio_test, matches))
|
filtered = not all(map(vowel_ratio_test, matches))
|
||||||
|
|
||||||
# check an attached images
|
# check an attached images (Not-CAPTCHA strategy)
|
||||||
if not filtered and len(matches) > 0 and truecaptcha_userid != '':
|
if not filtered and len(matches) > 0 and truecaptcha_userid != '':
|
||||||
def webp_to_png_base64(url):
|
def webp_to_png_base64(url):
|
||||||
try:
|
try:
|
||||||
|
@ -430,7 +430,7 @@ def pwnedpasswords_test(s):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Strategy: Not CAPTCHA - use truecaptcha.org
|
# Strategy: Not-CAPTCHA - use truecaptcha.org
|
||||||
def truecaptcha_solve(encoded_image):
|
def truecaptcha_solve(encoded_image):
|
||||||
url = 'https://api.apitruecaptcha.org/one/gettext'
|
url = 'https://api.apitruecaptcha.org/one/gettext'
|
||||||
data = {
|
data = {
|
||||||
|
@ -454,7 +454,7 @@ def truecaptcha_solve(encoded_image):
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Strategy: VowelRatio
|
# Strategy: VowelRatio10
|
||||||
def calculate_vowel_ratio(s):
|
def calculate_vowel_ratio(s):
|
||||||
# Calculate the length of the string.
|
# Calculate the length of the string.
|
||||||
length = len(s)
|
length = len(s)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user