Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Resolver' object has no attribute 'resolve' #190

Closed
Rozendantz opened this issue May 17, 2021 · 11 comments
Closed

AttributeError: 'Resolver' object has no attribute 'resolve' #190

Rozendantz opened this issue May 17, 2021 · 11 comments

Comments

@Rozendantz
Copy link

Feature Request or Bug or Other
Bug

Describe the feature request or bug or other

dnsrecon -d www.facebook.com
[*] std: Performing General Enumeration against: www.facebook.com...
Traceback (most recent call last):
File "/usr/share/dnsrecon/dnsrecon.py", line 1763, in
main()
File "/usr/share/dnsrecon/dnsrecon.py", line 1650, in main
std_enum_records = general_enum(res, domain, xfr, bing, yandex,
File "/usr/share/dnsrecon/dnsrecon.py", line 925, in general_enum
check_wildcard(res, domain)
File "/usr/share/dnsrecon/dnsrecon.py", line 189, in check_wildcard
ips = res.get_a(testname)
File "/usr/share/dnsrecon/lib/dnshelper.py", line 118, in get_a
answers = self.get_answers('A', host_trg)
File "/usr/share/dnsrecon/lib/dnshelper.py", line 82, in get_answers
return self.res.resolve(addr, type_, tcp=self._is_tcp)
AttributeError: 'Resolver' object has no attribute 'resolve'

To Reproduce
Steps to reproduce the behaviour:

  1. Run tool like this: install tool on Arch Linux from Blackarch repo (have no been able to test with other Linux)
  2. run with any domain: dnsrecon -d
  3. See error

Expected behaviour
Expected it to work

System Information (System that tool is running on):

  • OS: Arch Linux
  • 5.10.33-1-lts

Additional context
Python is 3.9.5
I thought this may be an issue with extended ping (some of my VPN endpoints get up to ~100ms range), so I switched to a closer VPN gateway (8ms) and still the problem persists. Also tried playing with --lifetime flag but nothing changed. Then I did a full system upgrade just to be sure, still nothing.

@someotherkyle
Copy link

I am experiencing the same issue. I don't have any ideas for fixing but wanted to comment to confirm that it is reproducible on my machine.

@L1ghtn1ng
Copy link
Collaborator

L1ghtn1ng commented Jun 2, 2021 via email

@someotherkyle
Copy link

someotherkyle commented Jun 3, 2021

pacman -Si dnsrecon

Repository      : blackarch
Name            : dnsrecon
Version         : 2:0.10.1-1
Description     : Python script for enumeration of hosts, subdomains and emails from a given domain using google.
Architecture    : any
URL             : https://github.com/darkoperator/dnsrecon
Licenses        : custom
Groups          : blackarch  blackarch-recon
Provides        : None
Depends On      : python  python-netaddr  python-dnspython  python-lxml
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 499.16 KiB
Installed Size  : 1512.28 KiB
Packager        : Levon Kayan <noptrix@nullsecurity.net>
Build Date      : Sat Apr 10 16:37:26 2021
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Appears to match the release on 4/5 0.10.1

Also dnsrecon -V returns DNSRecon version 0.10.1 ( http://www.darkoperator.com )

@someotherkyle
Copy link

Strangely enough, version 0.10.0 packaged with kali works fine on my vm -- will try rolling back to 0.10.0 on blackarch to see if the issue persists

@someotherkyle
Copy link

Confirmed that this issue is present in 0.10.1 and is not present in 0.10.0 on blackarch.

@the-src
Copy link

the-src commented Jun 9, 2021

Trying with ArcoLinux, same problem.
dnsrecon -d google.com

Traceback (most recent call last):
  File "/usr/bin/dnsrecon", line 4, in <module>
    __import__('pkg_resources').run_script('dnsrecon==1.0.0', 'dnsrecon')
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 651, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1455, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/EGG-INFO/scripts/dnsrecon", line 1763, in <module>
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/EGG-INFO/scripts/dnsrecon", line 1650, in main
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/EGG-INFO/scripts/dnsrecon", line 925, in general_enum
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/EGG-INFO/scripts/dnsrecon", line 189, in check_wildcard
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/lib/dnshelper.py", line 118, in get_a
  File "/usr/lib/python3.9/site-packages/dnsrecon-1.0.0-py3.9.egg/lib/dnshelper.py", line 82, in get_answers
AttributeError: 'Resolver' object has no attribute 'resolve'

I also tried version 0.10.0, still same issue.

DNSRecon version 0.10.1 ( http://www.darkoperator.com )

@honuonhval
Copy link

honuonhval commented Jun 30, 2021

python-dnspython version (community, 1.16.0-3 as of today June 30th, 2021) in Arch Linux (and most likely BlackArch and ArcoLinux) uses deprecated dns.resolver.Resolver.query. Once you install python-dnspython-git from AUR and it should work.

edit community version has been flagged out of date since Nov 2020 but hasn't been updated, so quick workaround is through AUR

@L1ghtn1ng
Copy link
Collaborator

L1ghtn1ng commented Jun 30, 2021 via email

@L1ghtn1ng
Copy link
Collaborator

Thanks for that, had not managed to dig into it yet but yes that is the cause for this issue.

@L1ghtn1ng
Copy link
Collaborator

You can also install it here https://github.com/rthalley/dnspython but recommend using a virtualenv but using AUR to install the new dnspython version would be easier

@shaworee
Copy link

shaworee commented Oct 15, 2022

Thank you all for your comments. I'm a mere network administrator, so it would take me a little while to get these things up and running.
For all non-pythoners, here are steps that has worked for me:

  1. Check your dnspython version with command pip show dnspython
  2. If your version is different with github version (at the time version is listed here https://github.com/rthalley/dnspython#readme)
  3. If version is not the same. You can uninstall old package and install new one with these commands:
    pip uninstall dnspython
    pip install git+https://github.com/rthalley/dnspython
  4. now package dnsrecon works without previous error (AttributeError: 'Resolver' object has no attribute 'resolve')

Hope this helps someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants