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

Fixed DNS resolving A records when -ports is set #1347

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

kz0ltan
Copy link
Contributor

@kz0ltan kz0ltan commented Sep 7, 2023

DNS A records were not showing up in the JSON output if -ports was used or the port was added to the target domain name via -u or -l in <domain_name>: format.
The original code tried to use getDNSData with the URL.Host property which in the above cases included the port specification as well, so the DNS query failed, and no A records were added to the output.

This small change fixes that problem.

Before:

echo scanme.sh:443 | httpx -json | jq .a
# echo scanme.sh| httpx -ports 443 -json | jq .a

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

		projectdiscovery.io

[INF] Current httpx version v1.3.4 (latest)
null

After:

echo scanme.sh:443 | ./httpx -ip -json | jq .a

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

		projectdiscovery.io

[INF] Current httpx version v1.3.4 (latest)
[
  "128.199.158.128",
  "2400:6180:0:d0::91:1001"
]

@ehsandeep ehsandeep changed the base branch from main to dev September 7, 2023 15:37
@ehsandeep ehsandeep linked an issue Sep 7, 2023 that may be closed by this pull request
@ehsandeep ehsandeep added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 7, 2023
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kz0ltan thank you for fixing this issue!

@ehsandeep ehsandeep requested review from Mzack9999 and removed request for tarunKoyalwar September 11, 2023 22:22
@ehsandeep ehsandeep added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Sep 12, 2023
@ehsandeep ehsandeep removed the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty A records when port is used in as input or as ports option
3 participants