punk-security / dnsReaper

dnsReaper - subdomain takeover tool for attackers, bug bounty hunters and the blue team!
GNU Affero General Public License v3.0
1.99k stars 166 forks source link

module error even after installing #194

Open GDATTACKER-RESEARCHER opened 1 week ago

GDATTACKER-RESEARCHER commented 1 week ago

python main.py --help Traceback (most recent call last): File "/home/gdattacker/Desktop/tools/recon/dnsReaper/main.py", line 5, in import providers File "/home/gdattacker/Desktop/tools/recon/dnsReaper/providers/init.py", line 9, in from . import * File "/home/gdattacker/Desktop/tools/recon/dnsReaper/providers/azure.py", line 1, in from azure.mgmt.dns import DnsManagementClient ModuleNotFoundError: No module named 'azure.mgmt'

Nishantbhagat57 commented 1 week ago

Ping @imnotbrandon @SimonGurney

Error 1:

Traceback (most recent call last):
  File "/home/op/recon/dnsReaper/main.py", line 5, in <module>
    import providers
  File "/home/op/recon/dnsReaper/providers/__init__.py", line 9, in <module>
    from . import *
  File "/home/op/recon/dnsReaper/providers/cloudflare.py", line 1, in <module>
    import CloudFlare, logging
ModuleNotFoundError: No module named 'CloudFlare'

Error 2:

unhandled exception during asyncio.run() shutdown
task: <Task finished name='Task-24' coro=<scan_domain() done, defined at /home/op/recon/dnsReaper/scan.py:6> exception=ValueError('I/O operation on closed file.')>
Traceback (most recent call last):
  File "/home/op/recon/dnsReaper/domain.py", line 151, in is_registered
    await asyncwhois.aio_whois(self.domain)
AttributeError: module 'asyncwhois' has no attribute 'aio_whois'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/op/recon/dnsReaper/main.py", line 115, in main
    await asyncio.gather(*[asyncio.create_task(scan(domain)) for domain in domains])
  File "/home/op/recon/dnsReaper/scan.py", line 19, in scan_domain
    if await signature.test.check(domain=domain):
  File "/home/op/recon/dnsReaper/signatures/_generic_cname_found_but_unregistered.py", line 17, in check
    return await checks.CNAME.is_unregistered(domain)
  File "/home/op/recon/dnsReaper/signatures/checks/CNAME.py", line 26, in is_unregistered
    if not await cname.is_registered:
  File "/home/op/recon/dnsReaper/domain.py", line 153, in is_registered
    except asyncwhois.NotFoundError:
AttributeError: module 'asyncwhois' has no attribute 'NotFoundError'

I have all of the modules installed:

pip3 install aiohttp
pip3 install dnspython
pip3 install requests
pip3 install asyncwhois
pip3 install boto3
pip3 install cloudflare
pip3 install colorama
pip3 install azure-mgmt-dns
pip3 install azure-identity
pip3 install msrestazure
pip3 install google-cloud-dns
pip3 install aiohttp
SimonGurney commented 1 week ago

Thanks both, looking into this now

SimonGurney commented 1 week ago

@Nishantbhagat57 we dont test on python 3.8 anymore. I've just tried to install the dependencies on 3.8 and it fails because the version of asyncwhois we use is not compatible with 3.8.

ERROR: Ignored the following versions that require a different python version: 1.1.0 Requires-Python >=3.9; 1.1.1 Requires-Python >=3.9; 1.1.2 Requires-Python >=3.9; 1.1.3 Requires-Python >=3.9; 1.1.4 Requires-Python >=3.9; 1.1.5 Requires-Python >=3.9; 2.7.0rc1 Requires-Python >=3.9 ERROR: Could not find a version that satisfies the requirement asyncwhois==1.1.4 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.7, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.10) ERROR: No matching distribution found for asyncwhois==1.1.4

Can you try upgrading to python 3.9 or switching to the docker image?

SimonGurney commented 1 week ago

@GDATTACKER-RESEARCHER I think you just need the packages installing. As long as you are on python3.9 or above, try running python -m pip install -r requirements.txt, or give the docker version a try docker run punksecurity\dnsreaper