global('$logpath'); $logpath = "/opt/CS/toolkit/logs/"; if (!-exists $logpath) { mkdir($logpath); } on beacon_output { $bd = bdata($1); local('$out',''); if ("(_ |_ _. ._ ._ | \ |_) /\ |_) | " isin $2) { $out = openf(">>" . "$logpath" . "SharpDPAPI_" . formatDate($3, 'yyyyMMMdd') . "_" . $bd['internal'] . "_" . $bd['computer'] . "_output.log"); println($out, "$2" . "\n"); closef($out); } if ("[*] Finished SharpDPAPI execution" isin $2) { $out = openf(">>" . "$logpath" . "SharpDPAPI_" . formatDate($3, 'yyyyMMMdd') . "_" . $bd['internal'] . "_" . $bd['computer'] . "_output.log"); println($out, "$2" . "\n"); closef($out); } }