Update History

Locked
User avatar
JHPJHP
Site Admin
Posts: 217
Joined: Wed Jun 21, 2023 10:48 am

Update History

Post by JHPJHP »

PB Interface to WinDivert

Updated:
WinDivert 2.2.
added passthru.pb.
/*
* DESCRIPTION:
* This program does nothing except divert packets and re-inject them. This is
* useful for performance testing.
*
* usage: passthru.exe [windivert-filter] [num-threads] [batch-size] [priority]
*/
• Complete rewrite of the WinDivert header.
• Support for 32-bit and 64-bit applications.
• Archived old version and examples.

Note: Default examples will be added over time. For an idea of what to expect see the \references\ folder.
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein
User avatar
JHPJHP
Site Admin
Posts: 217
Joined: Wed Jun 21, 2023 10:48 am

Re: Update History

Post by JHPJHP »

Updated:
added netfilter.pb.
/*
* DESCRIPTION:
* This is a simple traffic filter/firewall using WinDivert.
*
* usage: netfilter.exe windivert-filter [priority]
*
* Any traffic that matches the windivert-filter will be blocked using one of
* the following methods:
* - TCP: send a TCP RST to the packet's source.
* - UDP: send a ICMP(v6) "destination unreachable" to the packet's source.
* - ICMP/ICMPv6: Drop the packet.
*
* This program is similar to Linux's iptables with the "-j REJECT" target.
*/
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein
User avatar
JHPJHP
Site Admin
Posts: 217
Joined: Wed Jun 21, 2023 10:48 am

Re: Update History

Post by JHPJHP »

Updated:
added webfilter.pb.
/*
* DESCRIPTION:
* This is a simple web (HTTP) filter using WinDivert.
*
* It works by intercepting outbound HTTP GET/POST requests and matching
* the URL against a blacklist. If the URL is matched, we hijack the TCP
* connection, reseting the connection at the server end, and sending a
* blockpage to the browser.
*/
All the relevant parts have been converted, but it didn't make sense to spend too much time on some functions.

The following C functions were excluded and replaced with a simplified PureBasic Procedure (BlackListMatch):
• UrlCompare
• UrlMatch
• BlackListSort
• BlackListMatch

Quote from the creator of WinDivert:
• It's worth reading the response from the author as he modified the example to be relevant.
• And in this post where the author also made changes to the example making it relevant.
basil wrote:The webfilter example is not very useful. It only supports HTTP/1.1, which was somewhat relevant in 2011 when it was first written, but is no longer relevant as almost all websites/browsers use encryption + more modern web protocols. This sample should be retired.
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein
Locked