pwn 0.5.422 → 0.5.424

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fda4003c5c2b625faae80ac66aa29bd12a7a450e3dc9259cb2d5d82e1d71716
4
- data.tar.gz: 758acc86bc80e1dc4038ee14314025d163fa63d1682bd1cd9c9c2a184332d059
3
+ metadata.gz: 6132f715f6f2e55294823df435cfc144f67137d1ba0757aa9c21585313719e07
4
+ data.tar.gz: fef173b311c91b9cc2de754edb1719d68721fe4963c7007dacdc5928e12c717d
5
5
  SHA512:
6
- metadata.gz: 8db71ed909971e84ce91cc04d3922de9a194c3b2179be7eb56f53ff47ae3e0c1624731cc6ca430ecad984f262968b89fd81146a0ac01e14f20e0b2e6a2b7f802
7
- data.tar.gz: cb1af569edffd8ec983ddb9118b64cf0fc63a0e814de86adc35cfd8d5e39d38427b49228a9cb313c8dab2f393d9d15da6efae94cbc0b6eecdd043fd2f2600386
6
+ metadata.gz: ca41b4491a62fc9c54d1f4e12d9ee06787494ae8810a471419ddda102cff8a0f81f38ff03f5e3153f903f7cf8c9736edc2ad05c3d1375ed894688bf45fab1564
7
+ data.tar.gz: ef2fa3d5fd8f576b1c96932d243c9a3e692e36026832caf3f9736c8e56157cff833deed42eff973932dfebe353ab2bf2d2c5d0b72319eb18901e65f58188ff9b
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
37
37
  $ ./install.sh
38
38
  $ ./install.sh ruby-gem
39
39
  $ pwn
40
- pwn[v0.5.422]:001 >>> PWN.help
40
+ pwn[v0.5.424]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.422]:001 >>> PWN.help
55
+ pwn[v0.5.424]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
  If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.422]:001 >>> PWN.help
65
+ pwn[v0.5.424]:001 >>> PWN.help
66
66
  ```
67
67
 
68
68
  PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'fileutils'
3
4
  require 'pry'
4
5
  require 'tty-prompt'
5
6
  require 'yaml'
@@ -457,6 +458,36 @@ module PWN
457
458
  end
458
459
  end
459
460
 
461
+ Pry::Commands.create_command 'pwn-vault-edit' do
462
+ description 'Edit the pwn.yaml configuration file.'
463
+
464
+ def process
465
+ pi = pry_instance
466
+ yaml_config_path = pi.config.yaml_config_path ||= "#{Dir.home}/pwn.yaml"
467
+ unless File.exist?(yaml_config_path)
468
+ puts "ERROR: pwn.yaml not found: #{yaml_config_path}"
469
+ return
470
+ end
471
+
472
+ decryption_file = pi.config.decryption_file ||= "#{Dir.home}/pwn.decryptor.yaml"
473
+ unless File.exist?(decryption_file)
474
+ puts "ERROR: pwn.decryptor.yaml not found: #{decryption_file}"
475
+ return
476
+ end
477
+ decryptor = YAML.load_file(decryption_file, symbolize_names: true)
478
+ key = decryptor[:key]
479
+ iv = decryptor[:iv]
480
+
481
+ PWN::Plugins::Vault.edit(
482
+ file: yaml_config_path,
483
+ key: key,
484
+ iv: iv
485
+ )
486
+ rescue StandardError => e
487
+ raise e
488
+ end
489
+ end
490
+
460
491
  Pry::Commands.create_command 'toggle-pwn-ai-debug' do
461
492
  description 'Display the response_history object while using pwn.ai'
462
493
 
@@ -507,6 +538,9 @@ module PWN
507
538
  # Initialize pwn.yaml Configuration using :before_session Hook
508
539
  Pry.config.hooks.add_hook(:before_session, :init_opts) do |_output, _binding, pi|
509
540
  opts[:pi] = pi
541
+ Pry.config.yaml_config_path = opts[:yaml_config_path]
542
+ Pry.config.decryption_file = opts[:decryption_file]
543
+
510
544
  PWN::Plugins::Vault.refresh_config_for_repl(opts)
511
545
  end
512
546
 
@@ -652,6 +686,12 @@ module PWN
652
686
  # Monkey Patch Pry, add commands, && hooks
653
687
  PWN::Plugins::MonkeyPatch.pry
654
688
  add_commands
689
+
690
+ pwn_config_root = "#{Dir.home}/.pwn"
691
+ FileUtils.mkdir_p(pwn_config_root)
692
+ opts[:yaml_config_path] ||= "#{pwn_config_root}/pwn.yaml"
693
+ opts[:decryption_file] ||= "#{pwn_config_root}/pwn.decryptor.yaml"
694
+
655
695
  add_hooks(opts)
656
696
 
657
697
  # Define PS1 Prompt
@@ -243,10 +243,9 @@ module PWN
243
243
  public_class_method def self.refresh_config_for_repl(opts = {})
244
244
  yaml_config_path = opts[:yaml_config_path]
245
245
 
246
- return false unless yaml_config_path
246
+ return false unless File.exist?(yaml_config_path)
247
247
 
248
248
  pi = opts[:pi] ||= Pry
249
- raise "ERROR: #{yaml_config_path} does not exist." unless File.exist?(yaml_config_path)
250
249
 
251
250
  is_encrypted = PWN::Plugins::Vault.file_encrypted?(file: yaml_config_path)
252
251
 
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.422'
4
+ VERSION = '0.5.424'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.422
4
+ version: 0.5.424
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.