Sha256: 0c83957ab47065e182c686cb379d06dee57f60b1e793fa384b67753b817c3509

Contents?: true

Size: 1.24 KB

Versions: 68

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

68 entries across 68 versions & 1 rubygems

Version Path
pwn-0.5.235 bin/pwn
pwn-0.5.234 bin/pwn
pwn-0.5.233 bin/pwn
pwn-0.5.232 bin/pwn
pwn-0.5.231 bin/pwn
pwn-0.5.230 bin/pwn
pwn-0.5.229 bin/pwn
pwn-0.5.228 bin/pwn
pwn-0.5.227 bin/pwn
pwn-0.5.226 bin/pwn
pwn-0.5.225 bin/pwn
pwn-0.5.224 bin/pwn
pwn-0.5.223 bin/pwn
pwn-0.5.222 bin/pwn
pwn-0.5.221 bin/pwn
pwn-0.5.220 bin/pwn
pwn-0.5.219 bin/pwn
pwn-0.5.217 bin/pwn
pwn-0.5.216 bin/pwn
pwn-0.5.215 bin/pwn