-
Packet Sniffer/Firewall
Anyone know of some ways to program a packet sniffer or decent firewall in VB? Possible some API's? So Far I have found nothing worthwhile in API Guide. I think I heard awhile back that VB isnt lowlevel enough to intercept the TCP/IP packets. If its not possible, maybe so other languages that would be good to program one in.
-
Although programming a packet sniffer or a firewall is possible using VB, I think there would be
better languages suited to this task. Like you said, VB really isn't low-level enough to handle these things, but there are various addin technologies that make this possible (DLL's, COM's, OCX's just to name a few). Using controls like mswinsck.ocx, libpcab, or even packages like dart tcp / server (Just to name a few) make authoring TCP apps easier then coding all the rudimentary packet stuff yourself. It's even possible to write using scipting ; (vb, java, wscript).
When your coding for sniffing and firewalls, your talking about TCP/IP socket manipulation.
I'm gonna assume that since your thinking about programming these, you already have atleast a general idea of tcp/ip. If not, you should definatly google for it to learn more.
These addin's will give you access to some important elements by exposing some higher level functions. Programming a sniffer would basically involve putting the interface into promiscuos mode so that it will read all network traffic (Not just the data meant for you). On anything but a small network there will be a lot of traffic, so adding some kinda of packet filtering would be important. My advice would be to use the libpcap library for working with sockets, it's a great collection of code and should have everything you need for a decent network app. All good network addin's have some method of binding to ports. This would be usefull for a firewall. you should also look at the various hook functions in the Win32 API. These will help when
dealing with and enforcing and networking policy's your firewall might have to implement. I know my information wasn't to specific, but I tried to give you just an overview and maybe maybe a place to start. If you have anymore questions let me know...
-
You should find many projects using VB with the pcap library.
This comes from "http://winpcap.polito.it/misc/links.htm"
# PacketVB
Its an ActiveX for use with Visual Basic that wraps the function exported by the WinPcap API (packet.dll).
http://packetvb.sourceforge.net/
-
Thanks, both posts were helpful. Ive seen a few examples in VB using the winpcap lib. Thanks for the info.
-
i don't know if this helps but anyway check:
- www.planet-source-code.com
for VB codes
and get a free packet sniffer and monitor from :
- www.analogx.com/files/pmoni.exe
-
My Vb experiance is limited, but I know Vb can do calls to most dlls.
Look into winsock.dll, wsock32.dll, and anything you can find about Windows Sockets.