This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:openbsd:pf [2023/05/08 08:24] – michel | wiki:openbsd:pf [2023/05/08 08:39] (current) – michel | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | =====PF===== | + | =====PF |
| <file bash pf.conf> | <file bash pf.conf> | ||
| ################################################################################################## | ################################################################################################## | ||
| Line 96: | Line 96: | ||
| ################################################################################################## | ################################################################################################## | ||
| include "/ | include "/ | ||
| - | include "/ | ||
| - | include "/ | ||
| include "/ | include "/ | ||
| + | ################################################################################################## | ||
| + | # Redirect | ||
| + | ################################################################################################## | ||
| + | pass in on ISP inet proto {tcp} os Openbsd to port {2222} divert-to 127.0.0.1 port 2222 label " | ||
| + | pass in on ISP inet proto {tcp,udp} to port 53 rdr-to 10.192.20.6 | ||
| ################################################################################################## | ################################################################################################## | ||
| # PASS | # PASS | ||
| ################################################################################################## | ################################################################################################## | ||
| + | pass proto tcp os Openbsd to < | ||
| pass from { < | pass from { < | ||
| pass on CORE label "Pass on $if" | pass on CORE label "Pass on $if" | ||
| Line 117: | Line 121: | ||
| </ | </ | ||
| - | ==== Test befor starting ==== | + | ==== Test befor starting |
| < | < | ||
| ==== Kill a session ==== | ==== Kill a session ==== | ||
| Line 145: | Line 149: | ||
| Veryfi that the sync works, the count should be even on both firewalls | Veryfi that the sync works, the count should be even on both firewalls | ||
| < | < | ||
| + | |||
| + | ===== Hardening ===== | ||
| + | ==== Block ransomeware ==== | ||
| + | <file bash block_ransom.sh> | ||
| + | #/bin/sh | ||
| + | curl -s https:// | ||
| + | curl -s https:// | ||
| + | grep -v \# /tmp/ransom | uniq > / | ||
| + | rm /tmp/ransom | ||
| + | </ | ||
| + | |||
| + | <file bash crontab> | ||
| + | ~ * * * * /bin/sh / | ||
| + | </ | ||
| + | |||
| + | ==== Block country ==== | ||
| + | <file bash block_country.sh> | ||
| + | #!/bin/sh | ||
| + | for c in cn il ua ru ro hk by vn il mu | ||
| + | do | ||
| + | curl -s http:// | ||
| + | done | egrep ' | ||
| + | </ | ||
| + | |||
| + | <file bash crontab> | ||
| + | ~ * * * * /bin/sh / | ||
| + | </ | ||
| + | |||
| + | ==== Block TOR ==== | ||
| + | <file bash block_tor.sh> | ||
| + | #/bin/sh | ||
| + | curl -s https:// | ||
| + | </ | ||
| + | |||
| + | <file bash crontab> | ||
| + | ~ * * * * /bin/sh / | ||
| + | </ | ||