Authenticated Scans

Running docker GVM on Ubuntu
When I run an authenticated scan on a host in my network, I find the following in my ospd-openvas log file. python3: can’t open file ‘/usr/share/doc/python3-impacket/examples/wmiexec.py’: [Errno 2] No such file or directory.
The files exist in the directory and they have read and execute perms for everyone. Do I need to add it as a volume for the docker containers to be able to access it? If so, where do I need to modify where openvas is looking for the file?

I added the following line to the volume tab for the ospd-openvas section in the docker compose file. - /usr/share/doc/python3-impacket/examples/:/usr/share/doc/python3-impacket/examples/

Did you have to install python3-impacket on the host?
(as i assume volume mappings is between host and docker)

will however add your fix, and restart containers to see if the error goes away
(i don’t have the /usr/share/doc/python3 folder on the host)

1 Like

Yes, I had to install impacket into the directory where it was looking.

1 Like

I implemented this fix. However, I’m getting the below error:
Traceback (most recent call last):
File “/usr/share/doc/python3-impacket/examples/wmiexec.py”, line 37, in
from impacket.examples.utils import parse_target
ModuleNotFoundError: No module named ‘impacket.examples.utils’

I’ve got this same issue.

If i map that volume, it doesn’t work.
But if i do find where impacket installed to (/usr/lib/python3.10/site-packages/impacket/examples)
I still get an error [Errno 13] Permission denied
Then if i add access so docker can read it i get another error:

Traceback (most recent call last):
  File "/usr/share/doc/python3-impacket/examples/wmiexec.py", line 37, in <module>
    from impacket.examples.utils import parse_target
ModuleNotFoundError: No module named 'impacket.examples.utils'

So i have no idea.

And another question, if this is required, why is it not installed into the container? Why does it need to be installed on the host, and volume mapped?

Also, I can see on (GitHub - fortra/impacket: Impacket is a collection of Python classes for working with network protocols.) that there is a docker container ( $ docker run -it --rm “impacket:latest”)
Is there a way to add that to the docker-compose stack?

For me, I installed impacket from github into the directory that it was looking in. You may need to use chmod to allow docker to be able to read it.

Git clone the impacket into the directory that it checks for the scripts. It looks like it is incomplete

Hi,

Are you saying just run on the host:

git clone https://github.com/SecureAuthCorp/impacket.git /usr/share/doc/python3-impacket/

I just tried that, and same error:

Traceback (most recent call last):
  File "/usr/share/doc/python3-impacket/examples/wmiexec.py", line 37, in <module>
    from impacket.examples.utils import parse_target
ModuleNotFoundError: No module named 'impacket.examples.utils'

Note that the “official” ospd-openvas Community Docker image received relevant updates today which might not require this change discussed previously anymore.

1 Like