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

Incorrect regex causes failure - Record NSEC3 - write_db #27

Closed
FrankSpierings opened this issue Feb 13, 2015 · 6 comments
Closed

Incorrect regex causes failure - Record NSEC3 - write_db #27

FrankSpierings opened this issue Feb 13, 2015 · 6 comments

Comments

@FrankSpierings
Copy link

Line 782 of dnsrecon.py will process NSEC3 records, which results in a stacktrace as shown below:

Traceback (most recent call last):
File "dnsrecon.py", line 1666, in
main()
File "dnsrecon.py", line 1638, in main
write_db(results_db, returned_records)
File "dnsrecon.py", line 784, in write_db
'values( "%(type)s", "%(target)s", "%(address)s" )' % n
KeyError: 'target'

Suggestion for a fix (line 782):
elif re.match(r'NS$', n['type']):

@FrankSpierings FrankSpierings changed the title Incorrect regex causes failure - Record NSEC3 Incorrect regex causes failure - Record NSEC3 - write_db Feb 13, 2015
@darkoperator
Copy link
Owner

will get to ll the issues you opened tonight :) Thanks for reporting the issues.

@FrankSpierings
Copy link
Author

That would be great! I would love to be able to consistently use the tool during pentests. Saves me all the manual 'dig' labour ;)

@FrankSpierings
Copy link
Author

This is fixed when using sqlite as output. I'm also testing csv and xml output. This should be the fix for a similar problem in csv output.

@@ -715,7 +715,7 @@ def make_csv(data):
             if re.search(r'PTR|^[A]$|AAAA', n['type']):
                 csv_data += n['type'] + "," + n['name'] + "," + n['address'] + "\n"

-            elif re.search(r'NS', n['type']):
+            elif re.search(r'NS$', n['type']):
                 csv_data += n['type'] + "," + n['target'] + "," + n['address'] + "\n"

             elif re.search(r'SOA', n['type']):

@FrankSpierings
Copy link
Author

The issue for xml is different. I'll open another ticket.

@darkoperator
Copy link
Owner

Fix applied and tested.

On Feb 14, 2015, at 7:30 AM, FrankSpierings notifications@github.com wrote:

The issue for xml is different. I'll open another ticket.


Reply to this email directly or view it on GitHub #27 (comment).

@FrankSpierings
Copy link
Author

Confirmed, closing ticket.

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

2 participants