-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathconfig.yml
308 lines (293 loc) · 9.39 KB
/
config.yml
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# full rules configuration info can be found here:
# https://github.com/D00Movenok/BounceBack/wiki/1.-Rules
rules:
# "ip" rule fires only when "list" contains INGRESS IP address.
# May be combined with "not" wrapper for allowlist.
# PARAMS:
# * list - path to file with IP addresses or/and subnets.
#
- name: default_ip_banlist
type: ip
params:
list: data/banned_ips.txt
- name: default_ip_allowlist
type: not::ip
params:
list: data/allowed_ips.txt
- name: default_ip_acceptlist
type: ip
params:
list: data/allowed_ips.txt
# "geo" rule fires only either when ANY geolocation lookup element matches
# with ANY regexp from "list" OR when geolocation fully matches with
# ANY "geolocations" array element.
# May be combined with "not" wrapper for organisations allowlist.
# Now supported IP lookup services. How to check IP info:
# * ip-api.com: curl -s 'http://ip-api.com/json/TARGET-IP'
# * ipapi.co: curl -s 'https://ipapi.co/TARGET-IP/json/'
# May be used with api keys (or with free plan), see "globals" config section.
# PARAMS:
# * list - path to file with regexps (regexp re2), may be empty.
# * geolocations - ARRAY of geolocations to match. All fields are re2
# regexps arrays. Empty arrays will be ignored.
# Only one regexp must match in each field.
# Geolocations array elements contain next ARRAY-fields:
# * organisation - organisation name (ORG, ISP and AS (if contains company name)).
# * country_code - country code (https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes).
# * country - country name.
# * region_code - region code.
# * region - region name.
# * city - city name.
# * timezone - timezone in format of Europe/Berlin.
# * asn - ASN in format of "AS\d+".
#
- name: default_geo_rule
type: geo
params:
list: data/banned_words.txt
# geolocations:
# - organisation:
# - (?i)microsoft
# - (?i)kaspersky
# country_code:
# country:
# region_code:
# region:
# city:
# timezone:
# asn:
# "reverse_lookup" rule fires only when DNS PTR answer matches
# with any regexp from "list". Can be used for domain banlist.
# May be combined with "not" wrapper/rule for domain allowlist.
# PARAMS:
# * dns - dns server to send PTR request if form of ip:port.
# * list - path to file with regexps (regexp re2).
#
- name: default_lookup_rule
type: reverse_lookup
params:
dns: 1.1.1.1:53
list: data/banned_words.txt
# "time" rule fires only when time of request is in certain time period.
# May be combined with "and" rule for more than one time periods.
# May be combined with "not" wrapper/rule for time allowlist.
# PARAMS:
# * from - start of time period in form of HH:mm.
# * to - end of time period in form of HH:mm.
# * timezone - timezone of "from" and "to" fields.
# * weekdays - list of time period weekdays, empty == all,
# may be: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
#
- name: example_not_time_rule
type: not::time
params:
from: 08:00
to: 16:00
timezone: Europe/Moscow
weekdays:
# - Monday
# - Tuesday
# - Wednesday
# - Thursday
# - Friday
# - Saturday
# - Sunday
# "regexp" rule fires when any regexp from "list" matches raw request.
# PARAMS:
# * list - path to file with regexps (regexp re2).
#
- name: default_regexp_rule
type: regexp
params:
list: data/banned_words.txt
# "malleable" rule fires only when HTTP(s) request did not
# match MalleableC2 profile.
# May be combined with "and" rule to use more than one profile.
# Rule algorithm:
# 1. Verify useragent lists:
# a. UA did not match "block_useragents" (if not empty).
# b. UA matched "allow_useragents" (if not empty).
# 2. Allow excluded paths.
# 3. Verify useragent match (if not empty).
# 4. Any verified:
# a. Verify any "http-get" or "http-post" profile:
# i. HTTP method match.
# ii. Any URI match.
# iii. All parameters exist.
# iv. All headers exist.
# v. Validate encoding in "out", "id", "metadata" fields.
# b. Verify any "http-stager" (like previous letter) or other
# stager paths (full MSF compatibility) if "host_stage" flag set.
# PARAMS:
# * profile - path to MalleableC2 profile.
# * exclude - array of exluded paths (regexp re2).
#
- name: example_malleable_rule
type: malleable
params:
profile: data/default.profile
exclude:
- ^/some/example/.*
- ^/some/other/example/url
# "and" rule equals boolean AND.
# It fires only when ALL passed rules fire.
# PARAMS:
# * rules - names of rules defined above that rule.
#
- name: and_usage_example
type: and
params:
rules:
- default_ip_banlist
- default_ip_allowlist
# "or" rule equals boolean OR.
# It fires when ANY passed rule fires.
# PARAMS:
# * rules - names of rules defined above that rule.
#
- name: or_usage_example
type: or
params:
rules:
- default_ip_banlist
- default_ip_allowlist
# "not" rule equals boolean NOT.
# It fires only when passed rule does NOT fire.
# May be used as BASE (type: not) rule
# or WRAPPER rule (type: not::someruletype).
# PARAMS for BASE rule:
# * rule - name of the rule defined above that rule.
#
- name: not_usage_example
type: not
params:
rule: default_ip_allowlist
# full globals configuration info can be found here:
# https://github.com/D00Movenok/BounceBack/wiki/3.-Globals
globals:
# API keys that will be used to fetch geo info with "geo" rules.
ip-apicom_key: "" # optional
ipapico_key: "" # optional
# full proxies configuration info can be found here:
# https://github.com/D00Movenok/BounceBack/wiki/2.-Proxies
proxies:
- name: example http proxy
type: http
listen: 0.0.0.0:80
target: http://127.0.0.1:8080
timeout: 10s
# tls:
# - cert: test/testdata/tls/cert_bounceback_test.pem
# key: test/testdata/tls/key_bounceback_test.pem
# - cert: test/testdata/tls/cert_example_com.pem
# key: test/testdata/tls/key_example_com.pem
# - cert: test/testdata/tls/cert_example_com.pem
# key: test/testdata/tls/key_example_com.pem
# domains:
# - "anotherexample.org"
# - "*.anotherexample.org"
filter_settings:
reject_action: redirect
reject_url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
noreject_threshold: 5
reject_threshold: 5
filters:
- rule: default_ip_acceptlist
action: accept
- rule: default_ip_banlist
action: reject
# - rule: default_ip_allowlist
# action: reject
- rule: default_geo_rule
action: reject
- rule: default_lookup_rule
action: reject
# - rule: example_not_time_rule
# action: reject
- rule: default_regexp_rule
action: reject
# - rule: example_malleable_rule
# action: reject
- name: example dns proxy
type: dns
listen: 0.0.0.0:53
target: 127.0.0.1:50053
timeout: 10s
filter_settings:
reject_action: proxy
reject_url: 1.1.1.1:53
noreject_threshold: 5
reject_threshold: 5
filters:
- rule: default_ip_acceptlist
action: accept
- rule: default_ip_banlist
action: reject
# - rule: default_ip_allowlist
# action: reject
- rule: default_geo_rule
action: reject
- rule: default_lookup_rule
action: reject
# - rule: example_not_time_rule
# action: reject
- rule: default_regexp_rule
action: reject
- name: example tcp proxy
type: tcp
listen: 0.0.0.0:4443
target: tcp://127.0.0.1:4444
timeout: 10s
# tls:
# - cert: test/testdata/tls/cert_bounceback_test.pem
# key: test/testdata/tls/key_bounceback_test.pem
# - cert: test/testdata/tls/cert_example_com.pem
# key: test/testdata/tls/key_example_com.pem
# - cert: test/testdata/tls/cert_example_com.pem
# key: test/testdata/tls/key_example_com.pem
# domains:
# - "anotherexample.org"
# - "*.anotherexample.org"
filter_settings:
reject_action: drop
noreject_threshold: 5
reject_threshold: 5
filters:
- rule: default_ip_acceptlist
action: accept
- rule: default_ip_banlist
action: reject
# - rule: default_ip_allowlist
# action: reject
- rule: default_geo_rule
action: reject
- rule: default_lookup_rule
action: reject
# - rule: example_not_time_rule
# action: reject
- rule: default_regexp_rule
action: reject
- name: example udp proxy
type: udp
listen: 0.0.0.0:4445
target: 127.0.0.1:4446
timeout: 10s
filter_settings:
reject_action: none
noreject_threshold: 5
reject_threshold: 5
filters:
- rule: default_ip_acceptlist
action: accept
- rule: default_ip_banlist
action: reject
# - rule: default_ip_allowlist
# action: reject
- rule: default_geo_rule
action: reject
- rule: default_lookup_rule
action: reject
# - rule: example_not_time_rule
# action: reject
- rule: default_regexp_rule
action: reject