shunf4 / proxychains-windows

Windows and Cygwin port of proxychains, based on MinHook and DLL Injection
GNU General Public License v2.0
967 stars 117 forks source link

cygwin64上提示 No configuration file found #21

Closed zhj9709 closed 3 years ago

zhj9709 commented 3 years ago

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

shunf4 commented 3 years ago

~这是因为你用了 Win32 版本的 proxychains。~

~Proxychains.exe Win32 64-bit Release 0.6.8 - proxifier for Win32 and Cygwin.~

~请在 Cygwin 平台上使用 Cygwin 版本的 proxychains。~

shunf4 commented 3 years ago

ls 确认下文件是否存在,截个图?

shunf4 commented 3 years ago

Cygwin 运行于什么终端模拟器中?

切换到 Mintty 或者 Conhost 再试试。

zhj9709 commented 3 years ago

ls 确认下文件是否存在,截个图?

image

zhj9709 commented 3 years ago

Cygwin 运行于什么终端模拟器中?

powershell,Cygwin64 Terminal 都一样

shunf4 commented 3 years ago

错误提示变成 Error reading hosts file 了。

尝试在 Cygwin 下读取你所使用的 hosts 文件,如 cat /etc/hosts 看能否正常读取。

zhj9709 commented 3 years ago

错误提示变成 Error reading hosts file 了。

尝试在 Cygwin 下读取你所使用的 hosts 文件,如 cat /etc/hosts 看能否正常读取。

hosts是一个软链接,链接到windows的hosts文件,把这个删了,新建一个hosts,就是下面的提示 image

zhj9709 commented 3 years ago

image

shunf4 commented 3 years ago

hosts是一个软链接,链接到windows的hosts文件

这属于正常情况,使用 proxychains 应该不会出问题。Windows 的 hosts 文件是否被修改过(文件是否存在,权限是否不正常)?尝试用 Cygwin 读取下看看。

下面的提示

这个比较奇怪,可能是 hook 出问题了。

尝试下关闭系统中所有可能影响到 hook 的软件(安全软件、调试工具、Proxifier 等)再试一次。还是不行的话请用 Debug 版本加上 -lD 选项运行后把日志发在这里。

shunf4 commented 3 years ago

另外注意,你应该只将 Proxychains for Cygwin 应用于 Cygwin 程序(位于 /usr/bin 下)而非 Win32 程序。

