stamparm / maltrail

Malicious traffic detection system
MIT License
6.6k stars 1.09k forks source link

Windows 11 Returns #19252

Closed toneewa closed 7 months ago

toneewa commented 7 months ago

I read you don't support Windows, yet I saw that old version run fine. https://www.youtube.com/watch?v=eF_ZUNtyYHs image

Can you link me to the version they had, a fork that works, or a workaround for this problem. It exits after the message in attached photo.

Thanks

MikhailKasimov commented 7 months ago

Can you link me to the version they had

https://github.com/stamparm/maltrail/releases?page=4

toneewa commented 7 months ago

Thanks, I tried 0.29, and even 0.28, however, I get the same thing. I also even downloaded their displayed app Cmder, in the video they used, same results. Is there some trick to bypass the multi-thread OSError check? image

Thanks

stamparm commented 7 months ago

@toneewa sorry, but Maltrail is not supported on Windows OS. it was long ago, but due to problems with compiling of the "pcapy" package, we dropped the support

toneewa commented 7 months ago

It compiled for me (installed the library files). It's just when it goes to use sensor.py or server.py, it will not progress pass that error message.

stamparm commented 7 months ago

@toneewa Maltrail is not failing on that line. it is just a warning where afterwards it continues on.

it is 100% failing on the usage of pcapy. also, i hope that you haven't "compiled" pcapy, but pcapy-ng as stated at https://github.com/stamparm/maltrail?tab=readme-ov-file#requirements

notice that there is no mention of Windows OS there:

image

toneewa commented 7 months ago

I ran the command in the pcapy-ng-master directory: python setup.py install --user image

It finished compiling fine.

I also ran the pcapy-ng-master\tests\pcapytests.py image

toneewa commented 7 months ago

Maybe this will help?

`PS C:\users\jhagl\maltrail> python -m pdb sensor.py
> c:\users\jhagl\maltrail\sensor.py(3)<module>()
-> """
(Pdb)
(Pdb) c
Maltrail (←[92;1msensor←[0m) #v0.68 {←[34m←[4mhttps://maltrail.github.io←[0m}

[←[96m*←[0m] starting @ 12:41:48 /2024-04-29/

[←[94mi←[0m] using configuration file '←[37mC:\Users\jhagl\maltrail\maltrail.conf←[0m'
[←[91;1mx←[0m] multiprocessing is currently not supported on Windows OS
PS C:\users\jhagl\maltrail>
PS C:\users\jhagl\maltrail> python -m pdb sensor.py
> c:\users\jhagl\maltrail\sensor.py(3)<module>()
-> """
(Pdb) s
> c:\users\jhagl\maltrail\sensor.py(8)<module>()
-> from __future__ import print_function  # Requires: Python >= 2.6
(Pdb)
> c:\users\jhagl\maltrail\sensor.py(10)<module>()
-> import sys
(Pdb)
> c:\users\jhagl\maltrail\sensor.py(12)<module>()
-> sys.dont_write_bytecode = True
(Pdb)
> c:\users\jhagl\maltrail\sensor.py(14)<module>()
-> import cProfile
(Pdb)
--Call--
> <frozen importlib._bootstrap>(1022)_find_and_load()
(Pdb)
> <frozen importlib._bootstrap>(1024)_find_and_load()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(165)__init__()
(Pdb)
> <frozen importlib._bootstrap>(166)__init__()
(Pdb)
> <frozen importlib._bootstrap>(167)__init__()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(167)__init__()->None
(Pdb)
--Call--
> <frozen importlib._bootstrap>(169)__enter__()
(Pdb)
> <frozen importlib._bootstrap>(170)__enter__()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(179)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(185)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(186)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(187)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(188)_get_module_lock()
(Pdb)
KeyError: 'cProfile'
> <frozen importlib._bootstrap>(188)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(189)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(190)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(192)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(193)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(196)_get_module_lock()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(71)__init__()
(Pdb)
> <frozen importlib._bootstrap>(72)__init__()
(Pdb)
> <frozen importlib._bootstrap>(73)__init__()
(Pdb)
> <frozen importlib._bootstrap>(74)__init__()
(Pdb)
> <frozen importlib._bootstrap>(75)__init__()
(Pdb)
> <frozen importlib._bootstrap>(76)__init__()
(Pdb)
> <frozen importlib._bootstrap>(77)__init__()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(77)__init__()->None
(Pdb)
> <frozen importlib._bootstrap>(198)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(209)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(211)_get_module_lock()
(Pdb)
> <frozen importlib._bootstrap>(213)_get_module_lock()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(213)_get_module_lock()->_ModuleLock('... 2095322202368
(Pdb)
> <frozen importlib._bootstrap>(171)__enter__()
(Pdb)
--Call--
> <frozen importlib._bootstrap>(100)acquire()
(Pdb)
> <frozen importlib._bootstrap>(106)acquire()
(Pdb)
> <frozen importlib._bootstrap>(107)acquire()
(Pdb)
> <frozen importlib._bootstrap>(108)acquire()
(Pdb)
> <frozen importlib._bootstrap>(109)acquire()
(Pdb)
> <frozen importlib._bootstrap>(110)acquire()
(Pdb)
> <frozen importlib._bootstrap>(111)acquire()
(Pdb)
> <frozen importlib._bootstrap>(112)acquire()
(Pdb)
> <frozen importlib._bootstrap>(113)acquire()
(Pdb)
> <frozen importlib._bootstrap>(114)acquire()
(Pdb)
> <frozen importlib._bootstrap>(110)acquire()
(Pdb)
> <frozen importlib._bootstrap>(123)acquire()
(Pdb)
KeyError: 20408
> <frozen importlib._bootstrap>(123)acquire()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(123)acquire()->None
(Pdb)
KeyError: 20408
> <frozen importlib._bootstrap>(171)__enter__()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(171)__enter__()->None
(Pdb)
KeyError: 20408
> <frozen importlib._bootstrap>(1024)_find_and_load()
(Pdb)
--Return--
> <frozen importlib._bootstrap>(1024)_find_and_load()->None
(Pdb)
KeyError: 20408
> c:\users\jhagl\maltrail\sensor.py(14)<module>()
-> import cProfile
(Pdb)
--Return--
> c:\users\jhagl\maltrail\sensor.py(14)<module>()->None
-> import cProfile
(Pdb)
KeyError: 20408
> <string>(1)<module>()->None
(Pdb)
--Return--
> <string>(1)<module>()->None
(Pdb)
KeyError: 20408
> c:\program files\windowsapps\pythonsoftwarefoundation.python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\bdb.py(598)run()
-> exec(cmd, globals, locals)
(Pdb)
> c:\program files\windowsapps\pythonsoftwarefoundation.python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\bdb.py(599)run()
-> except BdbQuit:
(Pdb)
> c:\program files\windowsapps\pythonsoftwarefoundation.python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\bdb.py(602)run()
-> self.quitting = True
(Pdb)
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\pdb.py", line 1723, in main
    pdb._runscript(mainpyfile)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\pdb.py", line 1583, in _runscript
    self.run(statement)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\bdb.py", line 598, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "c:\users\jhagl\maltrail\sensor.py", line 14, in <module>
    import cProfile
  File "<frozen importlib._bootstrap>", line 1024, in _find_and_load
  File "<frozen importlib._bootstrap>", line 171, in __enter__
  File "<frozen importlib._bootstrap>", line 123, in acquire
KeyError: 20408
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> <frozen importlib._bootstrap>(123)acquire()->None
(Pdb)
Post mortem debugger finished.`
stamparm commented 7 months ago

not sure that import cProfile would do this kind of mess. you can try to comment it out in sensor.py (that same line with import cProfile) and rerun everything

toneewa commented 7 months ago

I already did try that with no luck.

Thanks for your time