dellocalcert.cna 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # author REDMED-X
  2. beacon_command_register(
  3. "dellocalcert", "Delete a local computer certificate from a specific store.",
  4. "INFO:\nDelete a local computer certificate from a specified store based on its unique thumbprint.\n\n" .
  5. "ARGUMENTS:\n[<store name>]: the name of the certificate store from which to delete the certificate.\n[<thumbprint>]: the thumbprint of the certificate that you want to delete in format (all caps): AABBCCDDEEFF00112233445566778899AABBCCDD.\n\n" .
  6. "USAGE:\ndellocalcert <store name> <thumbprint>\n\n" .
  7. "EXAMPLES:\ndellocalcert ROOT AABBCCDDEEFF00112233445566778899AABBCCDD\n\n");
  8. alias dellocalcert {
  9. $bid = $1;
  10. $store = $2;
  11. $thumbprint = $3;
  12. if ($store eq "") {
  13. berror($bid, "Please specify a valid local computer certificate store name like ROOT.\n");
  14. return;
  15. }
  16. if ($thumbprint eq "") {
  17. berror($bid, "Please specify the thumbprint for the certificate that you want to delete from the store.\n");
  18. return;
  19. }
  20. # Read in the right BOF file
  21. $handle = openf(script_resource("dellocalcert.o"));
  22. $data = readb($handle, -1);
  23. closef($handle);
  24. # Pack our arguments
  25. $arg_data = bof_pack($bid, "Zz", $store, $thumbprint);
  26. blog($bid, "Tasked to delete a certificate..");
  27. beacon_inline_execute($bid, $data, "go", $arg_data);
  28. }