enumlocalcert.cna 1020 B

123456789101112131415161718192021222324252627282930
  1. # author REDMED-X
  2. beacon_command_register(
  3. "enumlocalcert", "List all the stored local computer certificates from a specific store.",
  4. "INFO:\nList all the stored local computer certificates from a specific store. Common store names are: ROOT, MY, TRUST, CA, USERDS, AuthRoot, Disallowed.\n\n" .
  5. "ARGUMENTS:\n[<store name>]: the name of the certificate store.\n\n" .
  6. "USAGE:\nenumlocalcert <store name>\n\n" .
  7. "EXAMPLES:\nenumlocalcert ROOT\n\n");
  8. alias enumlocalcert {
  9. $bid = $1;
  10. $store = $2;
  11. if ($store eq "") {
  12. berror($bid, "Please specify a valid local computer certificate store name like ROOT.\n");
  13. return;
  14. }
  15. # Read in the right BOF file
  16. $handle = openf(script_resource("enumlocalcert.o"));
  17. $data = readb($handle, -1);
  18. closef($handle);
  19. # Pack our arguments
  20. $arg_data = bof_pack($bid, "Z", $store);
  21. blog($bid, "Tasked to list certificates from the local computer store..");
  22. beacon_inline_execute($bid, $data, "go", $arg_data);
  23. }