-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathdisable.sh
97 lines (75 loc) · 2.53 KB
/
disable.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash -x
# macOS-Fortress: Firewall, Blackhole, and Privatizing Proxy
# for Trackers, Attackers, Malware, Adware, and Spammers
# disable.sh
# commands
SUDO=/usr/bin/sudo
PORT=/opt/local/bin/port
LAUNCHCTL=/bin/launchctl
PFCTL=/sbin/pfctl
KILLALL=/usr/bin/killall
CAT=/bin/cat
ECHO=/bin/echo
$CAT <<HELPSTRING
macOS-Fortress: Firewall, Blackhole, and Privatizing Proxy
for Trackers, Attackers, Malware, Adware, and Spammers
Kernel-level, OS-level, and client-level security for macOS,
with On-Demand and On-Access Anti-Virus Scanning.
This disable script will unload all launch daemons, disable
the pf firewall, and list all insalled files WITHOUT removing them.
Disabling…
HELPSTRING
$ECHO "Unloading launchctl daemons…"
LAUNCHDAEMONS=/Library/LaunchDaemons
launchctl_unload () { if [ -f $LAUNCHDAEMONS/$PLIST ]; then $SUDO $LAUNCHCTL unload -w $LAUNCHDAEMONS/$PLIST; fi; }
for PLIST in \
net.openbsd.pf.plist \
net.openbsd.pf.brutexpire.plist \
net.emergingthreats.blockips.plist \
net.dshield.block.plist \
net.hphosts.hosts.plist \
com.github.essandess.easylist-pac.plist \
com.github.essandess.adblock2privoxy.plist \
com.github.essandess.adblock2privoxy.nginx.plist \
org.squid-cache.squid-rotate.plist \
; do
launchctl_unload
done
$ECHO "Disabling pf firewall…"
$SUDO $PFCTL -d
$ECHO "Killing the squid and privoxy proxies…"
$SUDO $PORT unload squid
$SUDO $KILLALL -9 squid
$SUDO $KILLALL -9 '(squid-1)'
$SUDO $PORT unload privoxy
$ECHO ""
$ECHO "These files still exist:"
fname_exists () { if [ -f $FNAME ]; then $ECHO "$FNAME"; fi; }
PROXY_PAC_DIRECTORY=/Library/WebServer/Documents
for FNAME in \
$PROXY_PAC_DIRECTORY/proxy.pac \
/etc/hosts.orig \
/etc/pf.conf.orig \
$LAUNCHDAEMONS/net.openbsd.pf.plist \
$LAUNCHDAEMONS/net.openbsd.pf.brutexpire.plist \
$LAUNCHDAEMONS/net.emergingthreats.blockips.plist \
$LAUNCHDAEMONS/net.dshield.block.plist \
$LAUNCHDAEMONS/net.hphosts.hosts.plist \
$LAUNCHDAEMONS/com.github.essandess.easylist-pac.plist \
$LAUNCHDAEMONS/com.github.essandess.adblock2privoxy.plist \
$LAUNCHDAEMONS/com.github.essandess.adblock2privoxy.nginx.plist \
$LAUNCHDAEMONS/org.squid-cache.squid-rotate.plist \
$HOME/Library/LaunchAgents/org.opensource.flashcookiedelete.plist \
/usr/local/etc/blockips.conf \
/usr/local/etc/whitelist.txt \
/usr/local/etc/blacklist.txt \
/usr/local/bin/macosfortress_boot_check \
/usr/local/bin/pf_restart \
/usr/local/bin/squid_restart \
/usr/local/bin/privoxy_restart \
/usr/local/bin/easylist_pac.py \
/usr/local/bin/adblock2privoxy \
; do
fname_exists
done
exit 0