-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from amerck/master
Added normalizer for UHP
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
import json | ||
from normalizer.modules.basenormalizer import BaseNormalizer | ||
|
||
import sys | ||
|
||
|
||
class RdphoneyEvents(BaseNormalizer): | ||
channels = ('uhp.events',) | ||
|
||
def normalize(self, data, channel, submission_timestamp, ignore_rfc1918=True): | ||
o_data = self.parse_record_data(data) | ||
sys.stdout.write("o_data: %s" % o_data + "\n") | ||
|
||
if ignore_rfc1918 and self.is_RFC1918_addr(o_data['peerIP']): | ||
return [] | ||
|
||
session = { | ||
'timestamp': submission_timestamp, | ||
'source_ip': o_data['src_ip'], | ||
'source_port': o_data['src_port'], | ||
'destination_port': o_data['dest_port'], | ||
'honeypot': 'uhp', | ||
'protocol': o_data['tags'][0], | ||
} | ||
|
||
relations = [{'session': session}, ] | ||
|
||
return relations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters