Skip to content

Commit cae9f49

Browse files
author
Sebastian Wagner
committed
BUG: cymru cap parser: add support for 2 protocols
47 (GRE) and 59 (IPv6-NoNxt)
1 parent 5fa1ee9 commit cae9f49

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CHANGELOG
1616
#### Collectors
1717

1818
#### Parsers
19+
- `intelmq.bots.parsers.cymru.parser_cap_program`: Add support for protocols 47 (GRE) and 59 (IPv6-NoNxt).
1920

2021
#### Experts
2122

intelmq/bots/parsers/cymru/parser_cap_program.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535
}
3636
MAPPING_COMMENT = {'bruteforce': ('classification.identifier', 'protocol.application'),
3737
'phishing': ('source.url', )}
38-
PROTOCOL_MAPPING = { # TODO: use getent in harmonization
38+
PROTOCOL_MAPPING = { # TODO: use `getent protocols <number>`, maybe in harmonization
3939
'1': 'icmp',
4040
'6': 'tcp',
4141
'11': 'nvp-ii',
4242
'17': 'udp',
43+
'47': 'gre',
44+
'59': 'ipv6-nonxt',
4345
}
4446
BOGUS_HOSTNAME_PORT = re.compile('hostname: ([^:]+)port: ([0-9]+)')
4547
DESTINATION_PORT_NUMBERS_TOTAL = re.compile(r' \(total_count:\d+\)$')

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ phishing|172.16.0.21|64496|2019-10-23 12:46:18||Example AS Name, AT
3030
darknet|172.16.0.21|64496|2020-01-10 09:17:17|destination_port_numbers: 0;protocol: 11;|Example AS Name, AT
3131
conficker|172.16.0.21|64496|2020-05-08 09:13:34|srcport: 1997; destaddr: 172.16.0.22;|Example AS Name, AT
3232
scanner|172.16.0.21|64496|2020-07-09 03:40:15|username: pm;|Example AS Name, AT
33+
darknet|172.16.0.21|64496|2020-10-08 02:21:26|protocol: 47;|Example AS Name, AT
34+
darknet|172.16.0.21|64496|2020-10-15 09:22:10|protocol: 59;|Example AS Name, AT

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,21 @@
203203
'time.source': '2020-07-09T03:40:15+00:00',
204204
'source.account': 'pm',
205205
},
206+
{'classification.type': 'scanner',
207+
'classification.identifier': 'darknet',
208+
'time.source': '2020-10-08T02:21:26+00:00',
209+
'protocol.transport': 'gre',
210+
},
211+
{'classification.type': 'scanner',
212+
'classification.identifier': 'darknet',
213+
'time.source': '2020-10-15T09:22:10+00:00',
214+
'protocol.transport': 'ipv6-nonxt',
215+
},
206216
]
207217

208218
# The number of events a single line in the raw data produces
209-
NUM_EVENTS = [1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
210-
1, 1, 10, 1, 1, 1, 1, 1]
219+
NUM_EVENTS = (1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
220+
1, 1, 10, 1, 1, 1, 1, 1, 1, 1)
211221
RAWS = []
212222
for i, line in enumerate(RAW_LINES[3:]):
213223
for count in range(NUM_EVENTS[i]):

0 commit comments

Comments
 (0)