rofl0r / proxychains-ng

proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project. the sf.net page is currently not updated, use releases from github release page instead.
http://sourceforge.net/projects/proxychains-ng/files
GNU General Public License v2.0
9.76k stars 1.08k forks source link

VSCode failed to launch with proxychains after upgrading to 1.49 #343

Open Phi-Li opened 4 years ago

Phi-Li commented 4 years ago

OS: Debian Sid proxychains version: 4.14 VSCode version: 1.49.1

A few days ago I did a system-wide package upgrading and since then Joplin (a note application, with no proxy support) could not open VSCode as external editor. Then I tried run VSCode with proxychains directly and it failed to launch.

On another machine running Ubuntu 20.04, VSCode 1.47 worked fine with proxychains 4.14, but after upgrading to 1.49 it could not launch any more.

Update: I've downgraded to VSCode 1.48.2 and it works fine on both machines.

rofl0r commented 4 years ago

thanks for your report. it would be interesting if you can get it to run with latest proxychains-ng master's new proxy_dns_old directive instead of proxy_dns.

Then I tried run VSCode with proxychains directly and it failed to launch.

did you get some kind of error message ? also seeing a log from strace might give clues what's happening there.

Phi-Li commented 4 years ago

I didn't get any error message. Here's the result of strace proxychains /usr/bin/code (version 1.49):

execve("/usr/bin/proxychains", ["proxychains", "/usr/bin/code"], 0x7ffc6b7e1148 /* 57 vars */) = 0
brk(NULL)                               = 0x55cfabb3e000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=140187, ...}) = 0
mmap(NULL, 140187, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb510936000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0n\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1839792, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb510934000
mmap(NULL, 1852680, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb51076f000
mprotect(0x7fb510794000, 1662976, PROT_NONE) = 0
mmap(0x7fb510794000, 1355776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fb510794000
mmap(0x7fb5108df000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x170000) = 0x7fb5108df000
mmap(0x7fb51092a000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7fb51092a000
mmap(0x7fb510930000, 13576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb510930000
close(3)                                = 0
arch_prctl(ARCH_SET_FS, 0x7fb510935540) = 0
mprotect(0x7fb51092a000, 12288, PROT_READ) = 0
mprotect(0x55cfaa4d1000, 4096, PROT_READ) = 0
mprotect(0x7fb510983000, 4096, PROT_READ) = 0
munmap(0x7fb510936000, 140187)          = 0
getcwd("/home/xxx", 512)               = 11
access("/home/xxx/proxychains.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/home/xxx/.proxychains/proxychains.conf", R_OK) = -1 ENOENT (No such file or directory)
access("/etc/proxychains.conf", R_OK)   = -1 ENOENT (No such file or directory)
access("/etc/proxychains.conf", R_OK)   = -1 ENOENT (No such file or directory)
access("/etc/proxychains4.conf", R_OK)  = 0
write(2, "[proxychains] config file found:"..., 56[proxychains] config file found: /etc/proxychains4.conf
) = 56
brk(NULL)                               = 0x55cfabb3e000
brk(0x55cfabb5f000)                     = 0x55cfabb5f000
access("/dev/null//libproxychains.so.4", R_OK) = -1 ENOTDIR (Not a directory)
access("/usr/lib/x86_64-linux-gnu/libproxychains.so.4", R_OK) = 0
write(2, "[proxychains] preloading /usr/li"..., 71[proxychains] preloading /usr/lib/x86_64-linux-gnu/libproxychains.so.4
) = 71
execve("/usr/bin/code", ["/usr/bin/code"], 0x55cfabb3e4e0 /* 59 vars */) = 0
brk(NULL)                               = 0x5568f2511000
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libproxychains.so.4", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3605\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=43040, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f41f9ef2000
mmap(NULL, 333152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f41f9ea0000
mmap(0x7f41f9ea3000, 20480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f41f9ea3000
mmap(0x7f41f9ea8000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f41f9ea8000
mmap(0x7f41f9eaa000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7f41f9eaa000
mmap(0x7f41f9eac000, 284000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f41f9eac000
close(3)                                = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=140187, ...}) = 0
mmap(NULL, 140187, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f41f9e7d000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0n\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1839792, ...}) = 0
mmap(NULL, 1852680, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f41f9cb8000
mprotect(0x7f41f9cdd000, 1662976, PROT_NONE) = 0
mmap(0x7f41f9cdd000, 1355776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f41f9cdd000
mmap(0x7f41f9e28000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x170000) = 0x7f41f9e28000
mmap(0x7f41f9e73000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f41f9e73000
mmap(0x7f41f9e79000, 13576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f41f9e79000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\21\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=18688, ...}) = 0
mmap(NULL, 20752, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f41f9cb2000
mmap(0x7f41f9cb3000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f41f9cb3000
mmap(0x7f41f9cb5000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f41f9cb5000
mmap(0x7f41f9cb6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f41f9cb6000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 |\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=149608, ...}) = 0
mmap(NULL, 136304, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f41f9c90000
mmap(0x7f41f9c97000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f41f9c97000
mmap(0x7f41f9ca7000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f41f9ca7000
mmap(0x7f41f9cac000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f41f9cac000
mmap(0x7f41f9cae000, 13424, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f41f9cae000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f41f9c8e000
arch_prctl(ARCH_SET_FS, 0x7f41f9c8eb80) = 0
mprotect(0x7f41f9e73000, 12288, PROT_READ) = 0
mprotect(0x7f41f9cac000, 4096, PROT_READ) = 0
mprotect(0x7f41f9cb6000, 4096, PROT_READ) = 0
mprotect(0x7f41f9eaa000, 4096, PROT_READ) = 0
mprotect(0x5568f1570000, 4096, PROT_READ) = 0
mprotect(0x7f41f9f1e000, 4096, PROT_READ) = 0
munmap(0x7f41f9e7d000, 140187)          = 0
set_tid_address(0x7f41f9c8ee50)         = 24657
set_robust_list(0x7f41f9c8ee60, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f41f9c97690, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f41f9ca4140}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f41f9c97730, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f41f9ca4140}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0) = 0x7f41f9f1d000
pipe2([3, 4], O_CLOEXEC)                = 0
pipe2([5, 6], O_CLOEXEC)                = 0
mmap(NULL, 20480, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f41f9e9b000
mprotect(0x7f41f9e9c000, 16384, PROT_READ|PROT_WRITE) = 0
brk(NULL)                               = 0x5568f2511000
brk(0x5568f2532000)                     = 0x5568f2532000
clone(child_stack=0x7f41f9e9efb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[24659], tls=0x7f41f9e9f700, child_tidptr=0x7f41f9e9f9d0) = 24659
access("/etc/proxychains4.conf", R_OK)  = 0
openat(AT_FDCWD, "/etc/proxychains4.conf", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=3705, ...}) = 0
read(7, "# proxychains.conf  VER 4.x\n#\n# "..., 4096) = 3705
read(7, "", 4096)                       = 0
close(7)                                = 0
write(2, "[proxychains] DLL init: proxycha"..., 44[proxychains] DLL init: proxychains-ng 4.14
) = 44
futex(0x7f41f9cb70c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f41f9eab0e0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
execve("/home/xxx/.local/bin/sh", ["sh", "/usr/bin/code"], 0x7fff133422a8 /* 59 vars */) = -1 ENOENT (No such file or directory)
execve("/home/xxx/bin/sh", ["sh", "/usr/bin/code"], 0x7fff133422a8 /* 59 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/sh", ["sh", "/usr/bin/code"], 0x7fff133422a8 /* 59 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/bin/sh", ["sh", "/usr/bin/code"], 0x7fff133422a8 /* 59 vars */) = -1 ENOENT (No such file or directory)
execve("/bin/sh", ["sh", "/usr/bin/code"], 0x7fff133422a8 /* 59 vars */) = 0
brk(NULL)                               = 0x555aa5d18000
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libproxychains.so.4", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3605\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=43040, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee6e74f000
mmap(NULL, 333152, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee6e6fd000
mmap(0x7fee6e700000, 20480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fee6e700000
mmap(0x7fee6e705000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7fee6e705000
mmap(0x7fee6e707000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7fee6e707000
mmap(0x7fee6e709000, 284000, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fee6e709000
close(3)                                = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=140187, ...}) = 0
mmap(NULL, 140187, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fee6e6da000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0n\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1839792, ...}) = 0
mmap(NULL, 1852680, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee6e515000
mprotect(0x7fee6e53a000, 1662976, PROT_NONE) = 0
mmap(0x7fee6e53a000, 1355776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fee6e53a000
mmap(0x7fee6e685000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x170000) = 0x7fee6e685000
mmap(0x7fee6e6d0000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7fee6e6d0000
mmap(0x7fee6e6d6000, 13576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fee6e6d6000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\21\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=18688, ...}) = 0
mmap(NULL, 20752, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee6e50f000
mmap(0x7fee6e510000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7fee6e510000
mmap(0x7fee6e512000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fee6e512000
mmap(0x7fee6e513000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fee6e513000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 |\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=149608, ...}) = 0
mmap(NULL, 136304, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee6e4ed000
mmap(0x7fee6e4f4000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7fee6e4f4000
mmap(0x7fee6e504000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7fee6e504000
mmap(0x7fee6e509000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7fee6e509000
mmap(0x7fee6e50b000, 13424, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fee6e50b000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee6e4eb000
arch_prctl(ARCH_SET_FS, 0x7fee6e4ebb80) = 0
mprotect(0x7fee6e6d0000, 12288, PROT_READ) = 0
mprotect(0x7fee6e509000, 4096, PROT_READ) = 0
mprotect(0x7fee6e513000, 4096, PROT_READ) = 0
mprotect(0x7fee6e707000, 4096, PROT_READ) = 0
mprotect(0x555aa4736000, 8192, PROT_READ) = 0
mprotect(0x7fee6e77b000, 4096, PROT_READ) = 0
munmap(0x7fee6e6da000, 140187)          = 0
set_tid_address(0x7fee6e4ebe50)         = 24657
set_robust_list(0x7fee6e4ebe60, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fee6e4f4690, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fee6e501140}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fee6e4f4730, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fee6e501140}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0) = 0x7fee6e77a000
pipe2([3, 4], O_CLOEXEC)                = 0
pipe2([5, 6], O_CLOEXEC)                = 0
mmap(NULL, 20480, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fee6e6f8000
mprotect(0x7fee6e6f9000, 16384, PROT_READ|PROT_WRITE) = 0
brk(NULL)                               = 0x555aa5d18000
brk(0x555aa5d39000)                     = 0x555aa5d39000
clone(child_stack=0x7fee6e6fbfb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[24660], tls=0x7fee6e6fc700, child_tidptr=0x7fee6e6fc9d0) = 24660
access("/etc/proxychains4.conf", R_OK)  = 0
openat(AT_FDCWD, "/etc/proxychains4.conf", O_RDONLY) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=3705, ...}) = 0
read(7, "# proxychains.conf  VER 4.x\n#\n# "..., 4096) = 3705
read(7, "", 4096)                       = 0
close(7)                                = 0
write(2, "[proxychains] DLL init: proxycha"..., 44[proxychains] DLL init: proxychains-ng 4.14
) = 44
futex(0x7fee6e5140c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7fee6e7080e0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
getuid()                                = 1000
getgid()                                = 1000
getpid()                                = 24657
rt_sigaction(SIGCHLD, {sa_handler=0x555aa472c340, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7fee6e550e30}, NULL, 8) = 0
geteuid()                               = 1000
getppid()                               = 24654
stat("/home/xxx", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/usr/bin/code", O_RDONLY) = 7
fcntl(7, F_DUPFD, 10)                   = 10
close(7)                                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
geteuid()                               = 1000
getegid()                               = 1000
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x555aa472c340, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7fee6e550e30}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7fee6e550e30}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER, sa_restorer=0x7fee6e550e30}, NULL, 8) = 0
read(10, "#!/usr/bin/env sh\n#\n# Copyright "..., 8192) = 1854
stat("/home/xxx/.local/bin/grep", 0x7ffc32f737f0) = -1 ENOENT (No such file or directory)
stat("/home/xxx/bin/grep", 0x7ffc32f737f0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/grep", 0x7ffc32f737f0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/grep", 0x7ffc32f737f0)   = -1 ENOENT (No such file or directory)
stat("/bin/grep", {st_mode=S_IFREG|0755, st_size=198976, ...}) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee6e4ebe50) = 24661
wait4(-1, [proxychains] DLL init: proxychains-ng 4.14
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 24661
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24661, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 24661
pipe([7, 8])                            = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee6e4ebe50) = 24663
close(8)                                = 0
read(7, [proxychains] DLL init: proxychains-ng 4.14
"1000\n", 128)                  = 5
read(7, "", 128)                        = 0
close(7)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24663
lstat("/usr/bin/code", {st_mode=S_IFLNK|0777, st_size=24, ...}) = 0
openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 7
fcntl(1, F_DUPFD, 10)                   = 11
close(1)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
dup2(7, 1)                              = 1
close(7)                                = 0
stat("/home/xxx/.local/bin/readlink", 0x7ffc32f73660) = -1 ENOENT (No such file or directory)
stat("/home/xxx/bin/readlink", 0x7ffc32f73660) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/readlink", 0x7ffc32f73660) = -1 ENOENT (No such file or directory)
stat("/usr/bin/readlink", 0x7ffc32f73660) = -1 ENOENT (No such file or directory)
stat("/bin/readlink", {st_mode=S_IFREG|0755, st_size=47936, ...}) = 0
write(1, "/bin/readlink\n", 14)         = 14
dup2(11, 1)                             = 1
close(11)                               = 0
pipe([7, 8])                            = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee6e4ebe50) = 24665
close(8)                                = 0
read(7, [proxychains] DLL init: proxychains-ng 4.14
[proxychains] DLL init: proxychains-ng 4.14
"/usr/share/code/bin\n", 128)   = 20
read(7, "", 128)                        = 0
close(7)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24665
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee6e4ebe50) = 24669
wait4(-1, [proxychains] DLL init: proxychains-ng 4.14
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24669
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=24669, si_uid=1000, si_status=0, si_utime=12, si_stime=1} ---
rt_sigreturn({mask=[]})                 = 24669
exit_group(0)                           = ?
+++ exited with 0 +++
rofl0r commented 4 years ago

thanks, though it's not really conclusive due to missing "-f" option to strace, which follows forks. i can't see anything obviously wrong on first glance.

Phi-Li commented 4 years ago

thanks, though it's not really conclusive due to missing "-f" option to strace, which follows forks. i can't see anything obviously wrong on first glance.

With -f option the output become too long so I didn't paste it then. I just created a gist: strace_proxychains.log

Phi-Li commented 4 years ago

Here's the Debian package source: Debian / proxychains-ng · GitLab.

Phi-Li commented 4 years ago

Just cloned and compiled from the latest master branch. I did get it to run with proxy_dns_old directive.

rofl0r commented 4 years ago

thanks. the first "bad thing" that happens is a SIGTRAP from a chromium process (seems to come out of some threadpool code), which apparently fails to create a "minidump" and then later with get a SIGILL (illegal opcode) from some memory address that is probably jit-generated x86 code (maybe put there specifically to cause that SIGILL, could be a sandbox security feature). the amount of hacks these modern browsers do is frightening. could be that latest vscode just bundles a more recent chrome version, but itself isn't to blame.

rofl0r commented 4 years ago

Just cloned and compiled from the latest master branch. I did get it to run with proxy_dns_old directive.

that's good news. is the performance acceptable? the old code does a fork() and a lengthy TCP-based dns lookup for each DNS request.

Phi-Li commented 4 years ago

Add some details. With proxy_dns_old VSCode pops an error notification "Extension host terminated", open the Chromium devtools then you can see:

Extension host terminated unexpectedly. Code:  null  Signal:  SIGABRT
--------------------------------------------------------------------------------------------
|DNS-request| dc.services.visualstudio.com can't exec proxyresolv: No such file or directory
|DNS-request| dc.services.visualstudio.com can't exec proxyresolv: No such file or directory
Failed to generate minidump.
|DNS-response|: dc.services.visualstudio.com does not existerr_dns: No such file or directory
Failed to generate minidump.
Server response:
--------------------------------------------------------------------------------------------
Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Disabling DNS proxy (comment out both proxy_dns and proxy_dns_old) can avoid this error.

rofl0r commented 4 years ago

|DNS-request| dc.services.visualstudio.com can't exec proxyresolv: No such file or directory

you need to copy src/proxyresolv to your PATH (sorry for not mentioning it earlier)

Phi-Li commented 4 years ago

After adding src/proxyresolv to PATH:

|DNS-request| dc.services.visualstudio.com
|DNS-response|: dc.services.visualstudio.com does not exist
err_dns: Invalid argument
|DNS-request| dc.services.visualstudio.com
|DNS-response|: dc.services.visualstudio.com does not exist
err_dns: Success
Server response:

Joplin is also an Electron app, and it can sync with OneDrive with the same config.

rofl0r commented 4 years ago

|DNS-response|: dc.services.visualstudio.com does not exist err_dns: Invalid argument

doh. would you mind stracing that again ? strace -f -s 256 -o logfile command here then look for first occurence of exec.*proxyresolv in the log and paste something like the following 500 lines

Phi-Li commented 4 years ago

proxyresolv appears several times so I just truncate the part before the first occurrence. strace_proxyresolv.log