ncat: Support domain name response from socks5 proxy - #2365
Closed
pomu0325 wants to merge 3 commits into
Closed
Conversation
pomu0325
commented
Sep 10, 2021
Comment on lines
+920
to
+925
| if (socket_buffer_readcount(&stateful_buf, socksbuf, 1) < 0) { | ||
| loguser("Error: number of octets of domain name missing.\n"); | ||
| close(sd); | ||
| return -1; | ||
| } | ||
| bndaddrlen = (unsigned char) socksbuf[0] + 2; |
Author
There was a problem hiding this comment.
As in RFC1928,
the address field contains a fully-qualified domain name. The first
octet of the address field contains the number of octets of name that
follow, there is no terminating NUL octet.
|
I definitely want to review this enhancement but I am out of pocket for the next few weeks. Stay tuned. |
nnposter
approved these changes
Oct 10, 2021
nnposter
left a comment
There was a problem hiding this comment.
The code looks good. It has been committed as r38294.
Thank you for contributing to Nmap!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some socks5 proxy server returns

3: Domain Nameas anAddress Typevalue.Here is an example of response packet:
But current ncat implementation does not support this type and ends up with
"Error: invalid proxy bind address type":nmap/ncat/ncat_connect.c
Lines 915 to 923 in b0bd277
This kind of response is described in RFC1928, so should be supported.