From 629439e459a6eefd5cbe68e9fc3a317371ba7987 Mon Sep 17 00:00:00 2001 From: romisfrag Date: Sat, 14 Sep 2024 10:41:57 +0200 Subject: [PATCH] feat(`dnsx`): add IP output type on dnsx A record (#426) added DNS A record that produce an IP output type in addition of the A record output type --------- Co-authored-by: Olivier Cervello --- secator/tasks/dnsx.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/secator/tasks/dnsx.py b/secator/tasks/dnsx.py index 3bf3f3e6..4d6a6f13 100644 --- a/secator/tasks/dnsx.py +++ b/secator/tasks/dnsx.py @@ -1,6 +1,6 @@ from secator.decorators import task from secator.definitions import (OPT_PIPE_INPUT, RATE_LIMIT, RETRIES, THREADS) -from secator.output_types import Record +from secator.output_types import Record, Ip from secator.tasks._categories import ReconDns import json @@ -12,7 +12,7 @@ class dnsx(ReconDns): json_flag = '-json' input_flag = OPT_PIPE_INPUT file_flag = OPT_PIPE_INPUT - output_types = [Record] + output_types = [Record, Ip] opt_key_map = { RATE_LIMIT: 'rate-limit', RETRIES: 'retry', @@ -47,6 +47,11 @@ def item_loader(self, line): if isinstance(value, dict): name = value['name'] extra_data = {k: v for k, v in value.items() if k != 'name'} + if _type == 'a': + yield { + 'host': host, + 'ip': name + } yield { 'host': host, 'name': name,