zhj9709 commented 3 years ago
$ proxychains -lD /usr/bin/curl myip.ipip.net
[I] 2021/02/18 16:33:15 Configuration file: /etc/proxychains.conf
[D] 2021/02/18 16:33:15 fpGetModuleHandleWX64 = 0x7ffbf7f0d130
[D] 2021/02/18 16:33:15 fpGetModuleHandleWX86 = 0x0
[D] 2021/02/18 16:33:15 fpLoadLibraryWX64 = 0x7ffbf7f0fee0
[D] 2021/02/18 16:33:15 fpLoadLibraryWX86 = 0x0
[D] 2021/02/18 16:33:15 fpGetProcAddressX64 = 0x7ffbf7f0aec0
[D] 2021/02/18 16:33:15 fpGetProcAddressX86 = 0x0
[D] 2021/02/18 16:33:15 fpFreeLibraryX64 = 0x7ffbf7f0c7d0
[D] 2021/02/18 16:33:15 fpFreeLibraryX86 = 0x0
[D] 2021/02/18 16:33:15 fpGetLastErrorX64 = 0x7ffbf7f05bf0
[D] 2021/02/18 16:33:15 fpGetLastErrorX86 = 0x0
[D] 2021/02/18 16:33:15 fpOutputDebugStringAX64 = 0x7ffbf7f142d0
[D] 2021/02/18 16:33:15 fpOutputDebugStringAX86 = 0x0
[D] 2021/02/18 16:33:15 fpGetCurrentProcessIdX64 = 0x7ffbf7f14890
[D] 2021/02/18 16:33:15 fpGetCurrentProcessIdX86 = 0x0
[D] 2021/02/18 16:33:15 fpwsprintfAX64 = 0x7ffbf70b73d0
[D] 2021/02/18 16:33:15 fpwsprintfAX86 = 0x0
[D] 2021/02/18 16:33:15 fpSleepX64 = 0x7ffbf7f0ada0
[D] 2021/02/18 16:33:15 fpSleepX86 = 0x0
[D] 2021/02/18 16:33:15 fpExitThreadX64 = 0x7ffbf865d270
[D] 2021/02/18 16:33:15 fpExitThreadX86 = 0x0
[D] 2021/02/18 16:33:15 fpReleaseSemaphoreX64 = 0x7ffbf7f14a60
[D] 2021/02/18 16:33:15 fpReleaseSemaphoreX86 = 0x0
[D] 2021/02/18 16:33:15 fpCloseHandleX64 = 0x7ffbf7f148e0
[D] 2021/02/18 16:33:15 fpCloseHandleX86 = 0x0
[D] 2021/02/18 16:33:15 fpWaitForSingleObjectX64 = 0x7ffbf7f14ad0
[D] 2021/02/18 16:33:15 fpWaitForSingleObjectX86 = 0x0
[D] 2021/02/18 16:33:15 Configuration fixed part size: 9024
[D] 2021/02/18 16:33:15 Configuration total size: 12828
[D] 2021/02/18 16:33:15 MasterProcessId: 24256
[D] 2021/02/18 16:33:15 LogLevel: 500
[D] 2021/02/18 16:33:15 IpcPipeName: \\.\pipe\proxychains_24256_3013089982
[D] 2021/02/18 16:33:15 ConfigPath: /etc/proxychains.conf
[D] 2021/02/18 16:33:15 HookDllPath: D:\ProgramData\cygwin64\bin\cygproxychains_hook_x64d.dll
[D] 2021/02/18 16:33:15 MinHookDllPath: MinHook.x64.dll
[D] 2021/02/18 16:33:15 HostsFilePath: /etc/hosts
[D] 2021/02/18 16:33:15 CommandLine:
[D] 2021/02/18 16:33:15 FakeIpv4Range: 224.0.0.0/8
[D] 2021/02/18 16:33:15 FakeIpv6Range: 250d::/16
[D] 2021/02/18 16:33:15 ProxyConnectionTimeoutMillisecond: 3000
[D] 2021/02/18 16:33:15 ProxyHandshakeTimeoutMillisecond: 5000
[D] 2021/02/18 16:33:15 WillUseFakeIpAsRemoteDns: 1
[D] 2021/02/18 16:33:15 WillUseUdpAssociateAsRemoteDns: 0
[D] 2021/02/18 16:33:15 WillDeleteFakeIpAfterChildProcessExits: 1
[D] 2021/02/18 16:33:15 WillUseFakeIpWhenHostnameNotMatched: 1
[D] 2021/02/18 16:33:15 WillMapResolvedIpToHost: 0
[D] 2021/02/18 16:33:15 WillLookupForHostByResolvedIp: 0
[D] 2021/02/18 16:33:15 WillResolveLocallyIfMatchHosts: 1
[D] 2021/02/18 16:33:15 WillFirstTunnelUseIpv4: 1
[D] 2021/02/18 16:33:15 WillFirstTunnelUseIpv6: 0
[D] 2021/02/18 16:33:15 WillGenFakeIpUsingHashedHostname: 1
[D] 2021/02/18 16:33:15 DefaultTarget: PROXY
[D] 2021/02/18 16:33:15 sizeof(PROXYCHAINS_CONFIG): 9024
[D] 2021/02/18 16:33:15
[D] 2021/02/18 16:33:15 [ProxyList] Offset: 9024, sizeof(): 1164, Length: 1
[D] 2021/02/18 16:33:15 [0] <SOCKS5> localhost:10080(516) Ws2_32_Socks5Connect Ws2_32_Socks5Handshake
[D] 2021/02/18 16:33:15
[D] 2021/02/18 16:33:15 [RuleList] Offset: 10188, sizeof(): 528, Length: 5
[D] 2021/02/18 16:33:15 [0] <IP_CIDR> 127.0.0.0/8 -> DIRECT
[D] 2021/02/18 16:33:15 [1] <IP_CIDR> 10.0.0.0/8 -> DIRECT
[D] 2021/02/18 16:33:15 [2] <IP_CIDR> 172.16.0.0/12 -> DIRECT
[D] 2021/02/18 16:33:15 [3] <IP_CIDR> 192.168.0.0/16 -> DIRECT
[D] 2021/02/18 16:33:15 [4] <IP_CIDR> fe80::/8 -> DIRECT
[D] 2021/02/18 16:33:15
[D] 2021/02/18 16:33:15 [HostsEntry] Offset: 12828, sizeof(): 644, Length: 0
[D] 2021/02/18 16:33:15
[D] 2021/02/18 16:33:15 (Deprecated)RemoteFuncX64 Offset: 12828, Size: 0
[D] 2021/02/18 16:33:15 (Deprecated)RemoteFuncX86 Offset: 12828, Size: 0
[D] 2021/02/18 16:33:15 PXCH_CONFIG_EXTRA_SIZE_G: 3804
[D] 2021/02/18 16:33:15 Main Program Hooked!
[D] 2021/02/18 16:33:15 IPC Server Tid: 9564
[D] 2021/02/18 16:33:15 [IPCALL] Waiting for clients...
[D] 2021/02/18 16:33:15 iCommandStart: 2
[D] 2021/02/18 16:33:15 (In CreateProcessW) g_pRemoteData->dwDebugDepth = 4294967295
[D] 2021/02/18 16:33:15 CreateProcessW: D:\ProgramData\cygwin64\bin\proxychains.exe, "D:\ProgramData\cygwin64\bin\proxychains.exe", lpProcessAttributes: 0x800008600, lpThreadAttributes: 0x800008600, bInheritHandles: 1, dwCreationFlags: 0x100000420, lpCurrentDirectory: (null); Ret: 1 Child winpid 27388, tid 22512
[D] 2021/02/18 16:33:15 Child is an X64 process.
[D] 2021/02/18 16:33:15 D:\ProgramData\cygwin64\bin\cygproxychains_hook_x64d.dll
[D] 2021/02/18 16:33:15 pTargetPeb: 0x36c000, TargetCtx.Rax - Rdx: 0x0 0x0 0x100401000 0x36c000.
[D] 2021/02/18 16:33:15 pTargetOriginalEntry: 0x100401000
[CYGPID   -1,WINPID27388] [D] 2021/02/18 16:33:15 (In InitHook) g_pRemoteData->dwDebugDepth = 1
[D] 2021/02/18 16:33:15 Child process winpid 27388 created.
[D] 2021/02/18 16:33:15 Registered child pid 27388
[D] 2021/02/18 16:33:15 PerProcessTable:
[D] 2021/02/18 16:33:15
[WINPID27388 PerProcessData]

[CYGPID   -1,WINPID27388] [D] 2021/02/18 16:33:15 I'm WINPID 27388 Hooked!
[D] 2021/02/18 16:33:15 I've Injected WINPID 27388
[I] 2021/02/18 16:33:15 posix_spawnp ret: 2; CYGPID: 2
[E] 2021/02/18 16:33:15 Cygwin child process pid 1227 exited normally(127). YOUR COMMAND LINE MAY HAVE ERROR.
shunf4 commented 3 years ago

错误码是 127,这在 UNIX 下通常是因为找不到可执行文件。请确认 /usr/bin/curl 是否真的存在?

zhj9709 commented 3 years ago

错误码是 127,这在 UNIX 下通常是因为找不到可执行文件。请确认 /usr/bin/curl 是否真的存在?

apt-cyg安装了git,curl,确实没问题了