Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. firewall

firewall

Scheduled Pinned Locked Moved C#
csharpjsonquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shahrokh nabavi
    wrote on last edited by
    #1

    i want to implement a personal firewall with packet filtering api's but i dont want to just filtering packets iwant do some more works like other firewalls 1-i want to notify the user when a program try to access to internet do you think is there any event in .net or in windows for this purpose and if there is which events 2- i want to see all open ports in mycompuetr somthing like netstat command in windows but iwant do this programmatically 3-if i saw a port is open how can i close it programmatically koosha

    L C 2 Replies Last reply
    0
    • S shahrokh nabavi

      i want to implement a personal firewall with packet filtering api's but i dont want to just filtering packets iwant do some more works like other firewalls 1-i want to notify the user when a program try to access to internet do you think is there any event in .net or in windows for this purpose and if there is which events 2- i want to see all open ports in mycompuetr somthing like netstat command in windows but iwant do this programmatically 3-if i saw a port is open how can i close it programmatically koosha

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      1. no 2. look at the windows SDK 3. kill the process top secret xacc-ide 0.0.1

      1 Reply Last reply
      0
      • S shahrokh nabavi

        i want to implement a personal firewall with packet filtering api's but i dont want to just filtering packets iwant do some more works like other firewalls 1-i want to notify the user when a program try to access to internet do you think is there any event in .net or in windows for this purpose and if there is which events 2- i want to see all open ports in mycompuetr somthing like netstat command in windows but iwant do this programmatically 3-if i saw a port is open how can i close it programmatically koosha

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        Most, if not all, firewall programs work by using an NDIS Hook to (in simplified terms) see all the packets fly through the network adapter. They get a chance to examine every packet that passes through and can optionally pass the packet to the network adapter (on the way out) or pass it on to Windows (on the way in). A firewall works by just dropping any packet it doesn't like the look of. In answer to #3. If you want to close a port then all you need to do in your NDIS Hooked code is to block any packets on that port. As you examine every packet as is passed through, this means that you just don't pass the packed on the ports you want closed.


        "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog

        J 1 Reply Last reply
        0
        • C Colin Angus Mackay

          Most, if not all, firewall programs work by using an NDIS Hook to (in simplified terms) see all the packets fly through the network adapter. They get a chance to examine every packet that passes through and can optionally pass the packet to the network adapter (on the way out) or pass it on to Windows (on the way in). A firewall works by just dropping any packet it doesn't like the look of. In answer to #3. If you want to close a port then all you need to do in your NDIS Hooked code is to block any packets on that port. As you examine every packet as is passed through, this means that you just don't pass the packed on the ports you want closed.


          "You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar The Second EuroCPian Event will be in Brussels on the 4th of September Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way! My Blog

          J Offline
          J Offline
          JimRivera
          wrote on last edited by
          #4

          Really i thought that using the hook would wind up degrading performance, and that a seperate socket layer was used. Interesting thanks ;) Discovery consist of seeing what everybody has seen and thinking what nobody has thought -- Albert Szent-Györgyi Name the greatest of all the inventors: accident --Mark Twain

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups