Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Intercept requests and modification of the server response (https://forum.exetools.com/showthread.php?t=15163)

Smoke 07-30-2013 23:58

Intercept requests and modification of the server response
 
I want to intercept all browser requests and then add some js into server responses before it will appears in browser.

For example "Ad muncher" is doing it. It add js that removes all ad from pages.

Please give me some advise, how I can do it?

I'm using C#.

I found 2 solutions that may be can help me:

1) www.fiddler2.com But as I understand I could only write my own plugin for it, but I can't make standalone application. And also it is a proxy-type solution..

2) www.tcpdump.org and www.winpcap.org I can't find how to modify server responses, I found some info only about sniffering the requests.

P.S: I don't want to use proxy server for this purpose.

Thanks for any help.

sendersu 07-31-2013 00:57

>I want to intercept all browser requests
do you work by IP or by domain name with your service?

Loki 07-31-2013 15:52

I use GreaseMonkey to do this quite a lot - extremely powerful as you're using JS to mod HTML/JS :)

Smoke 07-31-2013 20:23

Intercept requests form all application(chrome, firefox,yahoo,...) and modification of the server response

athapa 08-02-2013 08:01

I'd think proxy server would be easier than trying to make some other drivers to intercept and modify the packets.

Seems like windivert may let you do what you want. However I've never used that myself. Also it is in c not c#. Not sure if anyone have ported that. You may be able to pinvoke windivert dlls.

The closest thing I've used in c# is winpcap but that only intercept but not modify packets.

HTH,
athapa

memcpy 08-05-2013 00:08

Hook all user internet APIs and change them inplace in memory.

athapa 08-05-2013 08:40

It may be possible to hook to HttpOpenRequest and other calls in wininet.dll as mentioned by memcpy. However if you want to support more than 1 browser types then you'll need to look at what api calls are made by other browsers. API Monitor mentioned here may help - http://www.rohitab.com/api-monitor-tutorial-sniffing-internet-explorer-ssl-data with that quest

trtty 08-06-2013 19:15

Smoke, you would like to inject js's only in one project or you want to build a tool for this?

If 2nd, there is no need in hooking APIs... Build LSP library and add all required data to the packet.

Evilcry 08-07-2013 13:22

Try also to take a look on how work ZeuS (source code for version 2.0.8.9) are available, you can check how WebInjection is managed.

athapa 08-07-2013 22:40

Zeus sounds interesting but it is cpp not c#.
LSP might work but you'd need to build that in cpp and pinvoke that in your .net code.

I don't think you are targeting XP or older, then see if windows packet filtering api works:
http://www.codeproject.com/Articles/5144/An-Easy-Firewall-Application

Most likely you'd want to support Windows 7 and greater so in that case you could use Windows Filtering Platform (WFP). I've not seen a complete project yet in .net but this may help.
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/e2308de1-e892-4a07-9bc8-7278d1f5b104/wfp-with-c

BTW why c#?


All times are GMT +8. The time now is 17:32.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX