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

Problem whith this error: The DNS query name does not exist #14

Closed
kazemsamiei opened this issue Jun 14, 2023 · 5 comments
Closed

Problem whith this error: The DNS query name does not exist #14

kazemsamiei opened this issue Jun 14, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@kazemsamiei
Copy link

Hi
When I run program:
python gpt_vuln.py --target IP --attack dns

I get this error:
\AppData\Local\Programs\Python\Python311\Lib\site-packages\dns\resolver.py", line 691, in next_request
raise NXDOMAIN(qnames=self.qnames_to_try, responses=self.nxdomain_responses)
dns.resolver.NXDOMAIN: The DNS query name does not exist: IPAddress

@morpheuslord
Copy link
Owner

morpheuslord commented Jun 14, 2023

this is an internal error maybe because of some other issue maybe the records were not detected or there was something completely different

@morpheuslord
Copy link
Owner

it worked while i tested 🤷‍♂️

@kazemsamiei
Copy link
Author

image

@morpheuslord
Copy link
Owner

will update this error

@morpheuslord morpheuslord added the bug Something isn't working label Jun 20, 2023
@morpheuslord
Copy link
Owner

update the d.py or domain.py which is located under the commands/ folder to this code:

import openai
import dns.resolver
from typing import Any
from rich.progress import track

openai.api_key = ""
model_engine = "text-davinci-003"


def dnsr(target: str) -> Any:
    analyze = ''
    # The DNS Records to be enumerated
    record_types = ['A', 'AAAA', 'NS', 'CNAME', 'MX', 'PTR', 'SOA', 'TXT']
    for records in track(record_types):
        try:
            answer = dns.resolver.resolve(target, records)
            for server in answer:
                st = server.to_text()
                analyze += "\n"
                analyze += records
                analyze += " : "
                analyze += st
        except dns.resolver.NoAnswer:
            print('No record Found')
            pass
        except dns.resolver.NXDOMAIN:
            print('NXDOMAIN record NOT Found')
            pass

        except KeyboardInterrupt:
            print("Bye")
            quit()
    try:
        prompt = "do a DNS analysis of {} and return proper clues for an attack in json".format(
            analyze)
        # A structure for the request
        completion = openai.Completion.create(
            engine=model_engine,
            prompt=prompt,
            max_tokens=1024,
            n=1,
            stop=None,
        )
        response = completion.choices[0].text
    except KeyboardInterrupt:
        print("Bye")
        quit()
    return response

morpheuslord added a commit that referenced this issue Jun 20, 2023
morpheuslord added a commit that referenced this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants