Skip to content

Commit

Permalink
feat(dnsx): add IP output type on dnsx A record (#426)
Browse files Browse the repository at this point in the history
added DNS A record that produce an IP output type in addition of the A
record output type

---------

Co-authored-by: Olivier Cervello <ocervello@freelabz.com>
  • Loading branch information
romisfrag and ocervell authored Sep 14, 2024
1 parent e95e6c4 commit 629439e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions secator/tasks/dnsx.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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',
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 629439e

Please sign in to comment.