Skip to content

Commit afbc962

Browse files
author
Greg Lindahl
committed
feat: count blocked but no WAF seen
1 parent e685693 commit afbc962

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

post_robots_http.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
waf_blocked = defaultdict(set)
1919
waf_not_blocked = defaultdict(set)
2020

21+
nowaf_blocked = set()
22+
2123
with open(sys.argv[1], 'rb', buffering=1024*1024) as f:
2224
for line in f:
2325
record = orjson.loads(line)
@@ -36,6 +38,8 @@
3638
if 'Web Application Firewall' in record['kinds']:
3739
for k in record['kinds']['Web Application Firewall']:
3840
waf_blocked[k].add(quads.quad_host)
41+
else:
42+
nowaf_blocked.add(quads.quad_host)
3943

4044
# not blocked
4145
if record['status'] in ('200', '404', '410'):
@@ -140,6 +144,9 @@
140144
pct = round(100 * sum_blocked / (sum_blocked + sum_not_blocked))
141145
print('WAF blocked / not blocked sums', sum_blocked, '/', sum_not_blocked,'('+str(pct)+'%)')
142146

147+
print('blocked but no visible WAF', len(nowaf_blocked))
148+
print(' ', '\n '.join(x for x in nowaf_blocked))
149+
143150
'''
144151
robotstxt
145152
quad count 9757
@@ -168,7 +175,9 @@
168175
WAF blocked / not blocked Stingray Application Firewall (Riverbed / Brocade) 0 / 2 (0%)
169176
WAF blocked / not blocked Wordfence WordPress Plugins 0 / 1 (0%)
170177
WAF blocked / not blocked Zenedge Cybersecurity Suite (Oracle) 0 / 2 (0%)
171-
WAF blocked / not blockd sums 112 850 (12%)
178+
WAF blocked / not blocked sums 112 / 850 (12%)
179+
blocked but no visible WAF 1
180+
quad://philsci.com
172181
173182
robotstxt
174183
quad count 9757

0 commit comments

Comments
 (0)