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

Version Path
pwn-0.5.214 bin/pwn
pwn-0.5.213 bin/pwn
pwn-0.5.212 bin/pwn
pwn-0.5.211 bin/pwn
pwn-0.5.210 bin/pwn
pwn-0.5.209 bin/pwn
pwn-0.5.207 bin/pwn
pwn-0.5.206 bin/pwn
pwn-0.5.205 bin/pwn
pwn-0.5.204 bin/pwn
pwn-0.5.203 bin/pwn
pwn-0.5.202 bin/pwn
pwn-0.5.201 bin/pwn
pwn-0.5.200 bin/pwn
pwn-0.5.199 bin/pwn
pwn-0.5.198 bin/pwn
pwn-0.5.197 bin/pwn
pwn-0.5.196 bin/pwn
pwn-0.5.195 bin/pwn
pwn-0.5.194 bin/pwn