Update server.py

This commit is contained in:
Namhyeon Go 2024-02-25 01:18:21 +09:00 committed by GitHub
parent 4fbd9bf522
commit d24045d2ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,6 +231,11 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
score += 1
strategies.append('SearchEngine3')
# check ID with RepeatedNumbers3 strategy
if all(map(repeated_numbers_test, matches)):
score += 1
strategies.append('RepeatedNumbers3')
# logging score
with open('score.log', 'a') as file:
file.write("%s\t%s\t%s\r\n" % ('+'.join(matches), str(score), '+'.join(strategies)))
@ -617,5 +622,9 @@ def search_engine_test(s):
return num_results > 2
# Strategy: RepeatedNumbers3
def repeated_numbers_test(s):
return bool(re.search(pattern, r'\d{3,}'))
if __name__== "__main__":
start()