Opened 4 years ago

Last modified 8 months ago

#19700 new 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:


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) (19.6 KB) - added by iology 16 months ago.
This zip also includes the manpage of connectx(2).

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by egonline

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


comment:2 Changed 4 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 17 months ago by gaba

Owner: dgoulet deleted
Status: needs_informationassigned

Releasing some old tickets.

Changed 16 months ago by iology

Attachment: added

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

comment:4 Changed 16 months 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 80 works for me.

comment:5 Changed 8 months ago by teor

Status: assignednew

Change tickets that are assigned to nobody to "new".

Note: See TracTickets for help on using tickets.