diff --git a/bgpranking/config/modules/FeodotrackerIPBlockList.json b/bgpranking/config/modules/FeodotrackerIPBlockList.json index fe98413..fb97e56 100644 --- a/bgpranking/config/modules/FeodotrackerIPBlockList.json +++ b/bgpranking/config/modules/FeodotrackerIPBlockList.json @@ -3,5 +3,5 @@ "vendor": "feodotracker", "name": "ipblocklist", "impact": 5, - "parser": ".parsers.abusech" + "parser": ".parsers.abusech_feodo" } diff --git a/bgpranking/parsers/abusech_feodo.py b/bgpranking/parsers/abusech_feodo.py new file mode 100644 index 0000000..0e43956 --- /dev/null +++ b/bgpranking/parsers/abusech_feodo.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +from dateutil.parser import parse +import re +from io import BytesIO + +from typing import List + + +def parse_raw_file(self, f: BytesIO) -> List[bytes]: + self.datetime = parse(re.findall(b'# Last updated: (.*)#\n', f.getvalue())[0]) + return self.extract_ipv4(f.getvalue())