Packet Sniffer/Firewall
Results 1 to 6 of 6

Thread: Packet Sniffer/Firewall

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Posts
    220

    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.
    [gloworange]And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict\'s veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. \"This is it... this is where I belong...\" I know everyone here... even if I\'ve never met them, never talked to them, may never hear from them again... I know you all...[/gloworange]

  2. #2
    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...
    We are a generation without a middle. We have no great war or depression. Our war is a spiritual one, our depression is our lives. We were all raised to believe that we\'ll all be millionaires and rockstars - But we won\'t.
    And we are slowly learning this fact...And we are VERY pissed off about it!

  3. #3
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Posts
    953
    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/
    yeah, I\'m gonna need that by friday...

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Posts
    220
    Thanks, both posts were helpful. Ive seen a few examples in VB using the winpcap lib. Thanks for the info.
    [gloworange]And then it happened... a door opened to a world... rushing through the phone line like heroin through an addict\'s veins, an electronic pulse is sent out, a refuge from the day-to-day incompetencies is sought... a board is found. \"This is it... this is where I belong...\" I know everyone here... even if I\'ve never met them, never talked to them, may never hear from them again... I know you all...[/gloworange]

  5. #5
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    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
    One Man\'s Villain, is another man\'s HERO

  6. #6
    Member
    Join Date
    Aug 2005
    Posts
    41
    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.
    http://www.AntiOnline.com/sig.php?imageid=789\"A dark angel of sin, preying deep from within...\" - Rob Halford

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •