enumshares.cna 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # author REDMED-X
  2. beacon_command_register(
  3. "enumshares", "List remote shares and there access level using a predefined list with hostnames.",
  4. "INFO:\nList remote shares and there access level based on a list with predefined hostnames or IP addresses. The list is loaded from your own attacker system.\n\n" .
  5. "ARGUMENTS:\n[<path to file>]: the path on your own attacker system to the file containing the list with predefined hostnames. Each hostname must be newline separated.\n\n" .
  6. "USAGE:\nenumshares <path to hostname file>\n\n" .
  7. "EXAMPLES:\nenumshares C:\\Users\\RTO\\Documents\\hostnames.txt\n\n");
  8. alias enumshares {
  9. $bid = $1;
  10. $path = $2;
  11. if ($path eq "") {
  12. berror($bid, "Please specify the path on your own attacker system to the file containing the list with newline separated hostnames.\n");
  13. return;
  14. }
  15. # read in the .txt file
  16. $handle = openf("$path");
  17. $file = readb($handle, -1);
  18. closef($handle);
  19. blog($bid, "path: $+ $path");
  20. # Read in the right BOF file
  21. $handle = openf(script_resource("enumshares.o"));
  22. $data = readb($handle, -1);
  23. closef($handle);
  24. # Pack our arguments
  25. $arg_data = bof_pack($bid, "b", $file);
  26. blog($bid, "Tasked to enumerate remote shares..");
  27. beacon_inline_execute($bid, $data, "go", $arg_data);
  28. }