enumwebclient.cna 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # author REDMED-X
  2. beacon_command_register(
  3. "enumwebclient", "Find running WebClient services.",
  4. "INFO:\nFind hosts with the WebClient service running 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[debug]: optional argument to include hostnames in the output that couldn't be reached or on which the WebClient was not running.\n\n" .
  6. "USAGE:\nenumwebclient <path to hostname file> [opt:debug]\n\n" .
  7. "EXAMPLES:\nenumwebclient C:\\Users\\redmed\\Documents\\hostnames.txt\nenumwebclient C:\\Users\\redmed\\Documents\\hostnames.txt debug\n\n");
  8. alias enumwebclient {
  9. $bid = $1;
  10. $path = $2;
  11. $debug = $3;
  12. if ($path eq "") {
  13. berror($bid, "Please specify the path on your own attacker system to the file containing the list with newline separated hostnames.\n");
  14. return;
  15. }
  16. # read in the .txt file
  17. $handle = openf("$path");
  18. $file = readb($handle, -1);
  19. closef($handle);
  20. blog($bid, "path: $+ $path");
  21. # Read in the right BOF file
  22. $handle = openf(script_resource("enumwebclient.o"));
  23. $data = readb($handle, -1);
  24. closef($handle);
  25. # Pack our arguments
  26. $arg_data = bof_pack($bid, "bz", $file, $debug);
  27. blog($bid, "Tasked to find running WebClient services..");
  28. beacon_inline_execute($bid, $data, "go", $arg_data);
  29. }