audibleblink / doxycannon

A poorman's proxycannon and botnet, using docker, ovpn files, tor nodes, and dante socks5 proxies
GNU General Public License v3.0
129 stars 62 forks source link

Warn if Doxycannon (containers) are already running #20

Closed routeback closed 4 years ago

routeback commented 5 years ago

If you try to start DoxyCannon after you already have containers running, it will provide a very long error message and stop accepting terminal input (Ctrl + C will not break, must kill DoxyCannon process manually in another terminal).

Is it possible to add a check for running containers that match the *.ovpn configuration files and notify the user that 'The cannon is already armed' prior to performing any work?


root@:$ ./doxycannon.py --build
[*] Image audibleblink/doxycannon built.
root@:$ ./doxycannon.py --up
[+] Writing HAProxy configuration
[+] Writing Proxychains4 configuration
Starting: us-tx-108.protonvpn.com.udp1194
Starting: us-il-105.protonvpn.com.udp1194
Starting: us-nj-04.protonvpn.com.udp1194
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./doxycannon.py", line 166, in multistart
    detach=True)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 766, in run
    detach=detach, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 824, in create
    resp = self.client.api.create_container(**create_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 411, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 422, in create_container_from_config
    return self._result(res, True)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 235, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
APIError: 409 Client Error: Conflict ("Conflict. The container name "/us-il-105.protonvpn.com.udp1194" is already in use by container "9103148a541a0cc19ea824b1290e179f85a1f8067bd091f762aa0f4fc79b29ad". You have to remove (or rename) that container to be able to reuse that name.")
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./doxycannon.py", line 166, in multistart
    detach=True)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 766, in run
    detach=detach, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 824, in create
    resp = self.client.api.create_container(**create_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 411, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 422, in create_container_from_config
    return self._result(res, True)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 235, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
APIError: 409 Client Error: Conflict ("Conflict. The container name "/us-tx-108.protonvpn.com.udp1194" is already in use by container "9c850136d9effbe6cd5b310c4302850bc4160788a858296c57e6276b57c1bf0a". You have to remove (or rename) that container to be able to reuse that name.")

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./doxycannon.py", line 166, in multistart
    detach=True)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 766, in run
    detach=detach, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/models/containers.py", line 824, in create
    resp = self.client.api.create_container(**create_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 411, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 422, in create_container_from_config
    return self._result(res, True)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 235, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/client.py", line 231, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
APIError: 409 Client Error: Conflict ("Conflict. The container name "/us-nj-04.protonvpn.com.udp1194" is already in use by container "29dc5360e957294ce41683a57bda9b624ee926230ef7f49e732a41bab22c389b". You have to remove (or rename) that container to be able to reuse that name.")
audibleblink commented 5 years ago

good call

audibleblink commented 4 years ago

I like this idea and I have an idea on how I'd like to handle it, but it warrants a new Major release, by SemVer standards. For now, I'll just proved a less verbose log of the issue with #24