FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-15-2012, 09:50 AM
Mick
 
Default Socks-ifying an application

I am not sure what I am doing wrong, but I can't seem to be able to get
tsocks, or proxychains working.

I set up a socks server virtue of ssh dynamic port forwarding:

$ ssh -D localhost:12465 root@10.10.10.12

Then I run:

$ . tsocks on
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks firefox

or tsocks kmail, or tsocks <anything else>.

The connection is not sent out via the server on 10.10.10.12. The terminal
that ran tsocks does not reveal anything in terms of a connection taking
place, at least not when I run firefox. With Chromium things are more
revealing:

$ . tsocks on
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks chromium
[4591:4604:405018909:ERRORbject_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files
ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
preloaded: ignored.


Exporting like this, also fails to load it for chromium:

$ export LD_PRELOAD=/lib/libtsocks.so
$ tsocks sh
LD_PRELOAD="/lib/libtsocks.so"
$ tsocks chromium
[5052:5065:973215173:ERRORbject_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files
ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
preloaded: ignored.



If I set up socks within the firefox application Advanced/Network
settings, without using tsocks, the connection succeeds through the
ssh tunnel. Therefore I am confident that the tunnel itself is
working as a socks5 server.


This is what I have in /etc/socks/tsocks.conf

server = 127.0.0.1
server_type = 5
server_port = 12465

Similarly, I get no connection if I use proxychains.

Any idea what I am doing wrong here?

--
Regards,
Mick
 
Old 05-15-2012, 02:45 PM
Alan McKinnon
 
Default Socks-ifying an application

On Tue, 15 May 2012 10:50:43 +0100
Mick <michaelkintzios@gmail.com> wrote:

> I am not sure what I am doing wrong, but I can't seem to be able to
> get tsocks, or proxychains working.
>
> I set up a socks server virtue of ssh dynamic port forwarding:
>
> $ ssh -D localhost:12465 root@10.10.10.12

This part is fine.

I tried the next part. It didn't work nicely for me.

So what I do now is:

Firefox + FoxyProxy

and now I can set my proxy individually per site. All the internal work
stuff accessed from home goes through the proxy, except the three sites
only viewable from the outside; and everything else bypasses the proxy.

Much better than trying to deal with a global proxy (although foxyproxy
will do that too if that is what you need.

And dispense with all the tsocks stuff.

I see recent KDE now also supports socks. This is a nice new addition
so konqueror can also use it.




>
> Then I run:
>
> $ . tsocks on
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks firefox
>
> or tsocks kmail, or tsocks <anything else>.
>
> The connection is not sent out via the server on 10.10.10.12. The
> terminal that ran tsocks does not reveal anything in terms of a
> connection taking place, at least not when I run firefox. With
> Chromium things are more revealing:
>
> $ . tsocks on
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks chromium
> [4591:4604:405018909:ERRORbject_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
> ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
> preloaded: ignored.
>
>
> Exporting like this, also fails to load it for chromium:
>
> $ export LD_PRELOAD=/lib/libtsocks.so
> $ tsocks sh
> LD_PRELOAD="/lib/libtsocks.so"
> $ tsocks chromium
> [5052:5065:973215173:ERRORbject_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
> ERROR: ld.so: object '/lib/libtsocks.so' from LD_PRELOAD cannot be
> preloaded: ignored.
>
>
>
> If I set up socks within the firefox application Advanced/Network
> settings, without using tsocks, the connection succeeds through the
> ssh tunnel. Therefore I am confident that the tunnel itself is
> working as a socks5 server.
>
>
> This is what I have in /etc/socks/tsocks.conf
>
> server = 127.0.0.1
> server_type = 5
> server_port = 12465
>
> Similarly, I get no connection if I use proxychains.
>
> Any idea what I am doing wrong here?
>



--
Alan McKinnnon
alan.mckinnon@gmail.com
 
Old 05-15-2012, 03:57 PM
Mick
 
Default Socks-ifying an application

On 15 May 2012 15:45, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On Tue, 15 May 2012 10:50:43 +0100
> Mick <michaelkintzios@gmail.com> wrote:

>> $ ssh -D localhost:12465 root@10.10.10.12
>
> This part is fine.
>
> I tried the next part. It didn't work nicely for me.

Ah, thanks for this! It's reassuring to know that it's not just my system. :-)


> So what I do now is:
>
> Firefox + FoxyProxy

Firefox is less of a problem for me because I can set it up to
socksify everything. It is Kmail that I am mostly interested in.


> I see recent KDE now also supports socks. This is a nice new addition
> so konqueror can also use it.

Yes, but it does not work with the current stable kmail. The new
KDEPIM is such a nightmare I do not plan moving to it anytime soon.
It screwed up one box that I tried it on and that's enough for me.
:-(

Did you have any success with proxychains?

I am not sure if the problem is related to the tsocks LD_PRELOAD error.


I also noticed that when I try to set up a proxy server in Chromium
using the 'under the bonnet' tab, I get this:

"When running Chromium under a supported desktop environment, the
system proxy settings will be used. However, either your system is not
supported or there was a problem while launching your system
configuration.

But you can still configure via the command line. Please see man
chromium-browser for more information on flags and environment
variables."

Trying the command line did not fix it:

[4742:4753:1575546819:ERRORbject_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files

That's what made me think that something on my system is not set up
properly. :-/


These are the libtsocks.so files in my system:

# ls -la /lib*/libtsocks.so
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib64/libtsocks.so -> libtsocks.so.1

# ls -la /lib/libtsocks.so*
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root 16 May 13 15:34 /lib/libtsocks.so.1 ->
libtsocks.so.1.8
-rwxr-xr-x 1 root root 42912 May 13 15:34 /lib/libtsocks.so.1.8

# ls -la /lib64/libtsocks.so*
lrwxrwxrwx 1 root root 14 May 13 15:34 /lib64/libtsocks.so -> libtsocks.so.1
lrwxrwxrwx 1 root root 16 May 13 15:34 /lib64/libtsocks.so.1 ->
libtsocks.so.1.8
-rwxr-xr-x 1 root root 42912 May 13 15:34 /lib64/libtsocks.so.1.8

I can't see why it would not load it, unless it should be trying to
load the '/lib64/libtsocks.so' instead of the '/lib/libtsocks.so' on
an amd64 system? Shall I file a bug?
--
Regards,
Mick
 
Old 05-15-2012, 09:08 PM
Alan McKinnon
 
Default Socks-ifying an application

On Tue, 15 May 2012 16:57:26 +0100
Mick <michaelkintzios@gmail.com> wrote:

> On 15 May 2012 15:45, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> > On Tue, 15 May 2012 10:50:43 +0100
> > Mick <michaelkintzios@gmail.com> wrote:
>
> >> $ ssh -D localhost:12465 root@10.10.10.12
> >
> > This part is fine.
> >
> > I tried the next part. It didn't work nicely for me.
>
> Ah, thanks for this! It's reassuring to know that it's not just my
> system. :-)
>
>
> > So what I do now is:
> >
> > Firefox + FoxyProxy
>
> Firefox is less of a problem for me because I can set it up to
> socksify everything. It is Kmail that I am mostly interested in.
>
>
> > I see recent KDE now also supports socks. This is a nice new
> > addition so konqueror can also use it.
>
> Yes, but it does not work with the current stable kmail. The new
> KDEPIM is such a nightmare I do not plan moving to it anytime soon.
> It screwed up one box that I tried it on and that's enough for me.
> :-(
>
> Did you have any success with proxychains?
>
> I am not sure if the problem is related to the tsocks LD_PRELOAD
> error.

It almost certainly is, tsocks uses LD_PRELOAD to mangle it's magic so
that stuff works. I believe chromium has severe issues with tsocks
because of how it does it's sandboxing, but I honestly don't know how
to get around that.

On a properly setup Gentoo amd64 system, /lib is a link to /lib64, so
the error you get is not a path error, the chromium binary really
cannot (or will not) deal with tsocks.so

I don't see anything wrong with the rest of your config. I honestly
think you are dealing with a chromium feature not a chromium bug.

Have you searched chromium-specific sites to see what others have to
say?



>
>
> I also noticed that when I try to set up a proxy server in Chromium
> using the 'under the bonnet' tab, I get this:
>
> "When running Chromium under a supported desktop environment, the
> system proxy settings will be used. However, either your system is not
> supported or there was a problem while launching your system
> configuration.
>
> But you can still configure via the command line. Please see man
> chromium-browser for more information on flags and environment
> variables."
>
> Trying the command line did not fix it:
>
> [4742:4753:1575546819:ERRORbject_proxy.cc(239)] Failed to call
> method: org.freedesktop.DBus.Error.ServiceUnknown: The name
> org.freedesktop.NetworkManager was not provided by any .service files
>
> That's what made me think that something on my system is not set up
> properly. :-/
>
>
> These are the libtsocks.so files in my system:
>
> # ls -la /lib*/libtsocks.so
> lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root 14 May 13
> 15:34 /lib64/libtsocks.so -> libtsocks.so.1
>
> # ls -la /lib/libtsocks.so*
> lrwxrwxrwx 1 root root 14 May 13 15:34 /lib/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root 16 May 13
> 15:34 /lib/libtsocks.so.1 -> libtsocks.so.1.8
> -rwxr-xr-x 1 root root 42912 May 13 15:34 /lib/libtsocks.so.1.8
>
> # ls -la /lib64/libtsocks.so*
> lrwxrwxrwx 1 root root 14 May 13 15:34 /lib64/libtsocks.so ->
> libtsocks.so.1 lrwxrwxrwx 1 root root 16 May 13
> 15:34 /lib64/libtsocks.so.1 -> libtsocks.so.1.8
> -rwxr-xr-x 1 root root 42912 May 13 15:34 /lib64/libtsocks.so.1.8
>
> I can't see why it would not load it, unless it should be trying to
> load the '/lib64/libtsocks.so' instead of the '/lib/libtsocks.so' on
> an amd64 system? Shall I file a bug?



--
Alan McKinnnon
alan.mckinnon@gmail.com
 
Old 05-15-2012, 10:19 PM
Mick
 
Default Socks-ifying an application

On Tuesday 15 May 2012 22:08:17 you wrote:
> On Tue, 15 May 2012 16:57:26 +0100
> Mick <michaelkintzios@gmail.com> wrote:

> > I am not sure if the problem is related to the tsocks LD_PRELOAD
> > error.
>
> It almost certainly is, tsocks uses LD_PRELOAD to mangle it's magic so
> that stuff works. I believe chromium has severe issues with tsocks
> because of how it does it's sandboxing, but I honestly don't know how
> to get around that.
>
> On a properly setup Gentoo amd64 system, /lib is a link to /lib64, so
> the error you get is not a path error, the chromium binary really
> cannot (or will not) deal with tsocks.so
>
> I don't see anything wrong with the rest of your config. I honestly
> think you are dealing with a chromium feature not a chromium bug.
>
> Have you searched chromium-specific sites to see what others have to
> say?

I haven't yet, because it is not just Chromium that's not working as it is
supposed to (although it is the most vocal app on the terminal when called
with tsocks). I haven't yet found an app which will work with tsocks at all.

The fact that proxychains does not work at all (applications completely ignore
it and run outside the tunnel) made me question the sanity of my set up. Is
there anything other than coincidence that would cause both apps to fail?
--
Regards,
Mick
 
Old 05-16-2012, 10:01 AM
Mick
 
Default Socks-ifying an application

On 15 May 2012 23:19, Mick <michaelkintzios@gmail.com> wrote:
> On Tuesday 15 May 2012 22:08:17 you wrote:

>> I don't see anything wrong with the rest of your config. I honestly
>> think you are dealing with a chromium feature not a chromium bug.
>>
>> Have you searched chromium-specific sites to see what others have to
>> say?
>
> I haven't yet, because it is not just Chromium that's not working as it is
> supposed to (although it is the most vocal app on the terminal when called
> with tsocks). *I haven't yet found an app which will work with tsocks at all.

OK, I just noticed that launching chromium from a terminal brings up
this error, so it is not tsocks specific:

$ chromium
[4163:4174:213397467:ERRORbject_proxy.cc(239)] Failed to call
method: org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.NetworkManager was not provided by any .service files


> The fact that proxychains does not work at all (applications completely ignore
> it and run outside the tunnel) made me question the sanity of my set up. *Is
> there anything other than coincidence that would cause both apps to fail?

Yep, it is a coincidence it seems:

https://bugs.gentoo.org/show_bug.cgi?id=408427

--
Regards,
Mick
 

Thread Tools




All times are GMT. The time now is 08:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org