PF redirect all traffic to the local mitmproxy on MAC

Status
Not open for further replies.

enrico

New Member


Messages: 1

Hello,

I'm trying to use mitmproxy to sniff my Android and know my Whatsapp Password.
In order to do that, I read in the mitmproxy doc that I have to "redirect all traffic destined for port 80 or 443 to the local mitmproxy instance running on port 8080"
http://docs.mitmproxy.org/en/stable/transparent/osx.html

I added these two lines to the end of the /etc/pf.conf file:

Code:
rdr on en2 inet proto tcp to any port 80 -> 127.0.0.1 port 8080
rdr on en2 inet proto tcp to any port 443 -> 127.0.0.1 port 8080
but when try to read the pf.conf
sudo pfctl -f pf.conf
I receive the following:
Code:
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.

No ALTQ support in kernel
ALTQ related functions disabled

pf.conf:28: Rules must be in order: options, normalization, queueing, translation, filtering
pf.conf:29: Rules must be in order: options, normalization, queueing, translation, filtering

pfctl: Syntax error in config file: pf rules not loaded
Can anyone help me on how to solve this? and what should I put instead of "en2" into the rdr line??

Thanks in advance!
Enrico
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,181
Messages: 29,471

Code:
pf.conf:28: Rules must be in order: options, normalization, queueing, translation, filtering 
pf.conf:29: Rules must be in order: options, normalization, queueing, translation, filtering
The answer is right here. The order is wrong. NAT and redirection rules must come before any filtering rules.

Also note that we do not support OS-X or anything else besides FreeBSD. See rule #7: https://forums.freebsd.org/threads/38922/

Thread closed.
 
Status
Not open for further replies.
Top