Vadim Smirnov

Forum Replies Created

Viewing 15 posts - 1,396 through 1,410 (of 1,421 total)
  • Author
    Posts
  • in reply to: Ethernet Bridge not pass WSock connection`s through #5486
    Vadim Smirnov
    Keymaster

      Ethernet Bridge is free and unsupported tool. There is no warranty that it will work any OS/hardware configuration.

      in reply to: IPSec #5482
      Vadim Smirnov
      Keymaster

        When implementing IPSec you need to insert additional headers (AH, ESP) or even incapsulate packets, thats why you need to decrement MTU used by system.

        in reply to: IPSec #5480
        Vadim Smirnov
        Keymaster

          Just parse IP header of the packet and format the string with IP address…

          in reply to: Modify Packet #5447
          Vadim Smirnov
          Keymaster

            MHdrSize is equal to the size of ethernet header, which is 14 bytes length.

            in reply to: IPSec #5478
            Vadim Smirnov
            Keymaster

              May it makes sense for you to read IPSec documents regarding this subject? WinpkFilter gives you raw access to packet data, so you can do anything described in IPSec specs.

              in reply to: Need to know what application is associated with a packet #5469
              Vadim Smirnov
              Keymaster

                I need this solution for 98 as well. But Localhost Minitor API is for NT platform. Can you please sugesst a solution for all windows platform.

                You can also create TDI filter driver for Windows 9x/ME. An example sample code for Windows 9x/ME TDI filter driver can be found in the VToolsD (part of SoftIce Driver Suite and Driver Studio products from http://www.compuware.com) samples.

                Another solution is LSP, it’s a user mode DLL which installed as proxy between Winsock interface and Winsock Service Provider. Please, read MSDN for the details.

                I know the DNS requests. But I dont know how to redirect any request to some other domain/IP. Can you please be more specific about this. This redirection has to be done on between MSTCP table and application or in between Network Adeptor and MSTCP? I can drop the connection while reading the MSTCP based on IP or other filter but dont know how to redirect this.

                Here are two ways:
                1) Intercept DNS request packet, parse the content and check if it queries information for the domain you would like to forbid access. If it is then just drop this packet, system will fail to resolve IP for the domain and it will be unable to connect that host. Blocking can be also done for DNS response packet.
                2) Intercept DNS response, check if it is for the domain you would like to forbid access. If it is then modify IP address information (to the host you would like to redirect to) and pass packet to the stack. On this way you cheat system with your redirect IP address and it will try to connect specified IP (you can place a web-page there like “Access to this site is restricted” or something).

                in reply to: Need to know what application is associated with a packet #5467
                Vadim Smirnov
                Keymaster

                  does windpkfilter provides TDI filtering or LSP? I have bought windpkfilter licence for individual. Before buying the source code I want to know is it possible to make such kind of firewall using the same. If no then do you have any other development SDKs or if yes can you please provide me a sample.

                  Please find Localhost Minitor API on this site, which is based on the TDI filter driver for Windows NT/2000/XP/Server2003. There is a sample LSP code avalable in the MSDN (search for SPI.CPP).

                  Usually firewalls combine TDI (or LSP) and NDIS level filter in order to provide complete functionality.

                  As for the DNS request modification then I can’t provide you the sample code. However, there is no great problem to do this, you should intercept DNS requests/replies and modify the replied IP for the URL you would like to redirect or just block the request (in this case browser will fail to detrmine site IP). I think it makes sense for you to read DNS specs.

                  in reply to: Need to know what application is associated with a packet #5464
                  Vadim Smirnov
                  Keymaster

                    I’m making a firewall with this driver. In my firewall i need to allow packets from specific applications only. can I get this information from the packet header? What application has sent this packet. Or is there a way to do this.

                    There is no way to determine application context on the NDIS level. Actually not all packets you see have the associated app (these are routed packets, packets generated by TCP/IP stack). However you can track active connections information with TDI filter or with LSP and use this information to determine each packet associated application.

                    Also in this firewall I want to block websites with specific names. Is it possible if yes how. Any example will be heighly appriciated.

                    You can track and modify DNS requests for these names an example…

                    in reply to: Physical Address #5463
                    Vadim Smirnov
                    Keymaster

                      I can miss something because it passed pretty much time since my last research of this subject.

                      3E-1C-20-52-41-53 – this is what DeviceNDISWANIP returns for OID_802_3_CURRENT_ADDRESS request. NDISWAN generates first three bytes as a function of time during initialization stage; last three bytes are hexing codes for the word “RAS”. Note that you never see this MAC address in the packets, there are pairs of MACs used for each WAN connection, if I remember fine first three bytes will remain and last three bytes generated from the connection number.

                      Btw, mapping IP address to WAN interface is not easy task because it may have multiply IP addresses, each one associated with WAN connection (note that on Windows NT/2000/XP you may have multiply WAN connections). WinpkFilter driver can track information about each established WAN connection including its IP address (actually NT/2000/XP version has some relative code for this). Doing the same for Windows 9x/ME requires hooking one of device VIP VxD services, but luckily only one active WAN connection is possible. So if you own WinpkFilter Source Code license then you can customize the helper driver for your needs. In user-mode you can query required information using RAS API and IP Helper API.

                      in reply to: WinpkFilter 2.3 & Borland #5462
                      Vadim Smirnov
                      Keymaster

                        There were no changes in the DLL since version 1.3.0 and this is why its version resource was not updated, so you should be able to use provided CBuilder DLL fine with the latest driver. MSVC DLL version was updated just in order to match main product version since it is used for all sample binaries.

                        DLL source code is provided with any WinpkFilter license except trial.

                        in reply to: Answer a packet #5460
                        Vadim Smirnov
                        Keymaster

                          Yes, I understand what you are doing. However, there should be no problem to indicate any custom generated packets to MSTCP (actually there is no difference in reinjecting filtered packet or injecting new packet, both are done with one function). So the problem can be only in the packet itself.

                          in reply to: Answer a packet #5457
                          Vadim Smirnov
                          Keymaster

                            In general the idea is correct and it should work. Only one note, setting m_PacketBuffer.m_dwDeviceFlags is not necessary, this field is used only when you read packets to distinguish incoming and outgoing ones, but it is ignored when you send packets.

                            Probably your RST packet is somehow wrong, in order to check this let you application to send SYN packet to the system which has not the requested port opened and capture resulting RST packet by sniffer. Then do the same with your WinpkFilter application running and compare the generated RST packet with captured one to find the difference.

                            in reply to: Start winpkfilter without re-boot #5455
                            Vadim Smirnov
                            Keymaster

                              No, this is not possible, driver should start before TCP/IP …

                              in reply to: Modify Packet #5445
                              Vadim Smirnov
                              Keymaster

                                This is just a sample, but you can define them as below:

                                string sought = “sex”;
                                string replacement = “foo”;

                                plz also clear my doubt that can i store the return value into another PINTERMEDIATE_BUFFER buffer and then RecalculateTCPChecksum by passing the new buffer. plz solve my problem

                                I’m not sure I understand your problem here. The function I have provided recalculates checksum for the modified packet. If you want to copy the packet then just copy INTERMEDIATE_BUFFER structure but I can’t find any good reason whay you may need this…

                                in reply to: Modify Packet #5443
                                Vadim Smirnov
                                Keymaster

                                  This is MAC 802.3 Header Size:

                                  #define ETHER_TYPE_LENGTH 2
                                  #define ETHER_ADDR_LENGTH 6
                                  #define MHdrSize (2*ETHER_ADDR_LENGTH + ETHER_TYPE_LENGTH )

                                Viewing 15 posts - 1,396 through 1,410 (of 1,421 total)