enumrwx.cna 852 B

123456789101112131415161718192021222324252627282930
  1. # author REDMED-X
  2. beacon_command_register(
  3. "enumrwx", "Enumerate RWX memory regions in a target process.",
  4. "INFO:\nFind processes that already have memory allocated for read/write/execute (like most .NET processes)\n\nOPTIONS:\n[pid]: target process to enumerate\n\n" .
  5. "USAGE:\nenumrwx <pid>\n\n");
  6. alias enumrwx {
  7. $bid = $1;
  8. $pid = $2;
  9. if ($pid eq "") {
  10. berror($bid, "Please make sure that the PID of the target process is specified.");
  11. return;
  12. }
  13. # Read in the right BOF file
  14. $handle = openf(script_resource("enumrwx.o"));
  15. $data = readb($handle, -1);
  16. closef($handle);
  17. # Pack our arguments
  18. $arg_data = bof_pack($bid, "i", $pid);
  19. blog($bid, "Tasked to verify if the target process has RWX memory regions..");
  20. beacon_inline_execute($bid, $data, "go", $arg_data);
  21. }