Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Feb 17, 2024
1 parent 742bd8d commit 2978c73
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,14 @@ def proxy_connect(webserver, conn):
def proxy_check_filtered(response, webserver, port):
filtered = False

try:
text = response.decode(client_encoding)

filtered = text.find('@misskey.io') > -1 or text.find('ctkpaarr') > -1 or re.search(r'\b\w{10}@\w+\.\w+\b', text)
if filtered:
print ("[*] filtered from %s:%s" % (webserver.decode(client_encoding), str(port)))
print ("[*] ====== start response data =====")
print ("%s" % (text))
print ("[*] ====== end response data =====")
except:
print ("[*] multimedia is allowed")
text = response.decode(client_encoding, errors='ignore')

filtered = text.find('@misskey.io') > -1 or text.find('ctkpaarr') > -1 or re.search(r'\b\w{10}@\w+\.\w+\b', text)
if filtered:
print ("[*] filtered from %s:%s" % (webserver.decode(client_encoding), str(port)))
#print ("[*] ====== start response data =====")
#print ("%s" % (text))
#print ("[*] ====== end response data =====")

return filtered

Expand Down

0 comments on commit 2978c73

Please sign in to comment.