Commit Graph

6 Commits (7fe813949644b115b0127279517dc7c0ee2d63b9)

Author SHA1 Message Date
rofl0r 7fe8139496 experimental new feature: proxy_dns_daemon
since many users complain about issues with modern, ultracomplex
clusterfuck software such as chromium, nodejs, etc, i've reconsidered
one of my original ideas how to implement remote dns lookup support.
instead of having a background thread serving requests via a pipe,
the user manually starts a background daemon process before running
proxychains, and the two processes then communicate via UDP.
this requires much less hacks (like hooking of close() to prevent
pipes from getting closed) and doesn't need to call any async-signal
unsafe code like malloc(). this means it should be much more compatible
than the previous method, however it's not as practical and slightly
slower.

it's recommended that the proxychains4-daemon runs on localhost, and
if you use proxychains-ng a lot you might want to set ip up as a service
that starts on boot. a single proxychains4-daemon should theoretically
be able to serve many parallel proxychains4 instances, but this has not
yet been tested so far. it's also possible to run the daemon on other
computers, even over internet, but currently there is no error-checking/
timeout code at all; that means the UDP connection needs to be very
stable.

the library code used for the daemon sources are from my projects
libulz[0] and htab[1], and the server code is loosely based on
microsocks[2]. their licenses are all compatible with the GPL.
if not otherwise mentioned, they're released for this purpose under
the standard proxychains-ng license (see COPYING).

[0]: https://github.com/rofl0r/libulz
[1]: https://github.com/rofl0r/htab
[2]: https://github.com/rofl0r/microsocks
2020-09-23 22:14:39 +01:00
rofl0r 2237749567 preliminary ipv6 support
only basic testing was done (with 2 socks5 proxies listening on ::1)
but seems to work as intended.

ipv6 support for the hostsreader (/etc/hosts) is not implemented so far.
2015-08-10 17:00:26 +01:00
rofl0r 1da09e49e5 hook close() to prevent rude programs like ssh to close our pipes
those pipes are needed to talk with the dns-name allocator thread.

closes #9
2013-01-21 01:54:45 +01:00
rofl0r be4efc0fd5 fix no-newline warnings on old compilers 2012-12-25 18:01:11 +01:00
rofl0r d0abc93c74 preliminary first fork-safe version
instead of allocating memory in the child, we now use the allocator
thread to do all the necessary allocations himself.
additionally we provide a clean API to query the ip <-> dns mapping.
these functions connect via a pipe to the allocator thread, and
exchange messages.

further cleanup is needed, but it seems to work so far.
thread-safety is not yet guaranteed.

closes #1
2012-11-07 21:31:11 +01:00
rofl0r 25afe98b20 failed attempt to use shared memory for the ip <-> dns mapping
this is in order to get irssi, which forks for DNS lookups,
and similar programs, to work as intended.

in a previous attempt i learned that shared memory created in a
child process is not visible to the parent;
in this attempt i spin off a thread from the parent which listens
on a pipe and manages the shared memory allocation from the parent
address-space. however this doesnt work as expected:
memory allocated in the parent after the child forked is not visi-
ble to the child as well.

so what happens is: irssi starts a child process, the thread allocs
memory and hands it to the child, the child attempts to write and
segfaults. however irssi doesnt crash. since now the memory is
already allocated, doing the dns lookup again will succeed.

i.e. the dns lookup works now in irssi by luck.
all but the first dns lookups will suceed.

however this is not good enough for me to be satisfied, i commit
this only for documentation purposes.
2012-11-07 16:49:14 +01:00