Bean Network Tester

Filter syntax: names, PIDs, IP ranges, CIDR and ports

One small language aims the tool at programs, addresses and ports. It works the same in the window and on the command line, and every example on this page is checked against the program's own parser.

Where it is used

In the window: the target process field, the address and port fields under Destination targeting and under Blocking (firewall), and the two payload size fields. On the command line: --target, --dst-ip, --dst-port, --block-ip, --block-port, --payload-udp and --payload-tcp. An empty field means everything.

Building blocks

WriteIt meansExample
a,b,ca list: any of them matches80,443
a-ba range, both ends included10.0.0.1-10.0.0.50
> < >= <=a comparison, for numbers and addresses>1024
!leave this out!53
* ?a wildcard: any run of characters, or one characterchrome*
re:a regular expression, case doesn't matterre:^chrome\.exe$
a.b.c.d/na CIDR block, addresses only192.168.1.0/24

Spaces around commas are ignored, and so is an empty place between two commas. A ! with nothing after it is a mistake: 80,! is refused.

How terms combine

The terms without ! add up: a value matches when any of them matches, or when there are none. The terms with ! then take away. The order does not matter, so 80,!53 and !53,80 are the same.

WriteIt matches
443port 443 only
!53everything except 53, since there is nothing to add up
!53,!443everything except 53 and 443
1000-2000,!15001000 to 2000, without 1500
80,443,8000-8100,>9000,!808080, 443, 8000 to 8100 and everything above 9000, except 8080

Programs

A term is a name or a PID, and one field may mix them. A plain name matches anywhere in the program's name, without regard to case, so chrome catches chrome.exe and chromedriver.exe. A bare number, a range or a comparison is a PID. Wildcards and re: match the name. A comparison on a name, such as >chrome, is refused rather than matching nothing.

WriteIt matches
chrome.exeevery program with chrome.exe in its name
chrome,!chromedriverChrome, but not chromedriver
chrome.exe,firefox.exetwo programs at once
12345one PID
1000-2000every PID in that range
firefox*a name that starts with firefox
re:^(chrome|firefox)\.exe$exactly chrome.exe or firefox.exe
firefox,12345a name and a PID in one field

A packet carries addresses and ports, never a program's name, so the tool finds the local ports each matching program holds and aims at those, and follows the new connections it opens. A few ports are shared by several programs at once (mDNS 5353, SSDP 1900, DHCP 67 and 68). On those it is all or nothing, and the log says which.

Addresses

IPv4 and IPv6 both work, and one field may mix them: a rule for one family never matches an address of the other. How an address is written does not matter, so 2001:0db8:0000:0000:0000:0000:0000:0001 and 2001:db8::1 are the same address.

WriteIt matches
1.2.3.4,8.8.8.8two addresses
10.0.0.1-10.0.0.50,!10.0.0.7a range with a hole
192.168.1.0/24a whole subnet
192.168.1.*the same subnet, by wildcard
!8.8.8.8every address except 8.8.8.8
2001:db8::/32an IPv6 subnet
10.0.0.0/8,2001:db8::/32IPv4 and IPv6 in one field

Ports

Ports go from 0 to 65535; 99999 is refused rather than skipped. The payload size fields take the same syntax, counted in bytes of data.

WriteIt matches
8000-8100a range, both ends included
>1024the high ports
<=1024the privileged ports
80,443,8000-8100,!8080a mix

Regular expressions

A term is a regular expression only with re: in front, so a dot in chrome.exe stays a dot. The pattern ignores case and may match anywhere in the text; use ^ and $ to match the whole of it. A comma inside a pattern needs a backslash, because a comma separates terms: re:^ch.{1\,8}e\.exe$ works. Without the backslash, re:^ch.{1,8}e\.exe$ is cut at the comma into two terms that both load and match something else.

A repeat inside a repeat, such as re:^(\w+)+$, is refused as too slow: it can take seconds on one name that almost matches, and an address is checked on every packet. Write the repeat once: re:^\w+$.

Cases that catch people out

Every mistake is reported at once: the field in the window turns red with the reason under it, and the command line stops with a readable message.

Ready to break your own network on purpose?

Download