MCPcopy Create free account
hub / github.com/PKU-ASAL/Simulated-Data / get_compare_org

Function get_compare_org

ProvDetector/src/core/Data_Preprocessing.py:42–94  ·  view source on GitHub ↗
(org)

Source from the content-addressed store, hash-verified

40 return org_logs
41
42def get_compare_org(org):
43 if isinstance(org, list):
44 c_org_list = []
45 for o in org:
46 c_org = get_compare_org(o)
47 c_org_list.append(c_org)
48 return c_org_list
49 if isinstance(org, dict):
50 c_org = dict()
51 o = org
52 if COMPARE_KEY.event_id in o:
53 c_org[COMPARE_KEY.event_id] = o[COMPARE_KEY.event_id]
54 # if COMPARE_KEY.ppguid in o:
55 # c_org[COMPARE_KEY.ppguid] = o[COMPARE_KEY.ppguid]
56 if COMPARE_KEY.pppath in o:
57 c_org[COMPARE_KEY.pppath] = o[COMPARE_KEY.pppath]
58 # if COMPARE_KEY.ppmd5 in o:
59 # c_org[COMPARE_KEY.ppmd5] = o[COMPARE_KEY.ppmd5]
60 if COMPARE_KEY.ppcommand in o:
61 c_org[COMPARE_KEY.ppcommand] = o[COMPARE_KEY.ppcommand]
62 # if COMPARE_KEY.puser in o:
63 # c_org[COMPARE_KEY.puser] = o[COMPARE_KEY.puser]
64 # if COMPARE_KEY.ppuser in o:
65 # c_org[COMPARE_KEY.ppuser] = o[COMPARE_KEY.ppuser]
66 # if COMPARE_KEY.pguid in o:
67 # c_org[COMPARE_KEY.pguid] = o[COMPARE_KEY.pguid]
68 if COMPARE_KEY.pfilepath in o:
69 c_org[COMPARE_KEY.pfilepath] = o[COMPARE_KEY.pfilepath]
70 # if COMPARE_KEY.pmd5 in o:
71 # c_org[COMPARE_KEY.pmd5] = o[COMPARE_KEY.pmd5]
72 if COMPARE_KEY.pcommand in o:
73 c_org[COMPARE_KEY.pcommand] = o[COMPARE_KEY.pcommand]
74 # if COMPARE_KEY.pid in o:
75 # c_org[COMPARE_KEY.pid] = o[COMPARE_KEY.pid]
76 if COMPARE_KEY.protocol in o:
77 c_org[COMPARE_KEY.protocol] = o[COMPARE_KEY.protocol]
78 if COMPARE_KEY.srcip in o:
79 c_org[COMPARE_KEY.srcip] = o[COMPARE_KEY.srcip]
80 if COMPARE_KEY.srcport in o:
81 c_org[COMPARE_KEY.srcport] = o[COMPARE_KEY.srcport]
82 if COMPARE_KEY.dstip in o:
83 c_org[COMPARE_KEY.dstip] = o[COMPARE_KEY.dstip]
84 if COMPARE_KEY.dstport in o:
85 c_org[COMPARE_KEY.dstport] = o[COMPARE_KEY.dstport]
86 if COMPARE_KEY.dnsqname in o:
87 c_org[COMPARE_KEY.dnsqname] = o[COMPARE_KEY.dnsqname]
88 if COMPARE_KEY.dnsanswers in o:
89 c_org[COMPARE_KEY.dnsanswers] = o[COMPARE_KEY.dnsanswers]
90 if COMPARE_KEY.dnsstatus in o:
91 c_org[COMPARE_KEY.dnsstatus] = o[COMPARE_KEY.dnsstatus]
92 if COMPARE_KEY.filename in o:
93 c_org[COMPARE_KEY.filename] = o[COMPARE_KEY.filename]
94 return c_org
95
96
97def get_apt_org_log_and_label_warn(org_path, warn_path, attacked_ip):

Calls

no outgoing calls

Tested by

no test coverage detected