Pepelux / sippts

Set of tools to audit SIP based VoIP Systems
GNU General Public License v3.0
414 stars 81 forks source link

ModuleNotFoundError: No module named '__main__.lib'; '__main__' is not a package #39

Closed richilp closed 5 months ago

richilp commented 5 months ago

Hello Pepelux,

We've just installed sippts in Almalinux 8. When we try to test it, we get this error:

[root@sippts sippts]# /usr/src/sippts/src/sippts/src/sippts/sipscan.py -h
Traceback (most recent call last):
  File "/usr/src/sippts/src/sippts/src/sippts/sipscan.py", line 18, in <module>
    from .lib.functions import create_message, parse_message, get_machine_default_ip, ip2long, long2ip, get_free_port, ping, fingerprinting, format_time
ModuleNotFoundError: No module named '__main__.lib'; '__main__' is not a package

Can you help us with that?

Thanks Ricardo

Pepelux commented 5 months ago

$ cd sippts $ pip3 install . ; all sip scripts will be in the PATH $ sipscan -h

richilp commented 5 months ago

We're missing smth, not sure what:

[root@sippts src]# git clone https://github.com/Pepelux/sippts.git
Cloning into 'sippts'...
remote: Enumerating objects: 2676, done.
remote: Counting objects: 100% (254/254), done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 2676 (delta 176), reused 212 (delta 162), pack-reused 2422
Receiving objects: 100% (2676/2676), 855.78 KiB | 10.70 MiB/s, done.
Resolving deltas: 100% (1910/1910), done.
[root@sippts src]# cd sippts
[root@sippts sippts]# pip3 install .
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Processing /usr/src/sippts
  Requirement already satisfied (use --upgrade to upgrade): UNKNOWN==0.0.0 from file:///usr/src/sippts in /usr/local/lib/python3.6/site-packages
[root@sippts sippts]# sipenumerate -h
bash: sipenumerate: command not found

What do you think?

Thanks ;) Ricardo

Pepelux commented 5 months ago

Try to find it to check if it is not in the $PATH ... $ find / -name sipenumerate

Other options:

richilp commented 5 months ago

Thanks for your help, please find bellow the the result:

[root@sippts sippts]# find / -name sipenumerate
/usr/local/bin/sipenumerate
/usr/src/sippts/bin/sipenumerate
[root@sippts sippts]# /usr/local/bin/sipenumerate -h
Traceback (most recent call last):
  File "/usr/local/bin/sipenumerate", line 10, in <module>
    from sippts.sipenumerate import SipEnumerate
ModuleNotFoundError: No module named 'sippts'
[root@sippts sippts]# /usr/src/sippts/bin/sipenumerate -h
Traceback (most recent call last):
  File "/usr/src/sippts/bin/sipenumerate", line 10, in <module>
    from sippts.sipenumerate import SipEnumerate
ModuleNotFoundError: No module named 'sippts'
Pepelux commented 5 months ago

I've never used Almalinux, sorry. SIPPTS has been tested on MAC and Debian and Kali Linux versions. It seems to be a problem with paths or python. Maybe you must try with a higher version of python ... and try with a non root user!

For example, in my case:

binaries are in: /usr/bin/ example: /usr/bin/sipenumerate

modules are in: /lib/python3.12/site-packages/sippts/ example: /lib/python3.12/site-packages/sippts/sipenumerate.py

When you start /usr/bin/sipenumerate it try to load modules from /lib/python3.12/site-packages/sippts/

Try to obtain your python version (python3 --version) and find in the /lib/python3.X/site-packages/sippts/ ... or do a $ find / -name sippts to look for the modules

richilp commented 5 months ago

Gracias Pepelux,

we'll use Debian to make things easier.

Many thanks for your support ;)

Pepelux commented 5 months ago

Great!

Buena elección! ;)