Code Monkey home page Code Monkey logo

proxychains-windows's Introduction

Proxychains.exe - Proxychains for Windows README

Build Status

README | 简体中文文档

Proxychains.exe is a proxifier for Win32(Windows) or Cygwin/Msys2 programs. It hijacks most of the Win32 or Cygwin programs' TCP connection, making them through one or more SOCKS5 proxy(ies).

Proxychains.exe hooks network-related Ws2_32.dll Winsock functions in dynamically linked programs via injecting a DLL and redirects the connections through SOCKS5 proxy(ies).

Proxychains.exe is a port or rewrite of proxychains4 or proxychains-ng to Win32 and Cygwin. It also uses uthash for some data structures and minhook for API hooking.

Proxychains.exe is tested on Windows 10 x64 1909 (18363.418), Windows 7 x64 SP1, Windows XP x86 SP3 and Cygwin 64-bit 3.1.2. Target OS should have Visual C++ Redistributable for Visual Studio 2015 installed.

WARNING: ANONYMITY IS NOT GUARANTEED!

WARNING: this program works only on dynamically linked programs. Also both proxychains.exe and the program to call must be the same platform and architecture (use proxychains_x86.exe to call x86 program, proxychains_x64.exe to call x64 program; use Cygwin builds to call Cygwin program).

WARNING: this program is based on hacks and is at its early development stage. Any unexpected situation may happen during usage. The called program may crash, not work, produce unwanted results etc. Be careful when working with this tool.

WARNING: this program can be used to circumvent censorship. doing so can be VERY DANGEROUS in certain countries. ALWAYS MAKE SURE THAT PROXYCHAINS.EXE WORKS AS EXPECTED BEFORE USING IT FOR ANYTHING SERIOUS. This involves both the program and the proxy that you're going to use. For example, you can connect to some "what is my ip" service like ifconfig.me to make sure that it's not using your real ip.

ONLY USE PROXYCHAINS.EXE IF YOU KNOW WHAT YOU'RE DOING. THE AUTHORS AND MAINTAINERS OF PROXYCHAINS DO NOT TAKE ANY RESPONSIBILITY FOR ANY ABUSE OR MISUSE OF THIS SOFTWARE AND THE RESULTING CONSEQUENCES.

Download

Download the pre-built binaries from Release Page.

Build

If you want to buid proxychains.exe yourself...

First you need to clone this repository and run git submodule update --init --recursive in it to retrieve all submodules.

Win32 Build

Open proxychains.exe.sln with a recent version Visual Studio (tested with Visual Studio 2019) with platform toolset v141_xp on a 64-bit Windows.

Select the configuration (Debug/Release) and the platform (x86/x64).

Build the whole solution and you will see DLL file and executable file generated under win32_output/.

Cygwin/Msys2 Build

Install Cygwin/Msys2 and various build tool packages (gcc, w32api-headers, w32api-runtime etc). Run bash, switch to cygwin_build / msys_build directory and run make.

Install

Copy proxychains*.exe, [cyg/msys-]proxychains_hook*.dll to some directory included in your PATH environment variable. You can rename the main executable (like proxychains_win32_x64.exe) to names you favor, like proxychains.exe.

Last you need to create the needed configuration file in correct place. See "Configuration".

Configuration

Proxychains.exe looks for configuration in the following order:

On Win32

  • file listed in environment variable PROXYCHAINS_CONF_FILE or provided as a -f argument
  • %USERPROFILE%\.proxychains\proxychains.conf
  • (CSIDL_APPDATA)\Proxychains\proxychains.conf (On modern Windows versions, a typical path is C:\Users\<user name>\AppData\Roaming\ Proxychains\proxychains.conf)
  • (CSIDL_COMMON_APPDATA)\Proxychains\proxychains.conf (On modern Windows versions, a typical path is C:\ProgramData\Proxychains\ proxychains.conf)

On Cygwin

  • file listed in environment variable PROXYCHAINS_CONF_FILE or provided as a -f argument
  • $HOME/.proxychains/proxychains.conf
  • (SYSCONFDIR)/proxychains.conf
  • /etc/proxychains.conf

For options, see proxychains.conf.

Usage Example

proxychains ssh some-server

proxychains "Some Path\firefox.exe"

proxychains /bin/curl https://ifconfig.me

Run proxychains -h for more command line argument options.

How It Works

  • Main program hooks CreateProcessW Win32 API call.
  • Main program creates child process which is intended to be called.
  • After creating process, hooked CreateProcessW injects the Hook DLL into child process. When child process gets injected, it hooks the Win32 API call below:
    • CreateProcessW, so that every descendant process gets hooked;
    • connect, WSAConnect and ConnectEx, so that TCP connections get hijacked;
    • GetAddrInfoW series, so that Fake IP is used to trace hostnames you visited, allowing remote DNS resolving;
    • etc.
  • Main program does not exit, but serves as a named pipe server. Child process communicates with the main program to exchange data including logs, hostnames, etc. Main program does most of the bookkeeping of Fake IP and presence of descendant processes.
  • When all descendant processes exit, main program exits.
  • Main program terminates all descendant processes when it receives a SIGINT (Ctrl-C).

About Cygwin/Msys2 and Busybox

Cygwin is fully supported since 0.6.0!

