Bug 256968 - security/nmap: Fix broken ncat --proxy command
Summary: security/nmap: Fix broken ncat --proxy command
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-04 09:23 UTC by Ting-Wei Lan
Modified: 2021-07-10 09:45 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
Fix broken ncat --proxy with upstream patch (1.65 KB, patch)
2021-07-04 09:23 UTC, Ting-Wei Lan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2021-07-04 09:23:04 UTC
Created attachment 226208 [details]
Fix broken ncat --proxy with upstream patch

After updating to nmap 7.91, ncat no longer works with proxy. It can connect to the remote server via the proxy, but it exits immediately after being connected and cannot send anything to the remote server.

https://github.com/nmap/nmap/issues/2149

We can fix the issue by applying this upstream patch.

https://github.com/nmap/nmap/commit/169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2021-07-05 14:06:10 UTC
Have you applied this patch yourself?
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2021-07-05 14:08:39 UTC
slippy$ patch -C -p1 < /tmp/foo
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c
|index f59dd4372..606eac412 100644
|--- a/ncat/ncat_connect.c
|+++ b/ncat/ncat_connect.c
--------------------------
Patching file ncat/ncat_connect.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R? [y] 

It's already applied to 7.91.
Comment 3 Ting-Wei Lan 2021-07-06 17:16:09 UTC
(In reply to Cy Schubert from comment #1)
Yes, I applied the patch with attachment 226208 [details] and it really fixed the problem. I use ncat to connect to SSH servers over a proxy.
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2021-07-06 18:14:45 UTC
A git clone / git diff appears to provide me with a good working patch. Not sure why downloading the attachment caused this.
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-07-06 18:19:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f12ae4971c1a2a049579eba10a3139da49775441

commit f12ae4971c1a2a049579eba10a3139da49775441
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-07-06 18:15:56 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-07-06 18:19:04 +0000

    security/nmap: Fix broken --proxy

    Upstream broke --proxy in 7.90 and was fixed after 7.91 and is yet to be
    released.

    PR:             256968
    Submitted by:   Ting-Wei Lan <lantw44@gmail.com>
    Reported by:    Ting-Wei Lan <lantw44@gmail.com>
    Obtained from:  Upstream 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689
    MFH:            2020Q3

 security/nmap/Makefile                             |  2 +-
 .../nmap/files/patch-ncat_ncat__connect.c (new)    | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-07-06 18:57:54 UTC
A commit in branch 2021Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6adfb16a49e0dce3f3279189bb36cdb643c7c027

commit 6adfb16a49e0dce3f3279189bb36cdb643c7c027
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-07-06 18:15:56 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-07-06 18:57:00 +0000

    security/nmap: Fix broken --proxy

    Upstream broke --proxy in 7.90 and was fixed after 7.91 and is yet to be
    released.

    PR:             256968
    Submitted by:   Ting-Wei Lan <lantw44@gmail.com>
    Reported by:    Ting-Wei Lan <lantw44@gmail.com>
    Obtained from:  Upstream 169d7e5a922ef8e63b51ee2bdf4fd4ad60ed2689

    (cherry picked from commit f12ae4971c1a2a049579eba10a3139da49775441)

 security/nmap/Makefile                             |  2 +-
 .../nmap/files/patch-ncat_ncat__connect.c (new)    | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)