Skip to content

Commit 93048e7

Browse files
committed
Change Sentrypeer Logformat
1 parent 96a6e9b commit 93048e7

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
USERNAME="trixam"
22
NAME="ewsposter"
3-
VERSION="1.31"
3+
VERSION="1.33"
44

55
AUTHOR="markus.schroer <markus.schroer@telekom.de>"
66
DESCRIPTION="Collect logs and events from 37 honeypots and send them via EWS protocol to the backend (e.g. geba), hpfeeds or as a json file."

ews.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if __name__ == "__main__":
2222

2323
name = "EWS Poster"
24-
version = "v1.32"
24+
version = "v1.33"
2525

2626
functions = [adbhoney, beelzebub, ciscoasa, citrix, conpot, cowrie, ddospot, dicompot, dionaea,
2727
elasticpot, emobility, endlessh, fatt, galah, glastopfv3, glutton, gopot, h0neytr4p,

honeypots/sentrypeer.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,37 @@ def sentrypeer(ECFG):
2323
if line == 'jsonfail':
2424
continue
2525

26-
sentrypeer.data('analyzer_id', HONEYPOT['nodeid']) if 'nodeid' in HONEYPOT else None
26+
if HONEYPOT.get('nodeid'): sentrypeer.data('analyzer_id', HONEYPOT['nodeid'])
2727

28-
if 'event_timestamp' in line:
28+
if line.get('event_timestamp'):
2929
sentrypeer.data('timestamp', datetime.fromisoformat(line['event_timestamp']).strftime('%Y-%m-%d %H:%M:%S'))
3030
sentrypeer.data("timezone", time.strftime('%z'))
3131

32-
sentrypeer.data('source_address', line['source_ip']) if 'source_ip' in line else None
33-
sentrypeer.data('target_address', line['destination_ip']) if 'destination_ip' in line else None
34-
sentrypeer.data('source_port', '5060')
35-
sentrypeer.data('target_port', '5060')
36-
sentrypeer.data('source_protocol', line['transport_type'].lower()) if 'transport_type' in line else None
37-
sentrypeer.data('target_protocol', line['transport_type'].lower()) if 'transport_type' in line else None
32+
if line.get('source_ip'):
33+
if ':' in line['source_ip']:
34+
ip, port = line['source_ip'].split(':', 1)
35+
sentrypeer.data('source_address', str(ip))
36+
sentrypeer.data('source_port', str(port))
37+
else:
38+
sentrypeer.data('source_address', line['source_ip'])
39+
sentrypeer.data('source_port', '5060')
40+
41+
if line.get('destination_ip'):
42+
if ':' in line['destination_ip']:
43+
ip, port = line['destination_ip'].split(':', 1)
44+
sentrypeer.data('target_address', str(ip))
45+
sentrypeer.data('target_port', str(port))
46+
else:
47+
sentrypeer.data('target_address', line['destination_ip'])
48+
sentrypeer.data('target_port', '5060')
49+
50+
if line.get('transport_type'):
51+
sentrypeer.data('source_protocol', line['transport_type'].lower())
52+
sentrypeer.data('target_protocol', line['transport_type'].lower())
53+
else:
54+
sentrypeer.data('source_protocol', 'udp')
55+
sentrypeer.data('target_protocol', 'udp')
56+
3857

3958
sentrypeer.request('description', 'Sentrypeer Honeypot')
4059

0 commit comments

Comments
 (0)