SamJoan / droopescan

A plugin-based scanner that aids security researchers in identifying issues with several CMSs, mainly Drupal & Silverstripe.
GNU Affero General Public License v3.0
1.22k stars 244 forks source link

ModuleNotFoundError: No module named 'imp' #72

Open harivenu opened 5 months ago

harivenu commented 5 months ago

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 commented 3 months ago

@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 commented 2 months ago

or docker run --rm asannou/droopescan

FLX-0x00 commented 1 month ago

@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.