Skip to content

[bug] Cannot import name 'get_computers_from_domain' from 'sectools.windows.ldap' #51

@itm4n

Description

@itm4n

Hey!

Somehow, it appears an issue similar to #13 was reintroduced with sectools 1.5.0.

ApacheTomcatScanner has the requirement sectools>=1.3.9, which currently resolves to sectools 1.5.0. This causes the import error shown below.

$ python3 ApacheTomcatScanner.py        
Traceback (most recent call last):
  File "/home/itm4n/Downloads/ApacheTomcatScanner/ApacheTomcatScanner.py", line 8, in <module>
    from apachetomcatscanner.__main__ import main
  File "/home/itm4n/Downloads/ApacheTomcatScanner/apachetomcatscanner/__main__.py", line 16, in <module>
    from sectools.windows.ldap import (get_computers_from_domain,
                                       get_servers_from_domain, get_subnets)
ImportError: cannot import name 'get_computers_from_domain' from 'sectools.windows.ldap' (unknown location)

If I manually install the versions from 1.3.9 to 1.4.4, there is no issue though. I get a different import error with version 1.3.8 but that's irrelevant.

$ python3 -m pip install sectools==1.4.4
Collecting sectools==1.4.4
  Downloading sectools-1.4.4-py3-none-any.whl.metadata (455 bytes)
Requirement already satisfied: ldap3 in ./lib/python3.13/site-packages (from sectools==1.4.4) (2.9.1)
Requirement already satisfied: pyasn1>=0.4.6 in ./lib/python3.13/site-packages (from ldap3->sectools==1.4.4) (0.6.1)
Downloading sectools-1.4.4-py3-none-any.whl (23 kB)
Installing collected packages: sectools
  Attempting uninstall: sectools
    Found existing installation: sectools 1.4.3
    Uninstalling sectools-1.4.3:
      Successfully uninstalled sectools-1.4.3
Successfully installed sectools-1.4.4

$ python3 ApacheTomcatScanner.py        
Apache Tomcat Scanner v3.7 - by Remi GASCOU (Podalirius)

usage: ApacheTomcatScanner.py [-h] [-v] [--debug] [-C] [--show-cves-descriptions] [-T THREADS] [-s] [--no-colors] [--only-http] [--only-https] [--export-xlsx EXPORT_XLSX] [--export-json EXPORT_JSON] [--export-sqlite EXPORT_SQLITE]
                              [-PI PROXY_IP] [-PP PROXY_PORT] [-rt REQUEST_TIMEOUT] [-H REQUEST_HTTP_HEADER] [--tomcat-username TOMCAT_USERNAME] [--tomcat-usernames-file TOMCAT_USERNAMES_FILE] [--tomcat-password TOMCAT_PASSWORD]
                              [--tomcat-passwords-file TOMCAT_PASSWORDS_FILE] [-tf TARGETS_FILE] [-tt TARGET] [-tu TARGET_URL] [-tU TARGETS_URLS_FILE] [-tp TARGET_PORTS] [-ad AUTH_DOMAIN] [-ai AUTH_DC_IP] [-au AUTH_USER]
                              [-ap AUTH_PASSWORD] [-ah AUTH_HASHES] [--ldaps] [--subnets]

A python script to scan for Apache Tomcat server vulnerabilities.

[snip]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions