PF pf correct divert rule

Hi i'm using OSX Mojave,
trying to use PF to divert packets for modifications in userspace..

One example from here:
Code:
pass on em0 from any to 192.168.1.1 port 80 divert-to localhost port 36895

And another example:
Code:
pass out on em0 inet proto tcp to port 80 divert-packet port 8080

Both fail with syntax errors..
I'm editing /etc/pf.conf and loading with pfctl -f /etc/pf.conf

Why is this happening? what's wrong?
 
Where is the FreeBSD part in your problem? You have read the rules and sign-up email?
 
I would make a macro for your interface and use something like this:
Code:
### Macro name for external interface
ext_if = "em0"

pass in on $ext_if proto tcp from any to 192.168.1.1 port 80 divert-to 127.0.0.1 port 36895

pass out on $ext_if proto tcp from any to port 80 divert-to 127.0.0.1 port 8080 modulate state

I've never used a divert-packet rule but that should be the right syntax for the rest of it.

Or not. 🎄
 
Crivens is right, you should post this in the off topic forum ;)

anyhow, macOS has several parts taken from FreeBSD, but, they may change them a LOT. So, first, you should see if 'apropos pf' gives something in macOS. If so, read macOS man pages, carefully.

if it does not, try to establish with version of pf you are using, then dig the doc of FreeBSD and OpenBSD to see what fits best. OpenBSD changes it faster.

sorry for bad formatting/typos, typing on phone.
 
What made you associate a Christmas tree with malware on Christmas? 🛋 💊
 
Back
Top