1

I want write a program in Delphi to watch the internet connection, and if a certain response received (in response to request from a program), send request again encoded to another server, get a new encoded response, decode it, and pass it as response to the program who sent the main request. But I don't now how to hook internet connection. I want to use this program to pass through filter my country governments made using a private program to avoid blocking it. Is there any idea?
Thanks for your answer.

Vahid
  • 584
  • 2
  • 19
  • 3
    You want a [_proxy_](http://en.wikipedia.org/wiki/Proxy_server). Is it HTTP? – Marcus Adams Mar 20 '12 at 18:53
  • 3
    Why do you want to write this yourself? There are many tools in existence that do this. It's a huge task to do it yourself. – David Heffernan Mar 20 '12 at 19:00
  • Both HTTP and HTTPS, I have some problems using proxy, so I need a program like "Proxifier" program. I want to make it myself to everyone be able to have his own encoding format and his own server to avoid blocking it, Current existing software servers are all blocked. – Vahid Mar 21 '12 at 10:50
  • In order to work with the HTTPS, you're going to have to play tricks with SSL. Read this article on how to do it with Fiddler2, before deciding if you really want to go down this path. I agree with David, that you're probably over your head. http://www.fiddlertool.com/fiddler/help/httpsdecryption.asp – Chris Thornton Mar 21 '12 at 18:11

2 Answers2

1

Magenta Systems released a free set of Delphi components that let you see the network traffic on your computer and examine the content. If you see the response you are looking for, your monitoring program can send a request to another server.

Off the top of my head, I'm not sure if it will let you alter the content of the original packet. If not, then Marcus' suggestion of using a proxy might suit you better.

Bruce McGee
  • 15,076
  • 6
  • 55
  • 70
1

You can either try to hook stuff at the Winsock level (there's plenty of examples for that around), but I suggest you go one level deeper and use a Layered Service provider (LSP). I have used Komodia's redirector from http://www.komodia.com. Commercial, but well worth it. See also this post Is it possible to intercept dns queries using LSP/SPI?

Community
  • 1
  • 1
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144