1 Replies - 5398 Views - Last Post: 31 October 2009 - 07:29 PM Rate Topic: -----

#1 herk  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 20
  • Joined: 29-March 09

How to block selected IP address

Posted 31 October 2009 - 04:41 PM

Hello.

I'm trying use winsock to cach and block selected IP address connection.

My question is : Somebody know how to cach incoming / outcoming IP address and block connection ?

For example. User try to open address www.somepage.com and then application get IP address of this page, check this IP in own "blacklist" IP and if this necessarily block connection to this site. I think, that application should by working in second layer of TCP/IP model.

Is anybody tray write something like that ? If yes, please give some advice or link to some information about that. I trying to find information about simple firewall write in C or C++ but I don't find any detailed information.

Thanks for help.

Greetings.

Is This A Good Question/Topic? 0
  • +

Replies To: How to block selected IP address

#2 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6552
  • View blog
  • Posts: 30,682
  • Joined: 10-May 07

Re: How to block selected IP address

Posted 31 October 2009 - 07:29 PM

You would need to write your winsock to access port 80 (destination) requests like a proxy. Then have your program check & filter the ip addresses, & as long as they are not on your 'black list', then allow the traffic back through.

From what I know of sockets & tcp/ip programming in C/C++, this won't be a simple task.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1