enumsysmon.cna 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. # author REDMED-X
  2. beacon_command_register(
  3. "enumsysmon", "Verify if Sysmon is running.",
  4. "INFO:\nVerify if Sysmon is running. This can be done by checking the registry or by enumerating Minifilter drivers and search for one that is associated with Sysmon.\n\nOPTIONS:\n[reg]: search the registry to check if Sysmon is present on the system and return the Sysmon service PID if active.\n[driver]: list all the Minifilter drivers on the system to check manually (requires elevated privileges).\n\n" .
  5. "USAGE:\nenumsysmon <reg | driver>\n\n");
  6. alias enumsysmon {
  7. $bid = $1;
  8. $action = $2;
  9. if ($action eq "reg" || $action eq "driver") {
  10. }
  11. else {
  12. berror($bid, "Please specify one of the following enumeration options: reg | driver\n");
  13. return;
  14. }
  15. # Read in the right BOF file
  16. $handle = openf(script_resource("enumsysmon.o"));
  17. $data = readb($handle, -1);
  18. closef($handle);
  19. # Pack our arguments
  20. $arg_data = bof_pack($bid, "z", $action);
  21. blog($bid, "Tasked to find Sysmon..");
  22. beacon_inline_execute($bid, $data, "go", $arg_data);
  23. }