Opened 3 years ago

Last modified 4 weeks ago

#19700 assigned defect

torsocks does not work with "connectx" (in netcat / nc)

Reported by: egonline Owned by:
Priority: High Milestone:
Component: Core Tor/Torsocks Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I found that 'torify', which wraps connections outbound through Tor, did not work with "nc" (netcat) on Mac OS X in that connections exposed my true IP address. I looked further into it, and torify works with the flag to "-O" in nc (nc -O) which, according to the usage, utilizes the standard connect() system call. However, by default, netcat seems to be now using the "connectx" system call which torsocks is not hooking. I cannot find much information on "connectx" except that related to the protocol "SCTP" on BSD variants (including OS X).

Does anyone know anything about this? Is there any plans to hook calls to "connectx()" (or, from what I've found, sctp_connectx() is the call)? The protocol shows up as "tcp4" in a netstat on OS X.

nc usage flag info for -O:

-O Use old-style connect instead of connectx

Child Tickets

Attachments (1)

patches-and-dtrace-logs.zip (19.6 KB) - added by iology 4 weeks ago.
This zip also includes the manpage of connectx(2).

Download all attachments as: .zip

Change History (5)

comment:1 Changed 3 years ago by egonline

Bump up ... anyone have any idea what this "connectx" system call is?

Thanks

comment:2 Changed 3 years ago by dgoulet

Keywords: torify torsocks removed
Priority: MediumHigh
Status: newneeds_information
Version: Tor: unspecified

I do not have a OS X to debug nor test unfortunately... Any chance you can provide a strace output? I can't find much about connectx() online or in the OS X documentation... Do you have a man page about it? (man connectx)

The more you can tell me about the syscall, the better else I can't support it :S.

comment:3 Changed 5 weeks ago by gaba

Owner: dgoulet deleted
Status: needs_informationassigned

Releasing some old tickets.

Changed 4 weeks ago by iology

Attachment: patches-and-dtrace-logs.zip added

This zip also includes the manpage of connectx(2).

comment:4 Changed 4 weeks ago by iology

Hi, I know very little about this low-level & networking stuff, so definitely expect bugs in my patch. :p Hopefully someone else will make a sophisticated patch. At least torsocks /local/copy/of/nc whatismyip.akamai.com 80 works for me.

Note: See TracTickets for help on using tickets.