Solved

How To Block ALL PORTS

Posted on 2004-10-15
6
398 Views
Last Modified: 2012-05-05
I need some code that illustrates how to block all ports for a computer such that no (Zero) internet activity can occur. ( and then be able to turn them back on again, just like a Firewall blocking all ports).

Q2
0
Comment
Question by:quantum2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:Sergio_Hdez
ID: 12319030
A hook on the TCP/IP stack calls? Just wondering...
0
 
LVL 7

Expert Comment

by:sftweng
ID: 12323855
Perhaps you could start here http://winpcap.polito.it/ or with the Windows DDK
0
 
LVL 7

Expert Comment

by:sftweng
ID: 12323897
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
sftweng earned 125 total points
ID: 12324042
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 12326698
if it's a lan connection, you could simply clear your gateway, so data can not route
(route delete 0.0.0.0)
and reset it after to your lan gateway
route add -p 0.0.0.0 mask 0.0.0.0 192.168.1.1 (if .1 is your router/gateway)
0
 
LVL 1

Author Comment

by:quantum2
ID: 12355357
Hey Sftweng,
thanks for the links. This will help a great deal. If you are interested, I will give you 300 more points if you take the Winsockfirewall code and create an sample application that has the following.

one form, two buttons.

Button 1 - Block all traffic
Button 2 - Enable traffic

Thats it.

While I havent looked at this code in great detail, it would appear that this is as simple as assigning a IP range rule from 0.0.0.1 to 255.255.255.255

I got slammed at work and dont have time to weed through all of this, so if you are interested in creating a sample that uses their code and any libraries, all I would need is the units necessary to make the sample work as well as any components they are dependant on and the above listed functionality.

Thanks for the help

Q2
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question