vilainreport.py
@@ -1,8 +1,12 @@ #!/usr/bin/env python3 # -*- coding:Utf-8 -*- """ Author : Yax https://blogduyax.madyanne.fr/ """ import re import sys import socket pattern = '(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+).*Blacklisting (\d+\.\d+\.\d+\.\d+), reason (.*), return' regex = re.compile(pattern) @@ -120,4 +124,8 @@ for k, v in tcounters.topitems(): if v < 2: break sys.stdout.write("IP {:16}: {}\n".format(k, v)) try: ns = socket.gethostbyaddr(k.strip())[0] except: ns = '?' sys.stdout.write("IP {:16}: {} - {}\n".format(k, v, ns))