Switching the DLL injection technique from CreateRemoteThread() to modifying the target process' entry point, proxychains.exe now supports proxifying Cygwin/Msys2 process perfectly. (Even when you call them with Win32 version of proxychains.exe). See DevNotes.

If you want to proxify MinGit busybox variant, replace its busybox.exe with this version modified by me. See DevNotes.

To-do and Known Issues

ConEmu Compatibility

ConEmu prevents its descendant processes to do SetThreadContext(). This means proxychains.exe is in no way compatible with terminals based on ConEmu (like cmder).

To-do

In the following period, I will try to re-structure proxychains.exe (files, functions, ...) and complete some to-dos at the same time.

  • Domain name resolution should be case-insensitive
  • Proxify osu!lazer launcher? (#11)
  • Configuration file path (#9)
  • Recognize IPv4-mapped fake IPv6 address
  • Resolve proxy server name by custom hosts file, or at least declare it as not supported in docs
  • Properly handle "fork-and-exit" child process ? (In this case the descendant processes' dns queries would never succeed)
  • Remote DNS resolving based on UDP associate
  • Hook sendto(), coping with applications which do TCP fast open
  • Powershell wget bug
  • IPs resolved from hosts file should also be filtered like fake ip (fixed in 0.6.8)
  • Resolve encoding issue regarding Cygwin and Mintty (fixed in 0.6.7)
  • Fake IPs should be filtered according to types of resolved IPs and hints in GetAddrInfoW and gethostbyname, otherwise crash may happen (fixed in 0.6.7)
  • Add an option to totally prevent "DNS leak" ? (Do name lookup on SOCKS5 server only) (fixed in 0.6.6)
  • Connection closure should be correctly handled in Ws2_32_LoopRecv and Ws2_32_LoopSend (fixed in 0.6.5)
  • A large part of socks5 server name possibly lost when parsing configuration (fixed in 0.6.5)
  • Correctly handle conf and hosts that start with BOM (fixed in 0.6.5)
  • Detect .NET CLR programs that is AnyCPU&prefers 32-bit/targeted x86 /targeted x64. (These are "shimatta" programs, which must be injected by CreateRemoteThread()) (fixed in 0.6.2)
  • ResumeThread() in case of error during injection (fixed in 0.6.1)
  • Fix choco err_unmatched_machine (fixed in 0.6.1)
  • Get rid of Offending&Matching host key confirmation when proxifying git/SSH, probably using a FQDN hash function (fixed in 0.6.0)
  • Tell the user if command line is bad under Cygwin (fixed in 0.6.4)
  • Inherit exit code of direct child (fixed in 0.6.4)

Developing

Line ending, encoding and BOM

Different file types are required to have different line endings, encodings. See .gitattributes for details.

Licensing

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details.

You should have received a copy of the GNU General Public License version 2 along with this program (COPYING). If not, see http://www.gnu.org/licenses/.

Uthash

https://github.com/troydhanson/uthash

This program contains uthash as a git submodule, which is published under The 1-clause BSD License:

Copyright (c) 2008-2018, Troy D. Hanson   http://troydhanson.github.com/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are 
met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MinHook

https://github.com/TsudaKageyu/minhook

This program contains minhook as a git submodule, which is published under The 2-clause BSD License:

MinHook - The Minimalistic API Hooking Library for x64/x86
Copyright (C) 2009-2017 Tsuda Kageyu.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

proxychains-windows's People

Contributors

shunf4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxychains-windows's Issues

产品的数据配置文件损坏

(base) PS C:\Users\hp\Desktop\go> C:\Users\hp\Desktop\proxychains_0.6.8_win32_x64_debug\proxychains_win32_x64d.exe -f C:\Users\hp\Desktop\proxychains_0.6.8_win32_x64_debug\proxychains.conf go get github.com/tjfoc/gmsm/sm4
[D] 2021/05/18 22:15:03 Argv[3] = go
[D] 2021/05/18 22:15:03 Argv[4] = get
[D] 2021/05/18 22:15:03 Argv[5] = github.com/tjfoc/gmsm/sm4
[I] 2021/05/18 22:15:03 Configuration file: C:\Users\hp\Desktop\proxychains_0.6.8_win32_x64_debug\proxychains.conf
[E] 2021/05/18 22:15:03 Hosts file line 37: No delimiter between IP and hostname
Error: 这个产品的配置数据已损坏。请与技术支持人员联系。(1610)

老铁们,啥情况啊。配置文件就是直接git clone下来的,在其他电脑就能执行,为啥换了台电脑就裸了?

Issue with 32 bit program: Remote thread error: The specified module could not be found

Use this with a 32 bit program (sybase isql.exe) on Win 10 (Win64), got the error:
Remote thread error: The specified module could not be found.

As a result, the injection failed. Here is the logs:

[D] 2021/11/03 16:19:51 Argv[3] = \sybase\OCS-16_0\bin\isql.exe
[D] 2021/11/03 16:19:51 Argv[4] = -S
[D] 2021/11/03 16:19:51 Argv[5] = syb16qa
[D] 2021/11/03 16:19:51 Argv[6] = -U
[D] 2021/11/03 16:19:51 Argv[7] = esp_nfy_auth
[D] 2021/11/03 16:19:51 Argv[8] = -P
[I] 2021/11/03 16:19:51 Configuration file: \tools\proxychains.conf
[D] 2021/11/03 16:19:51 fpGetModuleHandleWX64 = 00007FFDE7A2D130
[D] 2021/11/03 16:19:51 fpGetModuleHandleWX86 = 00000000764E0E50
[D] 2021/11/03 16:19:51 fpLoadLibraryWX64 = 00007FFDE7A2FEE0
[D] 2021/11/03 16:19:51 fpLoadLibraryWX86 = 00000000764E16C0
[D] 2021/11/03 16:19:51 fpGetProcAddressX64 = 00007FFDE7A2AEC0
[D] 2021/11/03 16:19:51 fpGetProcAddressX86 = 00000000764DF550
[D] 2021/11/03 16:19:51 fpFreeLibraryX64 = 00007FFDE7A2C7D0
[D] 2021/11/03 16:19:51 fpFreeLibraryX86 = 00000000764E0AE0
[D] 2021/11/03 16:19:51 fpGetLastErrorX64 = 00007FFDE7A25BF0
[D] 2021/11/03 16:19:51 fpGetLastErrorX86 = 00000000764DE010
[D] 2021/11/03 16:19:51 fpOutputDebugStringAX64 = 00007FFDE7A342D0
[D] 2021/11/03 16:19:51 fpOutputDebugStringAX86 = 00000000764D9350
[D] 2021/11/03 16:19:51 fpGetCurrentProcessIdX64 = 00007FFDE7A34890
[D] 2021/11/03 16:19:51 fpGetCurrentProcessIdX86 = 00000000764E2E90
[D] 2021/11/03 16:19:51 fpwsprintfAX64 = 00007FFDE75D7890
[D] 2021/11/03 16:19:51 fpwsprintfAX86 = 000000007694ACA0
[D] 2021/11/03 16:19:51 fpSleepX64 = 00007FFDE7A2ADA0
[D] 2021/11/03 16:19:51 fpSleepX86 = 00000000764E0F00
[D] 2021/11/03 16:19:51 fpExitThreadX64 = 00007FFDE94645F0
[D] 2021/11/03 16:19:51 fpExitThreadX86 = 00000000771FB4B0
[D] 2021/11/03 16:19:51 fpReleaseSemaphoreX64 = 00007FFDE7A34A60
[D] 2021/11/03 16:19:51 fpReleaseSemaphoreX86 = 00000000764E3060
[D] 2021/11/03 16:19:51 fpCloseHandleX64 = 00007FFDE7A348E0
[D] 2021/11/03 16:19:51 fpCloseHandleX86 = 00000000764E2EE0
[D] 2021/11/03 16:19:51 fpWaitForSingleObjectX64 = 00007FFDE7A34AD0
[D] 2021/11/03 16:19:51 fpWaitForSingleObjectX86 = 00000000764E30D0
[D] 2021/11/03 16:19:51 Configuration fixed part size: 9024
[D] 2021/11/03 16:19:51 Configuration total size: 14760
[D] 2021/11/03 16:19:51 MasterProcessId: 21432
[D] 2021/11/03 16:19:51 LogLevel: 600
[D] 2021/11/03 16:19:51 IpcPipeName: \.\pipe\proxychains_21432_132804443914015147
[D] 2021/11/03 16:19:51 ConfigPath: \tools\proxychains.conf
[D] 2021/11/03 16:19:51 HookDllPath: C:\git\proxychains-windows\win32_output\proxychains_hook_x64d.dll
[D] 2021/11/03 16:19:51 MinHookDllPath: MinHook.x64.dll
[D] 2021/11/03 16:19:51 HostsFilePath: C:\WINDOWS\system32\drivers\etc\hosts
[D] 2021/11/03 16:19:51 CommandLine: C:\sybase\OCS-16_0\bin\isql.exe -S syb16qa -U esp_nfy_auth -P
[D] 2021/11/03 16:19:51 FakeIpv4Range: 224.0.0.0/8
[D] 2021/11/03 16:19:51 FakeIpv6Range: 250d::/16
[D] 2021/11/03 16:19:51 ProxyConnectionTimeoutMillisecond: 3000
[D] 2021/11/03 16:19:51 ProxyHandshakeTimeoutMillisecond: 5000
[D] 2021/11/03 16:19:51 WillUseFakeIpAsRemoteDns: 1
[D] 2021/11/03 16:19:51 WillUseUdpAssociateAsRemoteDns: 0
[D] 2021/11/03 16:19:51 WillDeleteFakeIpAfterChildProcessExits: 1
[D] 2021/11/03 16:19:51 WillUseFakeIpWhenHostnameNotMatched: 1
[D] 2021/11/03 16:19:51 WillMapResolvedIpToHost: 0
[D] 2021/11/03 16:19:51 WillLookupForHostByResolvedIp: 0
[D] 2021/11/03 16:19:51 WillResolveLocallyIfMatchHosts: 1
[D] 2021/11/03 16:19:51 WillFirstTunnelUseIpv4: 1
[D] 2021/11/03 16:19:51 WillFirstTunnelUseIpv6: 0
[D] 2021/11/03 16:19:51 WillGenFakeIpUsingHashedHostname: 1
[D] 2021/11/03 16:19:51 DefaultTarget: PROXY
[D] 2021/11/03 16:19:51 sizeof(PROXYCHAINS_CONFIG): 9024
[D] 2021/11/03 16:19:51
[D] 2021/11/03 16:19:51 [ProxyList] Offset: 9024, sizeof(): 1164, Length: 1
[D] 2021/11/03 16:19:51 [0] localhost:9050(516) Ws2_32_Socks5Connect Ws2_32_Socks5Handshake
[D] 2021/11/03 16:19:51
[D] 2021/11/03 16:19:51 [RuleList] Offset: 10188, sizeof(): 528, Length: 5
[D] 2021/11/03 16:19:51 [0] <IP_CIDR> 127.0.0.0/8 -> DIRECT
[D] 2021/11/03 16:19:51 [1] <IP_CIDR> 10.0.0.0/8 -> DIRECT
[D] 2021/11/03 16:19:51 [2] <IP_CIDR> 172.16.0.0/12 -> DIRECT
[D] 2021/11/03 16:19:51 [3] <IP_CIDR> 192.168.0.0/16 -> DIRECT
[D] 2021/11/03 16:19:51 [4] <IP_CIDR> fe80::/8 -> DIRECT
[D] 2021/11/03 16:19:51
[D] 2021/11/03 16:19:51 [HostsEntry] Offset: 12828, sizeof(): 644, Length: 3
[D] 2021/11/03 16:19:51 [0] host.docker.internal 192.168.68.104
[D] 2021/11/03 16:19:51 [1] gateway.docker.internal 192.168.68.104
[D] 2021/11/03 16:19:51 [2] kubernetes.docker.internal 127.0.0.1
[D] 2021/11/03 16:19:51
[D] 2021/11/03 16:19:51 (Deprecated)RemoteFuncX64 Offset: 14760, Size: 0
[D] 2021/11/03 16:19:51 (Deprecated)RemoteFuncX86 Offset: 14760, Size: 0
[D] 2021/11/03 16:19:51 PXCH_CONFIG_EXTRA_SIZE_G: 5736
[V] 2021/11/03 16:19:51 Hooked CreateProcessW from 00007FFDE7A2CB60 to 00007FFDB8572D20, return = 0
[D] 2021/11/03 16:19:51 Main Program Hooked!
[D] 2021/11/03 16:19:51 IPC Server Tid: 20692
[V] 2021/11/03 16:19:51 Waiting for g_hIpcServerSemaphore.
[V] 2021/11/03 16:19:51 Ipc Server Initializing...
[V] 2021/11/03 16:19:51 Ipc Server Initializing Event 0
[V] 2021/11/03 16:19:51 Ipc Server Initializing Event 1
[V] 2021/11/03 16:19:51 Ipc Server Initializing Event 2
[V] 2021/11/03 16:19:51 Ipc Server Initializing Event 3
[D] 2021/11/03 16:19:51 [IPCALL] Waiting for clients...
[V] 2021/11/03 16:19:51 ServerLoop: Signaling semaphore...
[V] 2021/11/03 16:19:51 ServerLoop: Signaled semaphore.
[D] 2021/11/03 16:19:51 szCommandLine: C:\sybase\OCS-16_0\bin\isql.exe -S syb16qa -U esp_nfy_auth -P
[D] 2021/11/03 16:19:51 (In CreateProcessW) g_pRemoteData->dwDebugDepth = 4294967295
[D] 2021/11/03 16:19:51 CreateProcessW: (null), C:\sybase\OCS-16_0\bin\isql.exe -S syb16qa -U esp_nfy_auth -P, lpProcessAttributes: 0, lpThreadAttributes: 0, bInheritHandles: 0, dwCreationFlags: 0, lpCurrentDirectory: (null); Ret: 1 Child winpid 2852, tid 11632
[V] 2021/11/03 16:19:51 CreateProcessW: Copied.
[V] 2021/11/03 16:19:51 CreateProcessW: After jmp to err_orig.
[V] 2021/11/03 16:19:51 CreateProcessW: Before InjectTargetProcess.
[D] 2021/11/03 16:19:51 Child is an X86(Win32) process (0 1).
[V] 2021/11/03 16:19:51 CreateProcessW: Entering InjectTargetProcess. 15460
[V] 2021/11/03 16:19:51 CreateProcessW: Before CopyMemory. 0
[V] 2021/11/03 16:19:51 CreateProcessW: After CopyMemory. 0
[V] 2021/11/03 16:19:51 CreateProcessW: After remoteData assignment. 0
[D] 2021/11/03 16:19:51 C:\git\proxychains-windows\win32_output\proxychains_hook_x64d.dll
[V] 2021/11/03 16:19:51 CreateProcessW: After StringCchCopy. 0
[V] 2021/11/03 16:19:51 CreateProcessW: Before VirtualAllocEx. 832
[V] 2021/11/03 16:19:51 CreateProcessW: After VirtualAllocEx. 00000000009F0000
[V] 2021/11/03 16:19:51 RemoteFuncCode bin data: 55 8b ec 83 ec 10 8b 45 08 89 45 fc 8b 4d fc 8b
[V] 2021/11/03 16:19:51 EntryDetour bin data: 55 81 ec 00 04 00 00 8d ac 24 00 02 00 00 c7 45
[V] 2021/11/03 16:19:51 CreateProcessW: After Write Code. 1328
[D] 2021/11/03 16:19:51 pTargetPeb: 0000000000B82000, TargetCtx.Rax - Rdx: 0000000000000000 0000000000000000 000000000056128E 0000000000B83000, (Invalid)TargetWow64Ctx.Eax - Edx: 0000000000000000 0000000000000000 0000000000000000 0000000000000000.
[D] 2021/11/03 16:19:51 TargetWow64CtxFromTeb.Eax - Edx: 000000000056128E 0000000000B83000 0000000000000000 0000000000000000.
[D] 2021/11/03 16:19:51 pTargetWow64Peb: 0000000000B83000
[D] 2021/11/03 16:19:51 pTargetOriginalEntry: 000000000056128E
[V] 2021/11/03 16:19:51 CreateProcessW: After Write Data. 4
[V] 2021/11/03 16:19:51 Waiting for hSemaphore.
[V] 2021/11/03 16:19:51 CreateProcessW: After RemoteCopyExecute. 0
[W] 2021/11/03 16:19:51 Error: Remote thread error: The specified module could not be found.(126)!
[V] 2021/11/03 16:19:51 CreateProcessW: Injected. 126
[E] 2021/11/03 16:19:51 Injecting WINPID 2852 Error: The specified module could not be found.(126)
[I] 2021/11/03 16:19:52 No child process registered. Injection might not have succeeded.

代理 deno 卡住

powershell 中 运行 proxychains deno install -A --unstable -n trex https://deno.land/x/trex/cli.ts,一直卡住不动。v2ray的控制台中显示已经收到 proxy 了,但似乎哪里断连了。

配置只改了最后一行:

[ProxyList]
socks5 127.0.0.1 10808

代理本身没有问题,不用 proxychains,直接换用 http 的env 配置之后,很快就跑过了。

$Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"

Line 1 too long that it exceeds the buffer size

Windows 10 2004

(base) PS D:\proxychains_0.6.4_win32_x64> .\proxychains_win32_x64.exe tcping baidu.com
[E] 2020/04/11 07:48:21 Line 1 too long that it exceeds the buffer size
[E] 2020/04/11 07:48:21 Error reading hosts file: The data area passed to a system call is too small.(122)
Error: The data area passed to a system call is too small.(122)

建议能将软件提交到choco的包管理器

在Linux下习惯使用proxychains,在Windows下想使用,一搜还真有,还确实挺好用.
Linux下习惯使用包管理器来安装程序.
Windows下比较好用的包管理器,choco.
希望proxychains for windows也能提交到包管理器.以后安装的时候就可以choco install proxychains 来安装了.

PXCH_CONFIG_EXTRA_SIZE error

PXCH_CONFIG_EXTRA_SIZE error!

The following code is modified by me

#define PXCH_CONFIG_EXTRA_SIZE(pPxchConfig) PXCH_CONFIG_EXTRA_SIZE_BY_N((pPxchConfig)->dwProxyNum, (pPxchConfig)->dwRuleNum, (pPxchConfig)->dwHostsEntryNum)

For more than one proxy it doesn't work

My primary proxy is psiphon, second one is a private proxy
[ProxyList]
socks5 localhost 1080
socks5 54.38.195.161 56299

proxychains_win32_x64.exe "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
.
.
.
[PID15372] [I] 2020/04/27 08:47:24 <> localhost:1080
[PID15372] [W] 2020/04/27 08:47:25 Socks5 data format invalid: server disallows this connection
[PID15372] [W] 2020/04/27 08:47:25 Ws2_32.dll connect(2440 224.8.107.83:443 16) -> www.google.com:443 PROXY ret: -1, wsa last error: Access is denied.(5)
[PID15372] [W] 2020/04/27 08:47:25 recv() error: An existing connection was forcibly closed by the remote host.(10054)
[PID15372] [W] 2020/04/27 08:47:25 Ws2_32.dll connect(2468 [2001:4860:4860::8888]:53 28) PROXY ret: -1, wsa last error: An existing connection was forcibly closed by the remote host.(10054)
[PID15372] [I] 2020/04/27 08:47:25 <> localhost:1080
[PID15372] [W] 2020/04/27 08:47:25 Socks5 data format invalid: server disallows this connection
[PID15372] [W] 2020/04/27 08:47:25 Ws2_32.dll connect(2476 224.28.48.248:443 16) -> api.infura.io:443 PROXY ret: -1, wsa last error: Access is denied.(5)

Any suppot for .NET program?

I use this to proxy my osu!lazer.exe game and it is a game written in C# on .NET platform. When I run it inside proxychains it gives me the output:

[W] 2020/10/13 18:05:53 Warning: Output from X86 Helper executable is in a wrong format. In this case proxychains.exe will not inject X86 descendant processes.
[W] 2020/10/13 18:05:53 Child is an X86(Win32) process (0 1); function address missing: won't inject
[I] 2020/10/13 18:05:53 No child process registered. Injection might not have succeeded.

And the main game doesn't start. Can anyone give me some help on this?

配置文件

配置文件为啥不默认放在可执行文件同目录,然后默认加载,不然麻烦的,还要弄个环境变量。修改的时候还要再找配置文件。

An error about proxy for PowerShell function: Invoke-WebRequest

Powershell

Windows Powershell 5.1.19041.610 (Windows 10 built-in):

$ proxychains powershell -Command 'Invoke-WebRequest example.org'
[PID15676] [I] 2020/12/23 20:26:05 <> localhost:7890
[PID15676] [I] 2020/12/23 20:26:05 Ws2_32.dll connect(2772 224.134.186.179:80 16) -> example.org:80 PROXY


StatusCode        : 200
StatusDescription : OK
Content           : <!doctype html>
                    <html>
                    <head>
                        <title>Example Domain</title>

                        <meta charset="utf-8" />
                        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
                        <meta name="viewport" conten...
RawContent        : HTTP/1.1 200 OK
                    Age: 534623
                    Vary: Accept-Encoding
                    X-Cache: HIT
                    Accept-Ranges: bytes
                    Content-Length: 1256
                    Cache-Control: max-age=604800
                    Content-Type: text/html; charset=UTF-8
                    Date: Wed, 23 Dec ...
Forms             : {}
Headers           : {[Age, 534623], [Vary, Accept-Encoding], [X-Cache, HIT], [Accept-Ranges, bytes]...}
Images            : {}
InputFields       : {}
Links             : {@{innerHTML=More information...; innerText=More information...; outerHTML=<A
                    href="https://www.iana.org/domains/example">More information...</A>; outerText=More
                    information...; tagName=A; href=https://www.iana.org/domains/example}}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 1256



[I] 2020/12/23 20:26:06 All Windows descendant process exited.
[I] 2020/12/23 20:26:06 Master exiting

Powershell Core 7.1.0 (same results for x64/x86 versions) :

$ proxychains pwsh -Command 'Invoke-WebRequest example.org'
[PID 3600] [W] 2020/12/23 20:26:55 connect() error: No connection could be made because the target machine actively refused it.(10061)
[PID 3600] [W] 2020/12/23 20:26:55 Mswsock.dll (FP)ConnectEx(2208 [::ffff:93.184.216.34]:80 28) PROXY ret: 0, wsa last error: No connection could be made because the target machine actively refused it.(10061)
Invoke-WebRequest: No connection could be made because the target machine actively refused it.
[I] 2020/12/23 20:26:55 All Windows descendant process exited.
[I] 2020/12/23 20:26:55 Master exiting

What caused PowerShell 7.1 to get the wrong IP format?
The proxy server does not support IPv6.
IPv6 has been disabled in the network adapter.

Invoke-WebRequest example.org -Proxy $PROXY_URI is work well.

DNS resolving

Can't seems to make DNS resolving work.

Trying to use proxychains-windows to run mRemoteNG which currently does not support proxying RDP traffic (mRemoteNG/mRemoteNG#420).

While connecting to an IP address works perfectly, using DNS (which can only be resolved on proxy server, and on the PC running mRemoteNG) doesn't work.

Attached DEBUG verbose output (with a little obscuration)
proxychains_debug.log

客户端WSAAsyncSelect函数能否支撑?

客户端通过WSAAsyncSelect函数异步的监听socket的状态,当WSAGETSELECTEVENT为FD_CONNECT时,发送业务数据。此时proxychains应该连接socks5服务器完毕,但是没有连接真实服务器,此时发送数据应该会失败的吧?

proxy配置不生效

[ProxyList]
socks5	127.0.0.1	1080

配置了IP地址和端口,但是使用的时候没有用我指定的端口

proxychains pipenv install
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environmen
t and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
           Building requirements...
Resolving dependencies...
[  ==] Locking...[PID34544] [I] 2021/08/16 16:11:38 Ws2_32.dll connect(980 127.0.0.1:8889 16) DIRECT
[=== ] Locking...[PID34544] [I] 2021/08/16 16:11:59 Ws2_32.dll connect(352 127.0.0.1:8889 16) DIRECT

Failing on a specific executable... any solution?

Proxychains is failing to work properly on a windows version of an executable. The linux version using the linux version of proxychains works well. The output is the following:

[PID 5636] [I] 2022/11/15 10:24:35 <> 127.0.0.1:9050
[PID 5636] [I] 2022/11/15 10:24:35 Mswsock.dll (FP)ConnectEx(624 172.67.137.217:443 16) PROXY

At this point the program hangs and nothing seems to happen. The proxy config is working with other software, so the proxy config is correct. In addition, the software works without using proxychains, so it is not an issue with the software. This leads me to believe the interaction between proxychains and the software is what is causing the issue.

Software Being Tested:

Any thoughts on why proxychains does not work with this executable?

HTTP proxy?

Hi

Why you only support SOCKS5 proxy?

Is it not possible to use a HTTP/HTTPS proxy?

cygwin64上提示 No configuration file found

proxychains_0.6.8_cygwin_x64.zip
配置文件
$HOME/.proxychains/proxychains.conf
/etc/proxychains.conf
proxychains_0.6.8_win32_x64.zip
配置文件
%USERPROFILE%\.proxychains\proxychains.conf
都试过,一样的提示
image
powershell没问题
image

Cannot proxify electron apps?

Connection to XMPP Bosh server in "Conversation Desktop" (an electron app) is not captured when it is run by proxychains-windows.

Further investigation needed.

proxychains_win32_x64d.exe - what does the d mean?

Until this project, I have never come across the ...x64d.exe and ...x86d.exe filename forms. Without the d before the extension, yes, but not with the d.

[Yes, it is clear that the file(s) can be renamed, but that is not the question.]

What does the 'd' stand for, and could an article in the wiki be added to so explain, please?

运行不了,报错

λ proxychains curl google.com
[W] 2020/05/10 21:11:37 SetThreadContext() Failed: 句柄无效。(6)
[E] 2020/05/10 21:11:37 Injecting WINPID 13308 Error: 句柄无效。(6)
[I] 2020/05/10 21:11:37 No child process registered. Injection might not have succeeded.
curl: (56) Recv failure: Connection was reset
[I] 2020/05/10 21:11:37 Master exiting

mcafee 杀掉了

"proxychains_hook_x86.dll" is deleted by McAfee. Any workaround, please?

Cygwin child process exited ABNORMALLY(0)

Hello,

An error occurred when I tried below command in this environment:

$ proxychains curl google.com
> [I] 2020/09/22 13:53:35 posix_spawnp ret: 0; CYGPID: 4061
    [I] 2020/09/22 13:53:35 Cygwin child process pid 4061 exited ABNORMALLY(0).

Environment:

  • Windows Terminal 1.2.2381.0 With Zsh
  • Proxychains.exe Cygwin 64-bit Release 0.6.8
  • curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL

Proxychains + long command with args = Error when parsing args: Insufficient Buffer

C:/proxychains_0.6.8_win32_x64/proxychains_win32_x64.exe -q -f C:/proxychains_0.6.8_win32_x64/proxychains.conf wget -c --progress=bar:force:noscroll --secure-protocol=TLSv1_2 -e robots=off --user-agent="Mozilla/5.0" --no-cookies --retry-connrefused --waitretry=10 --tries=100 'https://example.com' -O /dev/null --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue --arbitraryflag=arbitraryvalue

Yes I am aware that the above command is not valid in wget.

I often have to use much longer curl commands(including several header fields) which is where I originally encountered this problem. But I can't paste that here for privacy reasons. Hence the above command.

Thanks for your work. It works great, for shorter commands.

nice trojan kid

trojan detected
deject1
deject2
deject3

hi, this program might contact a virus, i runned the 32bit version and my pc got fucked :D. BTW pretty shitty code for the virus...

"time to get fucked, fuck it lets go nuts" ::DD cringe shit 11 yo kid

能否增加windows 11 arm64的支持

我在windows 11 arm64上安装了vs2022的预览版本
编译x86 x64都没问题
arm64有一个寄存器的问题

//-------------------------------------------------------------------------
static void ProcessThreadIPs(HANDLE hThread, UINT pos, UINT action)
{
    // If the thread suspended in the overwritten area,
    // move IP to the proper address.

    CONTEXT c;
#if defined(_M_X64)
    DWORD64 *pIP = &c.Rip;
#elif defined(_M_IX86)
    int a = &c.Eip;
#else
    DWORD   *pIP = &c.; // arm64不知道有啥寄存器
#endif
    UINT count;
typedef struct DECLSPEC_ALIGN(16) DECLSPEC_NOINITALL _ARM64_NT_CONTEXT {

    //
    // Control flags.
    //

    /* +0x000 */ DWORD ContextFlags;

    //
    // Integer registers
    //

    /* +0x004 */ DWORD Cpsr;       // NZVF + DAIF + CurrentEL + SPSel
    /* +0x008 */ union {
                    struct {
                        DWORD64 X0;
                        DWORD64 X1;
                        DWORD64 X2;
                        DWORD64 X3;
                        DWORD64 X4;
                        DWORD64 X5;
                        DWORD64 X6;
                        DWORD64 X7;
                        DWORD64 X8;
                        DWORD64 X9;
                        DWORD64 X10;
                        DWORD64 X11;
                        DWORD64 X12;
                        DWORD64 X13;
                        DWORD64 X14;
                        DWORD64 X15;
                        DWORD64 X16;
                        DWORD64 X17;
                        DWORD64 X18;
                        DWORD64 X19;
                        DWORD64 X20;
                        DWORD64 X21;
                        DWORD64 X22;
                        DWORD64 X23;
                        DWORD64 X24;
                        DWORD64 X25;
                        DWORD64 X26;
                        DWORD64 X27;
                        DWORD64 X28;
    /* +0x0f0 */        DWORD64 Fp;
    /* +0x0f8 */        DWORD64 Lr;
                    } DUMMYSTRUCTNAME;
                    DWORD64 X[31];
                 } DUMMYUNIONNAME;
    /* +0x100 */ DWORD64 Sp;
    /* +0x108 */ DWORD64 Pc;

    //
    // Floating Point/NEON Registers
    //

    /* +0x110 */ ARM64_NT_NEON128 V[32];
    /* +0x310 */ DWORD Fpcr;
    /* +0x314 */ DWORD Fpsr;

    //
    // Debug registers
    //

    /* +0x318 */ DWORD Bcr[ARM64_MAX_BREAKPOINTS];
    /* +0x338 */ DWORD64 Bvr[ARM64_MAX_BREAKPOINTS];
    /* +0x378 */ DWORD Wcr[ARM64_

Update README.md with real (Win 10) %s% please.

Could https://github.com/shunf4/proxychains-windows/blob/master/README.md please be updated to add / change:

(SYSCONFDIR)/proxychains.conf (Cygwin) or (User roaming dir)\Proxychains\proxychains.conf (Win32)
/etc/proxychains.conf (Cygwin) or (Global programdata dir)\Proxychains\proxychains.conf (Win32)

to

(SYSCONFDIR)/proxychains.conf (Cygwin) or %APPDATA%\Proxychains\proxychains.conf (Win32)
/etc/proxychains.conf (Cygwin) or %ProgramData%\Proxychains\proxychains.conf (Win32)

if appropriate, or a wiki article created to list what "(User roaming dir)" and "(Global programdata dir)" are? These are non-standard names, and taking guesswork out of things is always good.

Can't get to use it on Cygwin

Hello! I hope you're doing great!
Here's what I did:

mv proxychains.conf /etc/
mv proxychains_cygwin_x64.exe /usr/bin/proxychains.exe
mv proxychains_helper_cygwin_x64.exe /usr/bin/
mv cygproxychains_hook_x64.dll /usr/bin/

chmod 755 /usr/bin/proxychains.exe
chmod 755 /usr/bin/cygproxychains_hook_x64.dll
chmod 755 /usr/bin/proxychains_helper_cygwin_x64.exe
chmod 644 /etc/proxychains.conf

setfacl -b /usr/bin/proxychains.exe
setfacl -b /usr/bin/cygproxychains_hook_x64.dll
setfacl -b /usr/bin/proxychains_helper_cygwin_x64.exe
setfacl -b /etc/proxychains.conf

ls -al /usr/bin/*proxychains*
ls -al /etc/proxychains.conf

But I get this error no matter what:

[E] 2023/01/17 10:02:00 Error reading hosts file: The system cannot read from the specified device.(30)
Error: The system cannot read from the specified device.(30)

I tried running it as Admin as well, but to no avail.
How can I get this to work?
Thanks very much!

.conf - include file directorive?

Is there an include file directive possible for the proxychains.conf file?

If not, could there be? And in either case, could a wiki article be created to so explain, please?

Further, could a 'variable' be permitted to be used in such a line, to represent the directory within which the .exe is located?

Then one could put a

fileinclude %exedir%\proxychains.conf

type of line in a default location, so .exe and .conf can be kept together.

Further, one could also create different lists of proxies, perhaps programmatically, then have the resulting list of proxies auto included in the .conf file by virtue of the 'fileinclude' directive.

possibility to proxify a UWP(ms-store) app?

So far I've tried:
proxychains_win32_x64 cmd /c start [/wait] netflix:
proxychains_win32_x64 explorer netflix:
this method works for win32 applications such as chrome, msedge

but it is not working for ms-store apps, and I got these message while the app is still running:

[I] 2021/07/12 23:48:33 All Windows descendant process exited.
[I] 2021/07/12 23:48:33 Master exiting

It seems the UWP app is hookable (stackoverflow:inject-a-dll-file-to-uwp) but the hooking chain is broken between win32 executable & UWP sandbox container, as the UWP apps have different launch mechanisms.

Proxychains + aria2 torrent/magnet link = Segmentation Fault.

C:/proxychains_0.6.8_win32_x64/proxychains_win32_x64.exe -q -f C:/proxychains_0.6.8_win32_x64/proxychains.conf aria2c -c -R --file-allocation=none --summary-interval=0 --follow-torrent=false --bt-save-metadata=true --bt-force-encryption=true -V 'magnet:?xt=urn:btih:9DCCED4E3FC49753888F59D559CAD9EA9DD99EA5&tr=udp%3A%2F%2Ftracker.bitsearch.to%3A1337%2Fannounce&tr=udp%3A%2F%2Fwww.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.breizh.pm%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2920%2Fannounce&dn=%5Bbitsearch.to%5D+kubuntu-22.10-desktop-amd64.iso'

Segfaults Immediately.

The same for torrent files as well.

Also if the magnet URL is really long, then I get an "Error when parsing args: Insufficient Buffer" . See #45

Thanks for your work @shunf4 !

好像代理不了,帮我看看啥原因?

v2rayn sock5 port 10808

[ProxyList]
socks5 localhost 10808

run:
PS F:\proxychains_0.6.8_win32_x64> F:\proxychains_0.6.8_win32_x64\proxychains_win32_x64.exe -f F:\proxychains_0.6.8_win32_x64\proxychains.conf D:\msys64\mingw64\bin\curl.exe ip.sb
[PID25924] [I] 2020/11/13 19:01:51 Ws2_32.dll connect(476 127.0.0.1:1080 16) DIRECT
curl: (7) Failed to connect to 127.0.0.1 port 1080: Connection refused
[I] 2020/11/13 19:01:54 All Windows descendant process exited.
[I] 2020/11/13 19:01:54 Master exiting
PS F:\proxychains_0.6.8_win32_x64>

why connect(476 127.0.0.1:1080 ???

兄台帮忙看下咋回事儿

在cmd输入proxychains.exe curl whatismyip.akamai.com 后出现下面错误
[E] 2020/11/17 15:30:18 Line 40 too long that it exceeds the buffer size
[E] 2020/11/17 15:30:18 Error reading hosts file: 传递给系统调用的数据区域太小。(122)
Error: 传递给系统调用的数据区域太小。(122)

不知道怎么解决

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.