module http/https, inccorrect 'Host' HTTP header when using IPv6 (-6)

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c
Domain
networking

Research direction

Start by tracing how the http/https module builds the Host header when IPv6 is enabled, then compare it with the IPv4 request shown in the issue. The issue provides no file or test names, so locate the request construction code and check for existing coverage. Done means IPv6 requests use the server name in Host, preserving virtual host behavior.

Written by the indexing model from the issue text.

Description

Hello,

When enabling IPv6 cracking with the http/https module, the 'Host' HTTP header sent is 'Host: a:b.c:d' instead of 'Host: servername' as it is with IPv4:

ncrack slt01.hqr.fi:80 -m http,path=/ --user test --pass test

results in the following first request:

GET / HTTP/1.1
Host: slt01.hqr.fi

and with IPv6:
ncrack -6 slt01.hqr.fi:80 -m http,path=/ --user test --pass test

results in the following first request

GET / HTTP/1.1
Host: 2001:bc8:3d1d:1ab0::bee

Obviously this prevents ncrack from working correctly on Virtual Hosts! :-(

Is it something easily fixable?

Thanks in advance!

Dominant language
C
Stars
1.2k
Forks
275
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nmap/ncrack

All issues in nmap/ncrack

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.