psremote.cna 787 B

1234567891011121314151617181920212223242526272829
  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. $bid = $1;
  8. $remotehost = $2;
  9. if ($remotehost eq "") {
  10. berror($bid, "Please make sure that the FQDN or IP of the remote host is specified.");
  11. return;
  12. }
  13. # read in the right BOF file
  14. $handle = openf(script_resource("psremote.o"));
  15. $data = readb($handle, -1);
  16. closef($handle);
  17. # pack our arguments
  18. $arg_data = bof_pack($bid, "z", $remotehost);
  19. blog($bid, "Tasked to list processes of host: $+ $remotehost");
  20. beacon_inline_execute($bid, $data, "go", $arg_data);
  21. }