@@ -41,10 +41,12 @@ def test_link_eq(self, ability, executor):
4141 test_executor = executor (name = 'psh' , platform = 'windows' )
4242 test_ability = ability (ability_id = '123' , executors = [test_executor ])
4343 fact = Fact (trait = 'remote.host.fqdn' , value = 'dc' )
44- test_link = Link (command = 'sc.exe \\ dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"' ,
44+ # sc.exe \\dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"
45+ test_link = Link (command = 'c2MuZXhlIFxcZGMgY3JlYXRlIHNhbmRzdmMgYmlucGF0aD0gInM0bmRjNHQuZXhlIC1vcmlnaW5MaW5rSUQgMTExMTExIg==' ,
4546 paw = '123456' , ability = test_ability , id = 111111 , executor = test_executor )
4647 test_link .used = [fact ]
47- test_link2 = Link (command = 'sc.exe \\ dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 222222"' ,
48+ # sc.exe \\dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 222222"
49+ test_link2 = Link (command = 'c2MuZXhlIFxcZGMgY3JlYXRlIHNhbmRzdmMgYmlucGF0aD0gInM0bmRjNHQuZXhlIC1vcmlnaW5MaW5rSUQgMjIyMjIyIg==' ,
4850 paw = '123456' , ability = test_ability , id = 222222 , executor = test_executor )
4951 test_link2 .used = [fact ]
5052 assert test_link == test_link2
@@ -54,31 +56,36 @@ def test_link_neq(self, ability, executor):
5456 test_ability = ability (ability_id = '123' , executors = [test_executor ])
5557 fact_a = Fact (trait = 'host.user.name' , value = 'a' )
5658 fact_b = Fact (trait = 'host.user.name' , value = 'b' )
57- test_link_a = Link (command = 'net user a' , paw = '123456' , ability = test_ability , id = 111111 , executor = test_executor )
59+ # net user a
60+ test_link_a = Link (command = 'bmV0IHVzZXIgYQ==' , paw = '123456' , ability = test_ability , id = 111111 , executor = test_executor )
5861 test_link_a .used = [fact_a ]
59- test_link_b = Link (command = 'net user b' , paw = '123456' , ability = test_ability , id = 222222 , executor = test_executor )
62+ # net user b
63+ test_link_b = Link (command = 'bmV0IHVzZXIgYg==' , paw = '123456' , ability = test_ability , id = 222222 , executor = test_executor )
6064 test_link_b .used = [fact_b ]
6165 assert test_link_a != test_link_b
6266
6367 @mock .patch .object (Link , '_emit_status_change_event' )
6468 def test_no_status_change_event_on_instantiation (self , mock_emit_status_change_method , ability , executor ):
6569 executor = executor ('psh' , 'windows' )
6670 ability = ability (executor = executor )
67- Link (command = 'net user a' , paw = '123456' , ability = ability , executor = executor )
71+ # net user a
72+ Link (command = 'bmV0IHVzZXIgYQ==' , paw = '123456' , ability = ability , executor = executor )
6873 mock_emit_status_change_method .assert_not_called ()
6974
7075 @mock .patch .object (Link , '_emit_status_change_event' )
7176 def test_status_change_event_fired_on_status_change (self , mock_emit_status_change_method , ability , executor ):
7277 executor = executor ('psh' , 'windows' )
7378 ability = ability (executor = executor )
74- link = Link (command = 'net user a' , paw = '123456' , ability = ability , executor = executor , status = - 3 )
79+ # net user a
80+ link = Link (command = 'bmV0IHVzZXIgYQ==' , paw = '123456' , ability = ability , executor = executor , status = - 3 )
7581 link .status = - 5
7682 mock_emit_status_change_method .assert_called_with (from_status = - 3 , to_status = - 5 )
7783
7884 def test_emit_status_change_event (self , event_loop , fake_event_svc , ability , executor ):
7985 executor = executor ('psh' , 'windows' )
8086 ability = ability (executor = executor )
81- link = Link (command = 'net user a' , paw = '123456' , ability = ability , executor = executor , status = - 3 )
87+ # net user a
88+ link = Link (command = 'bmV0IHVzZXIgYQ==' , paw = '123456' , ability = ability , executor = executor , status = - 3 )
8289 fake_event_svc .reset ()
8390
8491 event_loop .run_until_complete (
@@ -99,7 +106,8 @@ def test_emit_status_change_event(self, event_loop, fake_event_svc, ability, exe
99106 def test_link_agent_reported_time_not_present_when_none_roundtrip (self , ability , executor ):
100107 test_executor = executor (name = 'psh' , platform = 'windows' )
101108 test_ability = ability (ability_id = '123' )
102- test_link = Link (command = 'sc.exe \\ dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"' ,
109+ # sc.exe \\dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"
110+ test_link = Link (command = 'c2MuZXhlIFxcZGMgY3JlYXRlIHNhbmRzdmMgYmlucGF0aD0gInM0bmRjNHQuZXhlIC1vcmlnaW5MaW5rSUQgMTExMTExIg==' ,
103111 paw = '123456' , ability = test_ability , executor = test_executor , id = 111111 )
104112 serialized_link = test_link .display
105113 loaded_link = Link .load (serialized_link )
@@ -111,7 +119,8 @@ def test_link_agent_reported_time_present_when_set_roundtrip(self, ability, exec
111119 agent_reported_time = '2021-02-23T11:50:16Z'
112120 test_executor = executor (name = 'psh' , platform = 'windows' )
113121 test_ability = ability (ability_id = '123' )
114- test_link = Link (command = 'sc.exe \\ dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"' ,
122+ # sc.exe \\dc create sandsvc binpath= "s4ndc4t.exe -originLinkID 111111"
123+ test_link = Link (command = 'c2MuZXhlIFxcZGMgY3JlYXRlIHNhbmRzdmMgYmlucGF0aD0gInM0bmRjNHQuZXhlIC1vcmlnaW5MaW5rSUQgMTExMTExIg==' ,
115124 paw = '123456' , ability = test_ability , executor = test_executor , id = 111111 ,
116125 agent_reported_time = BaseService .get_timestamp_from_string (agent_reported_time ))
117126 serialized_link = test_link .display
@@ -126,7 +135,8 @@ def test_link_knowledge_svc_synchronization(self, event_loop, executor, ability,
126135 fact = Fact (trait = 'remote.host.fqdn' , value = 'dc' )
127136 fact2 = Fact (trait = 'domain.user.name' , value = 'Bob' )
128137 relationship = Relationship (source = fact , edge = 'has_admin' , target = fact2 )
129- test_link = Link (command = 'echo "this was a triumph"' ,
138+ # echo "this was a triumph"
139+ test_link = Link (command = 'ZWNobyAidGhpcyB3YXMgYSB0cml1bXBoIg==' ,
130140 paw = '123456' , ability = test_ability , id = 111111 , executor = test_executor )
131141 event_loop .run_until_complete (test_link .create_relationships ([relationship ], None ))
132142 checkable = [(x .trait , x .value ) for x in test_link .facts ]
@@ -144,16 +154,17 @@ def test_create_relationship_source_fact(self, event_loop, ability, executor, op
144154 fact1 = Fact (trait = 'remote.host.fqdn' , value = 'dc' )
145155 fact2 = Fact (trait = 'domain.user.name' , value = 'Bob' )
146156 relationship = Relationship (source = fact1 , edge = 'has_admin' , target = fact2 )
147- link1 = Link (command = 'echo "Bob"' , paw = '123456' , ability = test_ability , id = '111111' , executor = test_executor )
157+ # echo "Bob"
158+ link1 = Link (command = 'ZWNobyAiQm9iIg==' , paw = '123456' , ability = test_ability , id = '111111' , executor = test_executor )
148159 operation = operation (name = 'test-op' , agents = [],
149160 adversary = Adversary (name = 'sample' , adversary_id = 'XYZ' , atomic_ordering = [],
150161 description = 'test' ),
151162 source = Source (id = 'test-source' , facts = [fact1 ]))
152163 event_loop .run_until_complete (data_svc .store (operation .source ))
153164 event_loop .run_until_complete (operation ._init_source ())
154165 event_loop .run_until_complete (link1 .create_relationships ([relationship ], operation ))
155-
156- link2 = Link (command = 'echo "Bob" ' , paw = '789100' , ability = test_ability , id = '222222' , executor = test_executor )
166+ # echo "Bob"
167+ link2 = Link (command = 'ZWNobyAiQm9iIg== ' , paw = '789100' , ability = test_ability , id = '222222' , executor = test_executor )
157168 event_loop .run_until_complete (link2 .create_relationships ([relationship ], operation ))
158169
159170 fact_store_operation_source = event_loop .run_until_complete (knowledge_svc .get_facts (dict (source = operation .source .id )))
@@ -168,7 +179,8 @@ def test_save_discover_seeded_fact_not_in_command(self, event_loop, ability, exe
168179 fact1 = Fact (trait = 'remote.host.fqdn' , value = 'dc' )
169180 fact2 = Fact (trait = 'domain.user.name' , value = 'Bob' )
170181 relationship = Relationship (source = fact1 , edge = 'has_user' , target = fact2 )
171- link = Link (command = 'net user' , paw = '123456' , ability = test_ability , id = '111111' , executor = test_executor )
182+ # net user
183+ link = Link (command = 'bmV0IHVzZXI=' , paw = '123456' , ability = test_ability , id = '111111' , executor = test_executor )
172184 operation = operation (name = 'test-op' , agents = [],
173185 adversary = Adversary (name = 'sample' , adversary_id = 'XYZ' , atomic_ordering = [],
174186 description = 'test' ),
0 commit comments