psremote.cna 821 B

123456789101112131415161718192021222324252627282930313233
  1. # author REDMED-X
  2. beacon_command_register(
  3. "psremote", "List all running processes on a remote host.\n",
  4. "INFO:\nGet a list of all processes running on the remote host.\n\n" .
  5. "USAGE:\npsremote <FQDN or IP remote host>\n\n");
  6. alias psremote {
  7. local('$handle $data $args');
  8. # figure out the arch of this session
  9. $bid = $1;
  10. $remotehost = $2;
  11. if ($remotehost eq "") {
  12. berror($bid, "Please make sure that the FQDN or IP of the remote host is specified.");
  13. return;
  14. }
  15. # read in the right BOF file
  16. $handle = openf(script_resource("psremote.o"));
  17. $data = readb($handle, -1);
  18. closef($handle);
  19. # pack our arguments
  20. $arg_data = bof_pack($1, "z", $remotehost);
  21. # execute it.
  22. blog($bid, "Tasked to list processes of host: $+ $remotehost");
  23. beacon_inline_execute($bid, $data, "go", $arg_data);
  24. }