From 7ef322dfe5b12891e8a39e42a34eb4c34ffdf52b Mon Sep 17 00:00:00 2001 From: Papoteur Date: Wed, 4 May 2022 08:37:23 +0200 Subject: Fix reading iptables output --- src/msec/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msec/tools.py b/src/msec/tools.py index f62c1bc..50b9208 100755 --- a/src/msec/tools.py +++ b/src/msec/tools.py @@ -27,8 +27,8 @@ def find_firewall_info(log): firewall_entries = [] try: p = subprocess.run(["iptables", "-S"], capture_output=True) - data = p.stdout - for l in data: + data = p.stdout.decode('utf-8') + for l in data.splitlines(): if l[:3] == "-A ": firewall_entries.append(l.strip()) except: -- cgit v1.2.1