(self, blob)
| 11 | self.trait = 'host.ip.address' |
| 12 | |
| 13 | def parse(self, blob): |
| 14 | for ip in re.findall(r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b', blob): |
| 15 | if self._is_valid_ip(ip): |
| 16 | yield Fact.load(dict(trait=self.trait, value=ip)) |
| 17 | |
| 18 | @staticmethod |
| 19 | def _is_valid_ip(raw_ip): |