aiosubdomainscan.py 739 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. @Author: hywell
  5. @Email: hywell.28@gmail.com
  6. @Blog: iassas.com
  7. @Date: 2019/10/19 15:58
  8. """
  9. import aiodns
  10. from lib.core.setting import CONF
  11. async def subDomainBrute(current_target):
  12. ips = []
  13. resolver = aiodns.DNSResolver(nameservers=CONF.dns_servers)
  14. try:
  15. answers = await resolver.query(current_target, "A")
  16. for answer in answers:
  17. address = answer.host
  18. if address in ['1.1.1.1', '127.0.0.1', '0.0.0.0', '0.0.0.1']:
  19. return [0, current_target, None]
  20. else:
  21. ips.append(address)
  22. return [1, current_target, ips]
  23. except aiodns.error.DNSError:
  24. return [0, current_target, None]