Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hello guys im not really good at programming and i ask this once in this forum but i just want to clarify or i want to know how will i be able to block downloading of any file? its like having a firewall that only focus on blocking/not allowing the downloading of files... is this possible using c#? or c++? or perhaps using java? if not then can you give me an idea on how to achieve this programmatically?
thanks in advance guys...
Posted

This depends on how smart you're end users are.

For "dumb" users, you can modify the hosts file. This will prevent windows from even trying to do a DNS lookup. Its easily changed.

You could also use the Fiddler API to create your own proxy and stop it. But this method can easily be gotten around with a download called Ultrasurf.

The best was is to create a NDIS kernel level driver. Its the hardest, but best.

Hogan
 
Share this answer
 
Comments
Madzmar25 27-Aug-11 10:35am    
do you have any sample on how to achieve this? i mean just a basic just to get me going on my project... btw thanks for the reply
snorkie 28-Aug-11 16:22pm    
The hosts file is located in %windows%/system32/etc/hosts [no extension]. Add the DNS name like "www.codeproject.com" and then point it to another location like 127.0.0.1 and nothing will show up.

For the second example with fiddler, check out the API for fiddler at http://www.fiddler2.com/fiddler/dev/
It requires custom development, but it does have great examples to get you started.

For the third example, I'm not sure. From all the research I have done a NDIS driver is about as good as it gets.

Emilio had several great points in his solution he mentioned. Based on the environment you're going to be in and the savvy of the users, it will decide your solution. Ultimately, everything that is done can be undone.

Hogan
I agree with snorkie, but consider also that even a kernel driver is a "weak measure": if the user "owns" the computer (that is: he as administrator equivalent privileges) he can de-install the driver the same way you installed it.

That's why this kind of things are normally demanded to hardware firewalls: because they are external devices, not related to the end-user.
But -of course- there is the drawback that the user can keep the computer with him and attach it to another network.

In conclusion, there no excellent measure: but a combination of them is needed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900