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

JSON output contains invalid escape sequences #43

Closed
honoki opened this issue Apr 3, 2019 · 1 comment
Closed

JSON output contains invalid escape sequences #43

honoki opened this issue Apr 3, 2019 · 1 comment

Comments

@honoki
Copy link

honoki commented Apr 3, 2019

When running massdns in bruteforce mode, the output in JSON will sometimes contain invalid escape sequences (e.g. when using the wordlist on https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056):

~/massdns/scripts/subbrute.py ~/wordlists/all.txt google.com | massdns -r ~/resolvers.txt -t A -o J | grep '\\'

Output:

{"query_name":"\x03\x00\x05\x08\x02\x00\x05\x0d.google.com.","query_type":"A","resp_name":"google.com.","resp_type":"SOA","data":"ns1.google.com. dns-admin.google.com. 241673399 900 900 1800 60"}

This is considered invalid JSON:

echo '{"query_name":"\x03\x00\x05\x08\x02\x00\x05\x0d.google.com.","query_type":"A","resp_name":"google.com.","resp_type":"SOA","data":"ns1.google.com. dns-admin.google.com. 241673399 900 900 1800 60"}' | jq '.'
parse error: Invalid escape at line 1, column 60

A solution could be to encoding as Unicode instead, i.e.

{"query_name":"\u0003\u0000\u0005\u0008\u0002\u0000\u0005\u000d.google.com.","query_type":"A","resp_name":"google.com.","resp_type":"SOA","data":"ns1.google.com. dns-admin.google.com. 241673399 900 900 1800 60"}

@blechschmidt
Copy link
Owner

This should have been fixed by 6b74007.

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