Sha256: 0c83957ab47065e182c686cb379d06dee57f60b1e793fa384b67753b817c3509
Contents?: true
Size: 1.24 KB
Versions: 48
Compression:
Stored size: 1.24 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'optparse' require 'pwn' opts = {} OptionParser.new do |options| options.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts] " options.on('-cPATH', '--yaml-config=PATH', '<Optional - PWN YAML File>') do |p| opts[:yaml_config_path] = p end options.on('-dPATH', '--decryptor=PATH', '<Optional - File Containing Decryption Key && IV>') do |d| opts[:decryption_file] = d end options.on('-kKEY', '--decryption-key=KEY', '<Optional - Decryption Key>') do |k| opts[:key] = k end options.on('-iIV', '--decryption-iv=PATH', '<Optional - Decryption IV>') do |i| opts[:iv] = i end end.parse! begin pwn_pid = Process.pid PWN::Plugins::REPL.start(opts) rescue StandardError => e raise e ensure ps_list_arr = PWN::Plugins::PS.list kid_pids_arr = ps_list_arr.select { |ps_line| ps_line[3] == pwn_pid.to_s } # pp kid_pids_arr grandkid_pids_arr = [] kid_pids_arr.each do |kid_pid| gk_arr = ps_list_arr.select { |ps_line| ps_line[3] == kid_pid[2] } gk_arr.each { |gk| grandkid_pids_arr.push(gk) } end # pp grandkid_pids_arr PWN::Plugins::PS.cleanup_pids(pids_arr: grandkid_pids_arr) PWN::Plugins::PS.cleanup_pids(pids_arr: kid_pids_arr) end
Version data entries
48 entries across 48 versions & 1 rubygems