I wanted to let you know a problem I found and how did I fix it in case someone stumbles upon the same issue.
Working on a Kali Linux I downloaded few weeks ago I wanted to try out what is new in Faraday. So far so good until I wanted to try the agent feature.
Because I was running faraday using docker-compose the agent initially not reach port 9000
2022-10-25 12:55:01,883 - faraday_agent_dispatcher - INFO {MainThread} [dispatcher.py:160 - register()] token_registration_url: http://localhost:5985/_api/v3/agents
2022-10-25 12:55:01,934 - faraday_agent_dispatcher - INFO {MainThread} [dispatcher.py:200 - register()] Registered successfully
Traceback (most recent call last):
File "/home/kali/.local/bin/faraday-dispatcher", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/cli/main.py", line 98, in run
exit_code = asyncio.run(main(config_file, logger, token))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/cli/main.py", line 75, in main
await dispatcher.connect()
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/dispatcher.py", line 231, in connect
async with websockets.connect(
File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 604, in __aenter__
return await self
File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 622, in __await_impl__
transport, protocol = await self._create_connection()
File "/usr/lib/python3.10/asyncio/base_events.py", line 1072, in create_connection
raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 9000, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 9000)
To fix this I just added the port 9000 to the port mapping in the downloaded docker-compose.yamlfile.
After fixing the port problem I got another error.
2022-10-25 13:10:22,876 - faraday_agent_dispatcher - INFO {MainThread} [dispatcher.py:200 - register()] Registered successfully
Traceback (most recent call last):
File "/home/kali/.local/bin/faraday-dispatcher", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/cli/main.py", line 98, in run
exit_code = asyncio.run(main(config_file, logger, token))
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/cli/main.py", line 75, in main
await dispatcher.connect()
File "/home/kali/.local/lib/python3.10/site-packages/faraday_agent_dispatcher/dispatcher.py", line 231, in connect
async with websockets.connect(
File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 604, in __aenter__
return await self
File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 622, in __await_impl__
transport, protocol = await self._create_connection()
File "/usr/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/lib/python3.10/asyncio/base_events.py", line 1107, in _create_connection_transport
protocol = protocol_factory()
File "/usr/lib/python3/dist-packages/websockets/legacy/client.py", line 160, in __init__
super().__init__(**kwargs)
File "/usr/lib/python3/dist-packages/websockets/legacy/protocol.py", line 154, in __init__
self._drain_lock = asyncio.Lock(
File "/usr/lib/python3.10/asyncio/locks.py", line 78, in __init__
super().__init__(loop=loop)
File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Lock() since it is no longer necessary
After googling a bit I discovered there was an issue with the websocket dependency which I solved forcing the version to be > 9.1.
Hi!
I wanted to let you know a problem I found and how did I fix it in case someone stumbles upon the same issue.
Working on a Kali Linux I downloaded few weeks ago I wanted to try out what is new in Faraday. So far so good until I wanted to try the agent feature.
Because I was running
faraday
usingdocker-compose
the agent initially not reach port 9000To fix this I just added the port 9000 to the port mapping in the downloaded
docker-compose.yaml
file.After fixing the port problem I got another error.
After googling a bit I discovered there was an issue with the websocket dependency which I solved forcing the version to be
> 9.1
.After patching the file you will have to run
pip install -e .
again.Hope this will help the faradaysec team or someone else there.