mentat.idea.test_jsondict module

Unit test module for testing the mentat.idea.jsondict module.

class mentat.idea.test_jsondict.TestMentatIdeaJSON(methodName='runTest')[source]

Bases: unittest.case.TestCase

Unit test class for testing the mentat.idea.jsondict module.

idea_raw = {'Attach': [{'Content': 'TVpqdXN0a2lkZGluZwo=', 'Size': 46, 'Hash': ['sha1:0c4a38c3569f0cc632e74f4c'], 'Type': ['Malware'], 'ContentEncoding': 'base64', 'ContentType': 'application/octet-stream', 'FileName': ['killemall'], 'Handle': 'att1', 'Ref': ['Trojan-Spy:W32/FinSpy.A']}], 'Category': ['Fraud.Phishing'], 'CeaseTime': '2012-11-03T09:55:22Z', 'Confidence': 1.0, 'ConnCount': 20, 'CreateTime': '2012-11-03T10:00:02Z', 'DetectTime': '2012-11-03T10:00:07Z', 'EventTime': '2012-11-03T07:36:00Z', 'Format': 'IDEA0', 'ID': '4390fc3f-c753-4a3e-bc83-1b44f24baf75', 'Node': [{'Name': 'org.example.kippo_honey', 'Realm': 'cesnet.cz', 'Tags': ['Protocol', 'Honeypot'], 'SW': ['Kippo'], 'AggrWin': '00:05:00'}], 'Note': 'Synthetic example', 'Ref': ['cve:CVE-1234-5678'], 'Source': [{'Proto': ['tcp', 'http'], 'IP6': ['2001:db8::ff00:42:0/112'], 'Netname': ['ripe:IANA-CBLK-RESERVED1'], 'URL': ['http://example.com/cgi-bin/killemall'], 'Hostname': ['example.com'], 'IP4': ['192.168.0.2-192.168.0.5', '192.168.0.0/25'], 'Type': ['Phishing'], 'AttachHand': ['att1']}], 'Target': [{'Spoofed': True, 'Type': ['Backscatter', 'OriginSpam'], 'Email': ['innocent@example.com']}, {'Anonymised': True, 'IP4': ['10.2.2.0/24'], 'Type': ['CasualIP'], 'Port': [22, 25, 443]}], 'WinEndTime': '2012-11-03T10:00:00Z', 'WinStartTime': '2012-11-03T05:00:00Z', '_CESNET': {'EventClass': 'vulnerable-config-ssdp', 'EventTemplate': 'sserv-012', 'Impact': 'System provides SDDP service and can be misused for massive DDoS attack', 'ResolvedAbuses': ['abuse@cesnet.cz'], 'StorageTime': '2017-04-05T10:21:39Z'}}
test_01_convert_timestamp()[source]

Perfom isolated Timestamp conversion tests.

test_02_convert_net4()[source]

Perfom isolated Net4 conversion tests.

test_03_convert_net6()[source]

Perfom isolated Net6 conversion tests.

test_04_conv_internal()[source]

Perform basic parsing and conversion tests from menat.idea.internal.Idea class messages. For the purposes of comparison, the menat.idea.internal.Idea class is also tested here.

verbose = False