Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 in Docker #74

Open
hvprvtr opened this issue Sep 30, 2024 · 2 comments
Open

Python 3.11 in Docker #74

hvprvtr opened this issue Sep 30, 2024 · 2 comments

Comments

@hvprvtr
Copy link

hvprvtr commented Sep 30, 2024

Hello. Docker image using "python:3" tag, like 'latest'. Now it is 3.12+ and imp module not exists there.
If now try to build&run docker image we got error:

Traceback (most recent call last):
  File "/usr/local/bin/droopescan", line 3, in <module>
    from dscan import droopescan
  File "/app/dscan/droopescan.py", line 4, in <module>
    from cement.core import backend, foundation, controller, handler
  File "/usr/local/lib/python3.12/site-packages/cement/core/foundation.py", line 8, in <module>
    from ..core import output, extension, arg, controller, meta, cache, mail
  File "/usr/local/lib/python3.12/site-packages/cement/core/extension.py", line 8, in <module>
    from imp import reload  # pragma: no cover
    ^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'imp'

Change plz it to
FROM python:3.11

@kali420120
Copy link

kali420120 commented Oct 13, 2024

I installed droopal through docker and though 3.11 python but still when I running this command I am getting error , the site is reachable and it is in my /etc/hosts file
image
docker run --rm droope/droopescan scan drupal -u http://drupal.inlanefreight.local

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 199, in _new_conn
sock = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/socket.py", line 974, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 495, in _make_request
conn.request(
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 441, in request
self.endheaders()
File "/usr/local/lib/python3.11/http/client.py", line 1298, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1058, in _send_output
self.send(msg)
File "/usr/local/lib/python3.11/http/client.py", line 996, in send
self.connect()
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 279, in connect
self.sock = self._new_conn()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 206, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPConnection object at 0x7f431ce64390>: Failed to resolve 'drupal.inlanefreight.local' ([Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='drupal.inlanefreight.local', port=80): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f431ce64390>: Failed to resolve 'drupal.inlanefreight.local' ([Errno -2] Name or service not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/droopescan", line 7, in
exec(compile(f.read(), file, 'exec'))
File "/app/droopescan", line 5, in
droopescan.main()
File "/app/dscan/droopescan.py", line 55, in main
ds.run()
File "/usr/local/lib/python3.11/site-packages/cement/core/foundation.py", line 764, in run
self.controller._dispatch()
File "/usr/local/lib/python3.11/site-packages/cement/core/controller.py", line 466, in _dispatch
return func()
^^^^^^
File "/usr/local/lib/python3.11/site-packages/cement/core/controller.py", line 472, in _dispatch
return func()
^^^^^^
File "/app/dscan/plugins/drupal.py", line 47, in drupal
self.plugin_init()
File "/app/dscan/plugins/internal/base_plugin_internal.py", line 297, in plugin_init
self.process_url(opts, functionality, enabled_functionality, hide_progressbar)
File "/app/dscan/plugins/internal/base_plugin_internal.py", line 316, in process_url
output = self.url_scan(url, opts, functionality, enabled_functionality,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dscan/plugins/internal/base_plugin_internal.py", line 414, in url_scan
url, host_header = self.determine_redirect(url, host_header, opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dscan/plugins/internal/base_plugin_internal.py", line 496, in determine_redirect
redir_url = self._determine_redirect(url, opts['verb'],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/dscan/plugins/internal/base_plugin_internal.py", line 463, in _determine_redirect
r = requests_verb(url, timeout=timeout, headers=headers, allow_redirects=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 624, in head
return self.request("HEAD", url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='drupal.inlanefreight.local', port=80): Max retries exceeded with url: / (Caused by onError("<urllib3.connection.HTTPConnection object at 0x7f431ce64390>: Failed to resolve 'drupal.inlanefreight.local' ([Errno -2] Name or service))

@gandli
Copy link

gandli commented Nov 27, 2024

Use to specify the low version of Python

sed -i 's/^FROM python:3.*/FROM python:3.10/' Dockerfile
docker build -t droope/droopescan .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants