Skip to content

dnscommon.r2py cannot parse replies containing NS, PTR types of queries #167

@pranavnyu

Description

@pranavnyu
  • dnscommon.r2py replies with KeyError when query is of type NS
    for e.g. present code returns this:
User traceback:
  "dylink.r2py", line 546, in <module>
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "librepy.r2py", line 153, in <module>
  "dylink.r2py", line 446, in _dylink_dispatch
  "dylink.r2py", line 407, in dylink_dispatch
  "dylink.r2py", line 520, in evaluate
  "ut_dnsquery_namingserver.r2py", line 11, in <module>
  "ut_dnsquery_namingserver.r2py", line 8, in test_namingServer
  "dnsquery.r2py", line 222, in namingServer
  "dnsquery.r2py", line 140, in dns_connection
  "dnscommon.r2py", line 406, in convert_packet_to_dictionary
  "dnscommon.r2py", line 459, in _read_answer_section
  "dnscommon.r2py", line 504, in _read_single_answer

Exception (with type 'exceptions.KeyError'): 49164
Testing module: dnsquery
    Running: ut_dnsquery_reverselookup.r2py                     [ FAIL ]
--------------------------------------------------------------------------------
Standard out :
..............................Produced..............................
('173.252.120.6', {'address': '21.101.100.103'})

rather output should be domain name for the respective IP address

We need to create a patch for the same in https://github.com/SeattleTestbed/seattlelib_v2/blob/master/dnscommon.r2py#L464 in _read_single_answer function.
-> https://github.com/SeattleTestbed/seattlelib_v2/blob/master/dnscommon.r2py#L522 should be edited and code should be added for different types like already done for type 'SOA'.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions