[VPM] Disable network source/dest. ports via perl....(a simple firewall)

Doug Snead semaphore_2000 at yahoo.com
Wed Dec 8 17:45:26 CST 2004


--- Jeremy Aiyadurai <jeremygwa at hotmail.com> wrote:
> how do i prevent an application from connecting to the net.
> eg. suppose i want to prevent Internet Explorer from
> accessing the net. how do i block the ports that 
> programs use, via perl. I am looking for a windows
> compatible solution.

Hmmm ... Windows has a firewall API you might be able to access
that would let you block ports under program control (this is
what a firewall should let you do).

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/about_windows_firewall.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/windows_firewall_interfaces.asp

And from perl ... In theory, you could access the windows
firewall API, from perl using the Win32::API Win32 Perl
extension.
http://search.cpan.org/~acalpini/Win32-API-0.41/API.pm
Not sure which Windows perl that is for (or if it matters
which). I like the perl you may install with cygwin
http://www.cygwin.com/ 

Win32::API::Prototype is a wrapper around Win32::API that is
said to be easier to use. This one seems to use ActivePerl:
http://www.roth.net/perl/prototype/

So, one way may be to poke around some and see how you can
access the Windows firewall API from perl via Win32::API. Then
you should be able to selectively block ports, including any
ports that IE may be using.

Doug




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250


More information about the Victoria-pm mailing list