stamparm / maltrail

Malicious traffic detection system
MIT License
5.94k stars 1.02k forks source link

[BUG] python six module #19257

Closed jafo65 closed 2 weeks ago

jafo65 commented 1 month ago

Installed latest maltrail 0.69 on Ubu 24.04 LTS

on trying to initate sensor.py

Traceback (most recent call last): File "/opt/maltrail/sensor.py", line 33, in from core.common import check_connection File "/opt/maltrail/core/common.py", line 23, in from core.settings import config File "/opt/maltrail/core/settings.py", line 23, in from thirdparty.six.moves import urllib as _urllib ModuleNotFoundError: No module named 'thirdparty.six.moves'

updated all python modules to latest versions

stamparm commented 1 month ago

that same module six is included inside the Maltrail git repo (https://github.com/stamparm/maltrail/tree/master/thirdparty/six). in case that you did properly checkout the git repo and start the sensor with a proper environment (i.e. no fooling around with starting directory or smth like that), you would be able to start it out of the box

icolab commented 1 month ago

Hi, I have the same issue (even if six is in the right place) Thanks

stamparm commented 1 month ago

@icolab can you try the following (exact same lines to run, no modifications):

cd /tmp
wget "https://github.com/stamparm/maltrail/archive/refs/heads/master.zip"
unzip master.zip
cd maltrail-master
sudo -E python3 sensor.py
icolab commented 1 month ago

Hi @stamparm, Here is the output of the following commandes:

[tmp]# cd maltrail-master/ [maltrail-master]# ls CHANGELOG LICENSE plugins server.py CITATION.cff maltrail.conf README.md thirdparty core maltrail-sensor.service requirements.txt trails docker maltrail-server.service SECURITY.md html misc sensor.py [maltrail-master]# sudo -E python3 sensor.py Traceback (most recent call last): File "/tmp/maltrail-master/sensor.py", line 33, in from core.common import check_connection File "/tmp/maltrail-master/core/common.py", line 23, in from core.settings import config File "/tmp/maltrail-master/core/settings.py", line 23, in from thirdparty.six.moves import urllib as _urllib ModuleNotFoundError: No module named 'thirdparty.six.moves'

stamparm commented 1 month ago

i had one clean debian machine. did everything like above. can't reproduce the problem

IanNicki commented 3 weeks ago

I have exactly the same issue as @jafo65, I am using a python3.12 virtual environment. Using sudo <path_python_venv>/bin/pip3 install pcapy-ng for and sudo <path_python_venv>/bin/python3 sensor.py. Seems like the python-venv doesn't find the folder thirdparty

(py_venv) user@ubuntu:~/maltrail-master$ sudo ../py_venv/bin/python3 sensor.py 
Traceback (most recent call last):
  File "/home/user/maltrail-master/sensor.py", line 33, in <module>
    from core.common import check_connection
  File "/home/user/maltrail-master/core/common.py", line 23, in <module>
    from core.settings import config
  File "/home/user/maltrail-master/core/settings.py", line 23, in <module>
    from thirdparty.six.moves import urllib as _urllib
ModuleNotFoundError: No module named 'thirdparty.six.moves'
pierre-guillot commented 2 weeks ago

I have the same problem with my archlinux and maltrail : using python3.12 and it not work with excatly the same error.

Downgrade to 3.11 and it work again.

Regards.

MikhailKasimov commented 2 weeks ago

Looks related:

[1] https://stackoverflow.com/questions/78412744/running-cqlsh-returns-modulenotfounderror-no-module-named-six-moves [2] https://github.com/Datalux/Osintgram/issues/947#issuecomment-1872485426 [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1857492

MikhailKasimov commented 2 weeks ago

@jafo65 @icolab @pierre-guillot @IanNicki Please, let us know if problem is solved with the latest revision of MT, which contains Miroslav's patch. Thank you!

IanNicki commented 1 week ago

@stamparm and @MikhailKasimov, it runs like clockwork. Just tested it on Python 3.12.3 Thank you guys :+1: