frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Building a password-based netcat that works without listening ports or known IPs

https://github.com/threatexpert/gonc
1•gonc•1h ago

Comments

gonc•1h ago
Hi HN,

I’ve been experimenting with a different take on netcat-style connectivity and wanted to share the design and trade-offs.

Traditional netcat-like tools assume one side listens on a reachable IP and port. This breaks down when both peers are behind NATs, firewalls, or dynamic networks. Often neither side knows the other’s IP or can expose an inbound port.

The goal is to enable an ad-hoc, netcat-like connection using only a shared secret, without requiring inbound connectivity.

Design goals:

A. Easy to use. No client/server role. Both peers run the same command, e.g. nc -p2p <passphrase>

B. Support nc -e style behavior for executing a program per connection

C. No listening port required

D. No prior knowledge of peer IP or domain

E. Works when both peers are behind NAT

F. Minimal setup and dependencies

G. Familiar stdin/stdout netcat-style usage

Core idea:

Both peers share a high-entropy passphrase. It is never transmitted, and is deterministically used to derive:

(1) A unique MQTT topic as a rendezvous channel (2) A TLS certificate and private key for mutual TLS identity verification

Connection flow:

(1) Each peer derives the MQTT topic and TLS identity from the shared passphrase

(2) Both peers independently establish outbound TCP connections to a public MQTT broker The broker cannot decrypt or interpret messages

(3) Each side performs local STUN probing to discover NAT-mapped addresses

(4) Candidate addresses are exchanged exclusively via the derived MQTT topic

(5) Peers first attempt direct TCP connections

(6) If TCP fails, peers automatically fall back to UDP hole punching As a last resort, a “birthday paradox” strategy is used: one side picks 600 random source ports, the other probes 600 random destination ports

(7) If direct P2P fails, an optional fallback uses an existing SOCKS5 UDP relay, without custom relay protocols

(8) Once a direct path is established, MQTT is no longer used; all traffic flows P2P over mutually authenticated TLS

At no point does either peer need to:

A. Listen on a fixed port

B. Expose or know the peer’s IP or domain

C. Trust the rendezvous infrastructure with plaintext identity or session data

The MQTT broker only observes opaque topic names and encrypted payloads. Without the passphrase, it cannot authenticate, impersonate, or correlate peers.

Security model:

The derived TLS certificate represents a deterministic peer identity, meaningful only to peers sharing the passphrase. Mutual TLS ensures peers cannot be impersonated even if candidate addresses are tampered with.

This is not intended to replace VPNs or general-purpose P2P frameworks. The goal is to explore how little coordination is needed to establish a direct, authenticated channel.

Usage example:

Think of this as a lightweight FRP-style alternative, without a public reverse-proxy or exposed ports.

To reach 10.0.0.1:22 inside a LAN, run on any host:

gonc -p2p <passphrase> -linkagent

Equivalent to:

gonc -p2p <passphrase> -e ":mux linkagent" -keep-open -mqtt-wait

Later, from home:

gonc -p2p <passphrase> -link 3080;3080

Both sides then get a local SOCKS5 proxy to access services on the peer LAN.

Implementation notes:

A. Written in Go

B. Single binary

C. Behaves like netcat (stdin/stdout piping)

D. MQTT is used only for rendezvous, never for data

I’m interested in feedback, especially around NAT edge cases, security assumptions, and alternative rendezvous mechanisms.

A Year of Conferences

https://www.sandordargo.com/blog/2025/12/17/conferences-2025
1•ibobev•32s ago•0 comments

Seattle Waterfront

https://tenderlovemaking.com/shots/2025-12-16-seattle-waterfront/
1•ibobev•1m ago•0 comments

Ask HN: What Are You Working On? (Mid – December 2025)

1•paulwilsonn•1m ago•0 comments

Sudoku-Bench: Evaluating Creative Reasoning With Sudoku Variants

https://arxiv.org/abs/2505.16135
1•optimalsolver•5m ago•0 comments

The Mozilla I want focus on people and not AI

https://andregarzia.com/2025/04/the-mozilla-i-want-focus-on-people-and-not-ai.html
3•soapdog•8m ago•0 comments

Ask HN: Why Does Ruby Get So Much Hate on HN?

1•karakoram•9m ago•0 comments

Decompiling the New C# 14 field Keyword

https://blog.ivankahl.com/decompiling-the-new-csharp-14-field-keyword/
1•ivankahl•9m ago•0 comments

My blind spots from a year of solo bootstrapping

https://alessandrofv.substack.com/p/bootstrappings-missing-warning-labels
1•A-F-V16•13m ago•0 comments

Show HN: HN++

https://hnplusplus.vercel.app
2•7moritz7•17m ago•1 comments

Stay safe online. Try PhisherSafe for free

https://short.phishersafe.com
1•maniargaurav•18m ago•1 comments

Open-source avatar model built upon LongCat-Video

https://meigen-ai.github.io/LongCat-Video-Avatar/
1•nkko•18m ago•0 comments

GigaPipe – Open-source drop-in Grafana LGTMP alternative

https://github.com/metrico/gigapipe
2•amai•21m ago•0 comments

Why Japan's internet looks weird – unless you live here

https://www.japantimes.co.jp/life/2025/12/15/style-design/japan-internet-web-design/
1•EwanG•21m ago•0 comments

AI romance blooms as Japanese woman weds virtual partner of her dreams

https://www.reuters.com/investigates/special-report/japan-ai-wedding/
1•EugeneOZ•22m ago•0 comments

Nvidia bulks up open source offerings with an acquisition and new open AI models

https://techcrunch.com/2025/12/15/nvidia-bulks-up-open-source-offerings-with-an-acquisition-and-n...
1•teleforce•24m ago•0 comments

Open Source AI Editor: Second Milestone

https://code.visualstudio.com/blogs/2025/11/04/openSourceAIEditorSecondMilestone
1•elashri•24m ago•0 comments

Show HN: MemVault – Async GraphRAG Memory for AI Agents (Postgres/Redis)

https://github.com/marketplace/actions/memvault-sync
1•northerndev•25m ago•1 comments

Secret Identities in Dwarf Fortress (2017)

https://ojs.aaai.org/index.php/AIIDE/article/view/12963
2•Tomte•26m ago•0 comments

Show HN: Signed lockfiles for MCP servers (MCPTrust)

https://github.com/mcptrust/mcptrust
1•Dtang19•26m ago•0 comments

Science is not the Enemy of the Humanities (2013)

https://newrepublic.com/article/114127/science-not-enemy-humanities
1•Tomte•26m ago•0 comments

Apple blocks dev from all accounts after he tries to redeem bad gift card

https://www.theregister.com/2025/12/15/apple_dev_bad_gift_card_code/
2•sipofwater•26m ago•1 comments

TikTok unlawfully tracks your shopping habits – and your use of dating apps

https://noyb.eu/en/tiktok-unlawfully-tracks-your-shopping-habits-and-your-use-dating-apps
3•latexr•29m ago•0 comments

Show HN: TubeDL – Open-source YouTube downloader CLI (playlists, Shorts, auth)

https://tubedl-landing.vercel.app/
1•ricky_trujillot•32m ago•0 comments

Reinforcement Learning Infrastructure for LLM Agents

https://github.com/NVIDIA-NeMo/Gym
2•bakigul•35m ago•0 comments

Short-Circuiting Correlated Subqueries in SQLite

https://emschwartz.me/short-circuiting-correlated-subqueries-in-sqlite/
2•emschwartz•36m ago•0 comments

AI is creating more jobs so far

https://www.axios.com/2025/12/17/ai-jobs-market-wages
1•FergusArgyll•37m ago•0 comments

Strategies for getting feedback on your documentation

https://blog.techdocs.studio/p/strategies-for-improving-technical
1•dgarcia360•37m ago•0 comments

When you ship fast you might ship bugs in production, how I deal with that

https://www.bugmail.site
1•bumpymark•38m ago•3 comments

Show HN: HandsUp – Super Simple Volunteering

https://handsup.barryvan.com.au/
1•barryvan•40m ago•0 comments

Bayesian Data Analysis for Babies (By Claude Opus and Nano Banana)

https://github.com/juhoojala/baeysian-data-analysis-for-babies
1•ojalajuho•41m ago•1 comments