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

ModuleNotFoundError: No module named 'imp' #72

Open
harivenu opened this issue Feb 3, 2024 · 3 comments
Open

ModuleNotFoundError: No module named 'imp' #72

harivenu opened this issue Feb 3, 2024 · 3 comments

Comments

@harivenu
Copy link

harivenu commented Feb 3, 2024

Tried with docker

docker run --rm droope/droopescan scan drupal -u https://www.harivenu.com

Getting this deprecation error.

/usr/local/bin/droopescan:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('droopescan==1.45.1')
Traceback (most recent call last):
File "/usr/local/bin/droopescan", line 7, in
exec(compile(f.read(), file, 'exec'))
File "/app/droopescan", line 3, in
from dscan import droopescan
File "/app/dscan/droopescan.py", line 4, in
from cement.core import backend, foundation, controller, handler
File "/usr/local/lib/python3.12/site-packages/cement/core/foundation.py", line 8, in
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
from imp import reload # pragma: no cover
^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'imp'

-OS & installation method : Ubuntu and Docker installation

@tehmoon
Copy link

tehmoon commented Mar 24, 2024

@harivenu Use: python:3.3 in the Dockerfile and pystache==0.5.4 in the setup.py. Here's the patch:

diff --git a/Dockerfile b/Dockerfile
index b7559b9..a1e7b80 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
 # Dockerfile for droope/droopescan
 # License AGPL
-FROM python:3
+FROM python:3.3
 
 LABEL org.label-schema.name="droopescan" \
     org.label-schema.description="A plugin-based scanner that aids security researchers in identifying issues with several CMS." \
diff --git a/setup.py b/setup.py
index cb25c02..847b0f0 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(
     install_requires=[
         'cement>=2.6,<2.6.99',
         'requests',
-        'pystache',
+        'pystache==0.5.4',
     ],
     extras_require={
         ':python_version == "2.7"': ['futures']

@janmashat
Copy link

or docker run --rm asannou/droopescan

@FLX-0x00
Copy link

FLX-0x00 commented Jun 3, 2024

@harivenu Use: python:3.3 in the Dockerfile and pystache==0.5.4 in the setup.py. Here's the patch:

diff --git a/Dockerfile b/Dockerfile
index b7559b9..a1e7b80 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
 # Dockerfile for droope/droopescan
 # License AGPL
-FROM python:3
+FROM python:3.3
 
 LABEL org.label-schema.name="droopescan" \
     org.label-schema.description="A plugin-based scanner that aids security researchers in identifying issues with several CMS." \
diff --git a/setup.py b/setup.py
index cb25c02..847b0f0 100755
--- a/setup.py
+++ b/setup.py
@@ -46,7 +46,7 @@ setup(
     install_requires=[
         'cement>=2.6,<2.6.99',
         'requests',
-        'pystache',
+        'pystache==0.5.4',
     ],
     extras_require={
         ':python_version == "2.7"': ['futures']

The python 3.3 docker image will not work as the certificates have expired and the underlying OS is debian jessy which does not get updates. Just use python:3.7-slim as docker image with the patch of the setup file and you are good to go.

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

4 participants