duketwo / WinsockConnectHookSocks5

WSock Socks5 proxy forwarding POC
39 stars 12 forks source link

Similiar a software Proxifier? #1

Open r-matias opened 8 years ago

r-matias commented 8 years ago

Its works?

duketwo commented 8 years ago

Yes it works, but it's not similiar to Proxifier because there is no automated injection in all/selected processes.

To make it work: Just edit this line in the file "WSockConnectHook/HookManager.cs" "AddController(new WinSockConnectController(LocalHook.GetProcAddress("WS2_32.dll", "connect"), "127.0.0.1", "1337", "username", "password"));" and add your proxy settings. Install firefox in the default location or change the path and set the Injector project as startup.

You can freely try to inject into other tcp based winsock connect programs, I just took Firefox as example.

r-matias commented 8 years ago

if i change line 55 for another .exe example path of chrome.exe its work? file Injector > MainForm.cs its work? "EasyHook.RemoteHooking.CreateAndInject("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "http://www.google.de", (int)InjectionOptions.Default, injectionFile, injectionFile, out processId, ChannelName, args);"

duketwo commented 8 years ago

Chrome spawns multiple processes, not sure if it will work with chrome. But yes, change the path and the exe file to try it out.

r-matias commented 8 years ago

I tray with firefox, but in MainForm construtctor in line 21 "RemoteHooking.WakeUpProcess();" ocurrs this error An unhandled exception of type 'System.DllNotFoundException' occurred in EasyHook.dll

Additional information: Unable to load DLL 'EasyHook32.dll': Could not find the specified module. (Exception from HRESULT: 0x8007007E)

duketwo commented 8 years ago

easyhook.dll and easyhook32.dll needs to be in the same directory as the injector.exe. The build process should copy all required files to the debug directory.

r-matias commented 8 years ago

In the project have just easyhook.dll, but not easyhookd32.dll?

r-matias commented 8 years ago

Ahhh, are in folder Libs hehe

duketwo commented 8 years ago

Not the directory of firefox. The directory of injector.exe

r-matias commented 8 years ago

I change the line what you say for: AddController(new WinSockConnectController(LocalHook.GetProcAddress("WS2_32.dll", "connect"), "13.90.249.177", "22", "myusername", "mypassword"));

Need change more? because i start the project but the log dont have data when i enter in any site on firefox

duketwo commented 8 years ago

AppDomainHandler.dll, EasyHook.dll, EasyHook32.dll, Injector.exe, WSockConnectHook.exe needs to be in the same directory

duketwo commented 8 years ago

You need to close all firefox instances before you start the injection.

r-matias commented 8 years ago

And for start what .exe i execute first the Injector.exe or WSockConnectHook.exe? Inject.exe and click start+ inject? after just open the firefox?

duketwo commented 8 years ago

Injector.exe will inject WSockConnectHook.exe into firefox.

r-matias commented 8 years ago

I execute de Injector.exe, click in button "start + injector", open the logbox and firefox, but i digite any site and dont load nothing... show register logs, but any site dont load

duketwo commented 8 years ago

Did you add your socks5 settings and confirmed your socks5 proxy is working (including correct user + pass)?

thanh06 commented 7 years ago

I get this Error when run

An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in EasyHook.dll

Additional information: Exception has been thrown by the target of an invocation.

duketwo commented 7 years ago

I supplied only the 32bit easyhook binaries. Are you trying to inject into a 64bit process?

thanh06 commented 7 years ago

Can you try teamview to my computer ? My ID : 570 030 885 Passs : 4835

I check have some error from function :
_hook = LocalHook.Create(address, new WinsockConnectDelegate(WinsockConnectDetour), this);

it not call

P/s : i try with firefox 32bit