Jump to content

Using Tor For Shell


jano_prospero
 Share

Recommended Posts

  • 1 month later...

A better way to do this is by using socat to create a local tunnel. This works with any software that doesn't have native SOCKS proxy support. I once wrote this crappy script to make it easy:

#!/bin/sh
# crudely shutsdown socat (if running) and then restarts it for new host/port
# by sahal http://scr.im/sahal

# you can now connect to localhost:4242
# as if you were connecting to $1:$2
# using SOCKS proxy $orlisadr:$orport

# usage: ./socatchk remote-host remote-port

#SOCKS listen port 
orport=9150
#SOCKS listen address
orlisadr=localhost

[ "$(pidof socat >/dev/null 2>&1 && echo $?)" = 0 ] && kill $(pidof socat); [ "$(pidof socat && echo $?)" != 0 ] && sleep 3s; socat TCP4-LISTEN:4242,fork SOCKS4A:$orlisadr:$1:$2,socksport=$orport &

Just put that in a file 'socatchk' make it executable (chmod +x socatchk) and launch it (./socatchk remotehost remoteport) Now try to connect to localhost:4242. You should connect to the remote site (remotehost:remoteport) on any software that doesn't support SOCKS proxies natively.

Edited by 美国人
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...