HULK-v3 icon indicating copy to clipboard operation
HULK-v3 copied to clipboard

[BUG] aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Open Jalkhov opened this issue 1 year ago • 3 comments

Choose a Category:

  • [ ] Server
  • [X] Client
  • [ ] Gui
  • [ ] Documentation

Describe the bug Always, after 500 attacks, errors appear on the console, and the one in the title is the exception that first shows up.

To Reproduce Steps to reproduce the behavior:

  1. Execute hulk_launcher.exe server https://target.com. Shows correctly info.
  2. Execute hulk_launcher.exe client. Start attack corectly.
  3. After 500 attacks shows erros

Expected behavior I'm not sure what result I should expect, perhaps that there was an error in the attack or that it was successful, but I sense that if unhandled errors are shown there must be a problem.

Output

Console output (not complete, too large)
[127.0.0.1:54943] Launching attack no. 499 on https://target.com
[127.0.0.1:54943] Launching attack no. 500 on https://target.com
Exception in thread Thread-7:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-8:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-3:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-2:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-5:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-4:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Exception in thread Thread-6:
Traceback (most recent call last):
  File "threading.py", line 932, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "hulk_launcher.py", line 107, in <lambda>
  File "asyncio\base_events.py", line 616, in run_until_complete
  File "hulk.py", line 387, in monitor
  File "hulk.py", line 262, in attack
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 559, in _request
  File "aiohttp\client_reqrep.py", line 898, in start
  File "aiohttp\streams.py", line 616, in read
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
Task was destroyed but it is pending!
task: <Task pending name='Task-352' coro=<Missile._launch() running at hulk.py:133> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x000000000A3DE1C0>()]> cb=[gather.<locals>._done_callback() at asyncio\tasks.py:769]>
Exception ignored in: <coroutine object Missile._launch at 0x00000000054559C0>
Traceback (most recent call last):
  File "hulk.py", line 133, in _launch
  File "aiohttp\client.py", line 1138, in __aenter__
  File "aiohttp\client.py", line 535, in _request
  File "aiohttp\connector.py", line 542, in connect
  File "aiohttp\connector.py", line 907, in _create_connection
  File "aiohttp\connector.py", line 1175, in _create_direct_connection
  File "aiohttp\connector.py", line 986, in _wrap_create_connection
  File "asyncio\base_events.py", line 1050, in create_connection
  File "asyncio\base_events.py", line 1082, in _create_connection_transport
  File "asyncio\sslproto.py", line 317, in close
  File "asyncio\sslproto.py", line 591, in _start_shutdown
  File "asyncio\sslproto.py", line 732, in _abort
  File "asyncio\selector_events.py", line 672, in abort
  File "asyncio\selector_events.py", line 723, in _force_close
  File "asyncio\base_events.py", line 719, in call_soon
  File "asyncio\base_events.py", line 508, in _check_closed
RuntimeError: Event loop is closed

Desktop (please complete the following information):

  • OS: [Windows 10 LTSC]
  • Browser [Firefox]
  • Version [126.0 x64]

Additional context

  • I am using Windows binaries.
  • Target 100% Online.

Jalkhov avatar May 23 '24 17:05 Jalkhov

Hey thanks for the detailed report. Since it's hard to debug the issue from the posted traceback, let's try to narrow it down.

  1. Did you try it on a different Target? Is it behaving similarly for all the targets?
  2. Is the target actually going down when you are getting this error and then recovering quickly?
  3. What are the logs on the server right at the moment you see this error on the client?
  4. Are both client and server running on the same machine?

My gut feeling is that: A. the target is actually going down and recovering immediately through some kind of self-healing load balancer. B. There's an Anti-DDoS in place, which instead of sending an error response with a 400+ status code, it's actually closing the connection.

Hyperclaw79 avatar May 27 '24 05:05 Hyperclaw79

Hi thanks for the response...

  1. I have tested with a random site, link in logs.
  2. I can't tell if the site crashes and recovers quickly, since I refresh the page and it is still up, if it is something very fleeting I don't notice it.
  3. I have posted logs.
  4. Yes, both are on the same machine, I use cmder, server on one tab and client on the other.

Target 1 - client.log Target 1 - server.log

In the flollowing target the script stuck in aiohttp.client_exceptions.ClientOSError: [WinError 10054] An existing connection has been forced broken by the remote host. and never ends.

Target 2 - client.log Target 2 - server.log

Jalkhov avatar May 27 '24 20:05 Jalkhov

I got some time to look through the logs but unfortunately, there's no concrete giveaway on what's the exact issue. However, judging purely based on the logs, the communication between Hulk Server and Hulk Client is breaking abruptly and not the actual request from Hulk Server to the target. I'll need to recreate the setup and test it myself to debug further. I'll update you once I get the time to do this.

Hyperclaw79 avatar Jun 06 '24 11:06 Hyperclaw79