LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   anyway to tunnel all network traffic of a single app via an ssh? (https://www.linuxquestions.org/questions/linux-software-2/anyway-to-tunnel-all-network-traffic-of-a-single-app-via-an-ssh-4175497527/)

steve51184 03-08-2014 03:33 PM

anyway to tunnel all network traffic of a single app via an ssh?
 
i have an ssh tunnel setup fine but i wan't to be able to send all traffic from one app through it.. can it be done?

evo2 03-10-2014 01:02 AM

Hi,

Quote:

Originally Posted by steve51184 (Post 5131246)
i have an ssh tunnel setup fine but i wan't to be able to send all traffic from one app through it.. can it be done?

yes. For this I use socks proxy over ssh (-D option), and proxychains for the client program.

Eg.
Create the tunnel
Code:

ssh -f -N -D localhost:5555 myserver.some.where
Configure proxychains
Code:

echo 'socks4 127.0.0.1 5555' >> /etc/proxychaings.conf
Use the tunnel with some program
Code:

proxychains someprogram
HTH,

Evo2.

evo2 03-10-2014 01:04 AM

Hi,

one more thing, you don't need root for this since proxychains will also look for a config file in ~/.proxychains.conf

Evo2.

steve51184 03-10-2014 11:29 AM

hmm tried that but just can't seem to get it to work :(

evo2 03-10-2014 07:24 PM

Hi,
Quote:

Originally Posted by steve51184 (Post 5132098)
hmm tried that but just can't seem to get it to work :(

can you be more specific?

Evo2.

lleb 03-10-2014 07:38 PM

Quote:

Originally Posted by steve51184 (Post 5132098)
hmm tried that but just can't seem to get it to work :(

copy paste with code flags what you did and what happened directly from the CLI.

steve51184 03-10-2014 10:56 PM

i ran the following command to open the socks proxy on port 5555:

Code:

ssh -f -N -D localhost:5555 server.ip
i then saved the following in /etc/proxychains.conf (well i edited the old config to remove the default tor line etc):

Code:

socks4 127.0.0.1 5555
i then ran the following (just a test i know it can be done within chrome much better etc):

Code:

proxychains /usr/bin/google-chrome-stable
all i get is 'This web page is not available' via chrome (and likewise other apps also have no internet access)

this is the output via command line for the above command: http://pastie.org/pastes/8906135/tex...utkrtjfznfd2bw

evo2 03-10-2014 11:20 PM

Hi,

ok from the pastebin I can see that libproxychains.so.3 is not being found. Was ldconfig run by the postinstall script? If not please try running it now (as root). You may also need to log out and back in again (but I'm just guessing here).

If the above fails then _instead_ of running the proxychains script do:
Code:

export LD_PRELOAD=/usr/lib/libproxychains.so.3
someprogram

The only difference between this and using the proxychains script is that the full path is specified for LD_PRELOAD.

Evo2.

steve51184 03-10-2014 11:32 PM

/usr/lib/libproxychains.so.3 isn't on my system? :/

evo2 03-10-2014 11:50 PM

Hi,

what is the output of the following?
Code:

find /usr/lib -name libproxychains.so.3
Evo2.

steve51184 03-10-2014 11:50 PM

/usr/lib/x86_64-linux-gnu/libproxychains.so.3

evo2 03-10-2014 11:52 PM

Hi,

ok, so use that path.

Evo2.

steve51184 03-10-2014 11:53 PM

sorry to sound dumb but what do i do with the following? :/

Code:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libproxychains.so.3
COMMAND


evo2 03-10-2014 11:56 PM

Hi,

run it in a terminal replacing "COMMAND" with whatever command you want to run eg chrome-chrome-stable. Look at the contents of /usr/bin/sockproxy to understand why.

Evo2.

steve51184 03-10-2014 11:59 PM

/usr/bin/sockproxy is empty :/

also same problem no internet access for the app although the libproxychains.so.3 error is gone:

Code:

[22084:22134:0311/045814:ERROR:download.cc(356)] PostClientToServerMessage() failed during GetUpdates
[22084:22084:0311/045814:ERROR:CONSOLE(0)] "Application Cache Error event: Manifest fetch failed (-1) https://www.google.co.uk/_/chrome/newtab/manifest?espv=2&ie=UTF-8", source: https://www.google.co.uk/_/chrome/newtab?espv=2&ie=UTF-8 (0)
[22084:22084:0311/045815:ERROR:CONSOLE(0)] "Error in event handler for (unknown): TypeError: Cannot read property 'debug' of undefined
    at chrome-extension://dhnaagndnllbblbgeimdkknegobbpohk/imagezoomer.js:35:23
    at disconnectListener (extensions::messaging:338:9)
    at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
    at Event.dispatchToListener (extensions::event_bindings:394:22)
    at Event.dispatch_ (extensions::event_bindings:378:27)
    at Event.dispatch (extensions::event_bindings:400:17)
    at dispatchOnDisconnect (extensions::messaging:293:27)", source: https://www.google.co.uk/_/chrome/newtab?espv=2&ie=UTF-8 (0)



All times are GMT -5. The time now is 06:09 AM.