Commit 5c4bbce8 authored by anonym's avatar anonym
Browse files

Make tor-controlport-filter handle applications with no matching filter.

But they will not be able to do anything except PROTOCOLINFO,
AUTHENTICATE and QUIT, which is not very interesting.
parent a68d1da5
......@@ -154,7 +154,10 @@ class FilteredControlPortProxyHandler(socketserver.StreamRequestHandler):
def handle(self):
client_conn = next(conn for conn in psutil.net_connections() if conn.laddr == self.client_address)
client_exe_path = exe_path_of_pid(client_conn.pid)
client_filter = next(filter for filter in self.filters if any(exe_path for exe_path in filter['match-exe-paths'] if client_exe_path == exe_path))
try:
client_filter = next(filter for filter in self.filters if any(exe_path for exe_path in filter['match-exe-paths'] if client_exe_path == exe_path))
except StopIteration:
client_filter = {}
allowed_commands = client_filter.get('commands', {})
allowed_events = client_filter.get('events', [])
controller = self.connect_to_real_control_port()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment