🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #331226

Re: It's become mail2dizum

#331226
From: Soul Patch
Date: Sat, 13 Sep 2025 23:49
219 lines
8476 bytes
On Sat, 13 Sep 2025 10:48:15 +0100
"Billy G." <contact-5c2e-000@pugleaf.net> wrote:

> On 13.09.25 03:20, Soul Patch wrote:
> > Torsocks is insecure and can leak data. It only uses ENV variables which can be disregarded by bad software and scripts, especially anything that is statically compiled.
> > 
> 
> is INN(feed) statically compiled? I'd think: no.
> review calls in INN codebase and see what's in use...
> or jump to mid of the message here and try the idea.
> 
> >> explain the magic how tsocks or proxychains work .
> 
> Excellent question! Yes, tsocks and proxychains do work somewhat
> "magically" by intercepting network calls at the system level.
> 
> Here's how they accomplish this:
> 
> ## **The Magic: LD_PRELOAD and Function Interception**
> 
> Both tools use a technique called **library preloading** via the
> `LD_PRELOAD` environment variable:
> 
> ```bash
> # What proxychains actually does internally:
> LD_PRELOAD=./libproxychains.so.3 innfeed
> 
> # What tsocks does:
> LD_PRELOAD=/usr/lib/libtsocks.so innfeed
> ```
> 
> ## **How Function Interception Works**
> 
> 1. **Normal application flow:**
> ```c
> // Application calls standard socket functions
> int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
> connect(socket_fd, &server_addr, sizeof(server_addr));  // Direct connection
> ```
> 
> 2. **With proxychains/tsocks:**
> ```c
> // The preloaded library intercepts the connect() call
> int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
>     // This is now the proxychains/tsocks version, not the system one!
> 
>     // Extract destination from original connect() call
>     char *dest_ip = inet_ntoa(((struct sockaddr_in*)addr)->sin_addr);
>     int dest_port = ntohs(((struct sockaddr_in*)addr)->sin_port);
> 
>     // Instead of connecting directly, connect to SOCKS proxy
>     struct sockaddr_in proxy_addr;
>     proxy_addr.sin_addr.s_addr = inet_addr("127.0.0.1");  // Proxy IP
>     proxy_addr.sin_port = htons(9050);                     // Proxy port
> 
>     // Connect to proxy instead
>     int result = real_connect(sockfd, (struct sockaddr*)&proxy_addr,
> sizeof(proxy_addr));
> 
>     // Send SOCKS handshake to proxy with real destination
>     socks5_handshake(sockfd, dest_ip, dest_port);
> 
>     return result;  // App thinks it connected directly!
> }
> ```
> 
> ## **Step-by-step Process**
> 
> 1. **Library Loading**: When you run `proxychains innfeed`, the system
> loads the proxychains library before any other libraries
> 2. **Symbol Interception**: The library provides its own versions of
> network functions like `connect()`, `bind()`, `gethostbyname()`
> 3. **Transparent Redirection**: When innfeed calls
> `connect("news.server.com", 119)`, it actually gets the proxychains version
> 4. **SOCKS Protocol**: The intercepted function connects to the SOCKS
> proxy and tells it to connect to the real destination
> 5. **Data Tunneling**: All subsequent data flows through the proxy tunnel
> 
> ## **What Gets Intercepted**
> 
> ```c
> // Common functions that get replaced:
> connect()      // TCP connections
> bind()         // Sometimes for local binding
> gethostbyname() // DNS lookups (can be redirected too)
> getaddrinfo()  // Modern DNS lookups
> send()/recv()  // Sometimes for additional processing
> ```
> 
> ## **Why It Works**
> 
> - **Dynamic Linking**: Most applications use dynamic linking, so
> function calls go through the dynamic linker
> - **LD_PRELOAD Priority**: Libraries in LD_PRELOAD are checked first for
> symbols
> - **Same Function Signatures**: The replacement functions have identical
> signatures to the originals
> - **Application Ignorance**: The application never knows its calls are
> being intercepted
> 
> ## **Limitations**
> 
> ```bash
> # Won't work with:
> - Statically linked binaries (no dynamic linking)
> - Applications that bypass standard socket calls
> - Programs that use raw sockets
> - Applications with security restrictions on LD_PRELOAD
> ```
> 
> ## **You Can See It in Action**
> 
> ```bash
> # See what functions are being intercepted
> strace -e trace=connect proxychains curl http://example.com
> 
> # You'll see the connect() going to 127.0.0.1:9050 instead of example.com:80
> ```
> 
> So yes, it's "magic" in that the application has no idea its network
> calls are being rerouted, but it's accomplished through well-established
> Unix mechanisms for library interposition!
> 
> >>> the idea?
> 
> innfeed is started in INN2. Looking at your `/etc/news/newsfeeds` entry:
> 
> ```
> # innfeed funnel master.
> innfeed!\
>         :!*\
>         :Tc,Wnm*:/usr/lib/news/bin/innfeed
> ```
> 
> This is the **funnel master** entry that tells `innd` how to start
> innfeed. The key part is:
> - `Tc,Wnm*` - flags for the feed type
> - `:/usr/lib/news/bin/innfeed` - the actual command to execute
> 
> ## To add proxy support via proxychains:
> 
> You'd modify this line to:
> 
> ```
> # innfeed funnel master with proxy support
> innfeed!\
>         :!*\
>         :Tc,Wnm*:/usr/bin/proxychains /usr/lib/news/bin/innfeed
> ```
> 
> ## Or with environment variables:
> 
> ```
> # innfeed funnel master with proxy via env vars
> innfeed!\
>         :!*\
>         :Tc,Wnm*:/bin/sh -c "LD_PRELOAD=/usr/lib/libproxychains.so.4
> /usr/lib/news/bin/innfeed"
> ```
> 
> ## Alternative approach - wrapper script:
> 
> Create `/usr/local/bin/innfeed-proxy`:
> ```bash
> #!/bin/bash
> exec proxychains /usr/lib/news/bin/innfeed "$@"
> ```
> 
> Then modify newsfeeds:
> ```
> innfeed!\
>         :!*\
>         :Tc,Wnm*:/usr/local/bin/innfeed-proxy
> ```
> 
> After modifying `/etc/news/newsfeeds`, you need to:
> 1. Run `ctlinnd reload newsfeeds 'Added proxy support'`
> 2. Or restart innd
> 
> This way, every time innd spawns innfeed, it will automatically go
> through your proxy configuration.
> 
> 
> 
> -- 
> .......
> Billy G. (go-while)
> https://pugleaf.net
> @Newsgroup: rocksolid.nodes.help
> irc.pugleaf.net:6697 (SSL) #lounge
> discord: https://discord.gg/rh2tGMJWwV

Excellent. No dinking around with fragile NAT and netfilter rules, greatly lowering the entry bar to up and running. This is probably the simplest possible solution.

FYI there is a highly secure alternative to torsocks and proxychains called oniux.

"Introducing oniux: Kernel-level Tor isolation for any Linux app"

https://blog.torproject.org/introducing-oniux-tor-isolation-using-linux-namespaces/

This uses Linux namespaces to prohibit tunnel leaks.

Another option is to use the netfiltering and netname options of firejail.

From this thread I have learned that we can run a network of INN2 peers completely isolated behind onion services. Now it is time for the mad scientists to get to work generating a golem. Let's create a network Frankenstein!

-- 
Soul Patch
Technical Details
Message-ID: <10a5178$1q3h1$1@paganini.bofh.team>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srl.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!tor-network!not-for-mail
References: <20250911142203.D80443E631@mail.tcpreset.net> <10a18ai$ltu9$1@news.tcpreset.net> <10a18lk$lucp$1@news.tcpreset.net> <10a1u20$1fujq$1@paganini.bofh.team> <10a212b$mqvr$1@news.tcpreset.net> <10a2keu$1m1fh$1@paganini.bofh.team> <10a3ekv$2f18q$1@reader-nyc.newsdeef.eu>

Show Full Headers
Complete Article Headers
Message-ID: <10a5178$1q3h1$1@paganini.bofh.team>
Subject: Re: It's become mail2dizum
Date: Sat, 13 Sep 2025 18:49:48 -0500
From: Soul Patch <soul.patch@127.0.0.1>
References: <20250911142203.D80443E631@mail.tcpreset.net> <10a18ai$ltu9$1@news.tcpreset.net> <10a18lk$lucp$1@news.tcpreset.net> <10a1u20$1fujq$1@paganini.bofh.team> <10a212b$mqvr$1@news.tcpreset.net> <10a2keu$1m1fh$1@paganini.bofh.team> <10a3ekv$2f18q$1@reader-nyc.newsdeef.eu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srl.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!paganini.bofh.team!tor-network!not-for-mail
Newsgroups: alt.privacy.anon-server,alt.privacy,sci.crypt
Organization: To protect and to server
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Injection-Date: Sun, 14 Sep 2025 00:11:20 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1904161"; posting-host="v9Psx2OTQ5CY/oWxA9jkSg.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
X-Notice: Filtered by postfilter v. 0.9.3
X-TOR-Router: sha256:NDUuMTQxLjIxNS41Ng== --