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 +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/repl.rb +40 -0
- data/lib/pwn/plugins/vault.rb +1 -2
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6132f715f6f2e55294823df435cfc144f67137d1ba0757aa9c21585313719e07
|
4
|
+
data.tar.gz: fef173b311c91b9cc2de754edb1719d68721fe4963c7007dacdc5928e12c717d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
40
|
+
pwn[v0.5.424]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
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.
|
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:
|
data/lib/pwn/plugins/repl.rb
CHANGED
@@ -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
|
data/lib/pwn/plugins/vault.rb
CHANGED
@@ -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