Skip to content

Commit 479114d

Browse files
authored
Merge pull request #2621 from monoidic/develop
ENH: add tor mapping and ipv6-icmp protocol to cymru parser
2 parents a98bbfd + 2e9cfa0 commit 479114d

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
2626
#### Collectors
2727

2828
#### Parsers
29+
- `intelmq.bots.parsers.cymru.parser_cap_program`: Add mapping for TOR and ipv6-icmp protocol (PR#2621 by Mikk Margus Möll).
2930

3031
#### Experts
3132
- `intelmq.bots.experts.asn_lookup.expert`: Print URLs to stdout only in verbose mode (PR#2591 by Sebastian Wagner).

intelmq/bots/parsers/cymru/parser_cap_program.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@
3636
'conficker': {'classification.type': 'infected-system',
3737
'classification.identifier': 'conficker',
3838
'malware.name': 'conficker'},
39+
'tor': {'classification.type': 'tor',
40+
'classification.identifier': 'tor'},
3941
}
4042
PROTOCOL_MAPPING = { # TODO: use `getent protocols <number>`, maybe in harmonization
4143
'1': 'icmp',
4244
'6': 'tcp',
4345
'11': 'nvp-ii',
4446
'17': 'udp',
4547
'47': 'gre',
48+
'58': 'ipv6-icmp',
4649
'59': 'ipv6-nonxt',
4750
}
4851
BOGUS_HOSTNAME_PORT = re.compile('hostname: ([^:]+)port: ([0-9]+)')

intelmq/tests/bots/parsers/cymru/certname_20190327.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ proxy|172.16.0.21|64496|2020-12-14 08:28:01|httpconnect-51915; additional_asns:
3636
bruteforce|172.16.0.21|64496|2021-03-09 00:11:21|destination_port_numbers: 22;port: 16794;protocol: 6;|Example AS Name, AT
3737
bot|172.16.0.21|64496|2019-03-22 18:18:52|family: Conficker;hostname: 172.16.0.21|Example AS Name, AT
3838
bot|172.16.0.21|64496|2019-03-22 20:18:52|family: Conficker;hostname: 21-0-16-172.example.tld|Example AS Name, AT
39+
tor|172.16.0.21|64496|2025-07-06 00:15:03|port: 36004;|Example AS Name, AT

intelmq/tests/bots/parsers/cymru/test_cap_program_new.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,17 @@
244244
'source.fqdn': '21-0-16-172.example.tld',
245245
'source.geolocation.cc': 'AT',
246246
},
247+
{
248+
'time.source': '2025-07-06T00:15:03+00:00',
249+
'classification.type': 'tor',
250+
'classification.identifier': 'tor',
251+
'source.port': 36004,
252+
},
247253
]
248254

249255
# The number of events a single line in the raw data produces
250256
NUM_EVENTS = (1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
251-
1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
257+
1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
252258
RAWS = []
253259
for i, line in enumerate(RAW_LINES[3:]):
254260
for count in range(NUM_EVENTS[i]):

0 commit comments

Comments
 (0)