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

Add brackets to IPv6 literals with standard ports in http module #329

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

gigaryte
Copy link
Contributor

@gigaryte gigaryte commented Oct 6, 2021

The HTTP module will currently fail when given IPv6 literals using standard ports (80/http and 443/https). This is because the function getHTTPURL() simply concatenates proto + "://" + host + endpoint. For non-standard ports (e.g. 8080/http), the function net.JoinHostPort() is used, which will add brackets to IPv6 literals.

How to Test

  1. Create a file with an IPv6 literal, e.g. 2001:558:6000:1234:5678:abcd:ef in input.txt.
  2. Run ./zgrab2 http -f ~/input.txt. Observe error "error":"parse \"http://2001:558:6000:1234:5678:abcd:ef/\": invalid port \":ef\" after host"
  3. Run ./zgrab2 http -f ~/input.txt -p 8080. Observe connection timeout.
  4. Apply patch. Observe connection timeout for 2.

@gigaryte gigaryte changed the title Add brackets to IPv6 literals with standard ports Add brackets to IPv6 literals with standard ports in http module Oct 6, 2021
@dadrian dadrian merged commit d753afc into zmap:master Feb 8, 2022
mzpqnxow pushed a commit to mzpqnxow/zgrab2 that referenced this pull request Apr 15, 2022
constantinsander pushed a commit to COMSYS/quic-zgrab2 that referenced this pull request Sep 11, 2023
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

Successfully merging this pull request may close these issues.

2 participants