-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultiple_squidguard.sh
204 lines (145 loc) · 3.84 KB
/
multiple_squidguard.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/bin/sh
mkdir -p /tmp/angpfsense
rm -rf /tmp/angpfsense/*
cd /tmp/angpfsense
# shallalist
# download
fetch [shallalist]
# extract
tar -zxvf shallalist.tar.gz
# ATS
# create ATS folder
mkdir -p BL/ATS
# download
fetch [hp-hosts_ats]
# remove line
cat ad_servers.txt | sed '/localhost/d' > BL/ATS/domains
cat BL/ATS/domains | sed '/^#/d' > BL/ATS/domains.temp
# format
cat BL/ATS/domains.temp | sed -r 's/127.0.0.1 //' > BL/ATS/domains
# remove temp
rm BL/ATS/domains.temp
# EMD
# create EMD folder
mkdir -p BL/EMD
# download
fetch http://hosts-file.net/emd.txt
# remove line
cat emd.txt | sed '/localhost/d' > BL/EMD/domains
cat BL/EMD/domains | sed '/^#/d' > BL/EMD/domains.temp
# format
cat BL/EMD/domains.temp | sed -r 's/127.0.0.1 //' > BL/EMD/domains
# remove temp
rm BL/EMD/domains.temp
# FSA
# create FSA folder
mkdir -p BL/FSA
# download
fetch [hp-hosts-fsa]
# remove line
cat fsa.txt | sed '/localhost/d' > BL/FSA/domains
cat BL/FSA/domains | sed '/^#/d' > BL/FSA/domains.temp
# format
cat BL/FSA/domains.temp | sed -r 's/127.0.0.1 //' > BL/FSA/domains
# remove temp
rm BL/FSA/domains.temp
# EXP
# create EXP folder
mkdir -p BL/EXP
# download
fetch [hp-hosts_exp]
# remove line
cat exp.txt | sed '/localhost/d' > BL/EXP/domains
cat BL/EXP/domains | sed '/^#/d' > BL/EXP/domains.temp
# format
cat BL/EXP/domains.temp | sed -r 's/127.0.0.1 //' > BL/EXP/domains
# remove temp
rm BL/EXP/domains.temp
# PSH
# create PSH folder
mkdir -p BL/PSH
# download
fetch [hp-hosts-psh]
# remove line
cat psh.txt | sed '/localhost/d' > BL/PSH/domains
cat BL/PSH/domains | sed '/^#/d' > BL/PSH/domains.temp
# format
cat BL/PSH/domains.temp | sed -r 's/127.0.0.1 //' > BL/PSH/domains
# remove temp
rm BL/PSH/domains.temp
# mdl
# create mdl folder
mkdir -p BL/mdl
# download
fetch [malwaredomainlist]
# remove line
cat hosts.txt | sed '/localhost/d' > BL/mdl/domains
cat BL/mdl/domains | sed '/^#/d' > BL/mdl/domains.temp
# format
cat BL/mdl/domains.temp | sed -r 's/127.0.0.1 //' > BL/mdl/domains
# remove temp
rm BL/mdl/domains.temp
# DNSBH
# create DNSBH folder
mkdir -p BL/DNSBH
# download
fetch [dnsbh]
cat justdomains > BL/DNSBH/domains
# openphish
# create OPNPSH folder
mkdir -p BL/OPNPSH
# download
fetch [openphish]
# format
cat feed.txt | sed -r 's/http:\/\///' > BL/OPNPSH/urls
# phishtank
# create PSHTNK folder
mkdir -p BL/PSHTNK
# download
fetch [phishtank]
# extract
bunzip2 online-valid.csv.bz2
# remove line
cat online-valid.csv | sed 's/^[0-9]*,//' > BL/PSHTNK/urls
cat BL/PSHTNK/urls | sed 's@,http://www.phishtank.com/phish_detail.php?phish_id=[0-9]*,.*$@@' > BL/PSHTNK/urls.temp
cat BL/PSHTNK/urls.temp | sed 's/^"\(.*\)"$/\1/' > BL/PSHTNK/urls
cat BL/PSHTNK/urls | sed '/phish_id/d' > BL/PSHTNK/urls.temp
# format
cat BL/PSHTNK/urls.temp | sed -r 's/http:\/\///' > BL/PSHTNK/urls
cat BL/PSHTNK/urls | sed -r 's/https:\/\///' > BL/PSHTNK/urls.temp
cat BL/PSHTNK/urls.temp > BL/PSHTNK/urls
# remove temp
rm BL/PSHTNK/urls.temp
# angelics - gamble
# create ang_gamble folder
mkdir -p BL/ang_gamble
# download
fetch [github_ang-gamble]
# copy to folder
cp domains BL/ang_gamble
# iblocklist
# Make category folder
mkdir -p BL/iblocklist
# download
fetch -o qlprgwgdkojunfdlzsiv.gz [iblocklists-hosts]
# extract
gunzip -f qlprgwgdkojunfdlzsiv.gz
# Remove lines which do not matter
cat qlprgwgdkojunfdlzsiv | sed '/localhost/d' > BL/iblocklist/domains
cat BL/iblocklist/domains | sed '/^#/d' > BL/iblocklist/domains.temp
# Format it for pfsense
cat BL/iblocklist/domains.temp | sed -r 's/127.0.0.1 //' > BL/iblocklist/domains
# Remove temp file
rm BL/iblocklist/domains.temp
# cybercrime-tracker
# Make category folder
mkdir -p BL/cctracker
# download
fetch [cybercrime-tracker]
# convert to squid url list
cat all.php > BL/cctracker/urls
# create package
tar -caf angpfsense.tar.gz BL
# copy to destination
cp angpfsense.tar.gz /tmp
/tmp/squidGuard_blacklist_update.sh