pwn 0.4.390 → 0.4.394

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/bin/pwn +35 -40
  4. data/lib/pwn/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1980f14b63483ec6b681ecbe3c97b18acfe587b73a3bb94cc08a6ff6cc9a940e
4
- data.tar.gz: b8aedccf9888c441752213c20cf93281755c4e01a0e3902c7b00a5d1c57eeaf1
3
+ metadata.gz: 00fdd984c56c17e08366de15f8d1627da1a6fb193e55b6eb7a3648f75ab457e5
4
+ data.tar.gz: 8807dcbe516537df70d8e3e73db1f0431b1390e3395a46bce5c0fc10b0d3499e
5
5
  SHA512:
6
- metadata.gz: ba09da802442ca21edf0ce271dbc68a81e30fa410e01c8d85f6c54e9dcc068702314d69215d048f87b26ba20d0cd886d8268c42f384dbaac3c6084c66932bd57
7
- data.tar.gz: eb03adcd9751694fca6fe5023c3000ed1ec88158bf8236dc0a271a8e8bbe0deb3c95448b88c9babdddb916dcb5ee16111c689ccb065381030709e5b0dddcd48a
6
+ metadata.gz: 10a1926b599089ccc218a5cac4e60570cd7d9fb27a8ae39d6ab0fc170a24dcf4242f3d504e2ef023fb2c8b62150fe4bfa982bdb44cbbff4a88f8553626e09b40
7
+ data.tar.gz: 1571134fce31b0218649722d6535d9918af3351f8e3a2cb40fadb3fb8b2a9ecfd554d713bc3662f01ada558294b7ca1e3464faf195867ceb60020378fdb0b69e
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.1@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.390]:001 >>> PWN.help
40
+ pwn[v0.4.394]: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.1.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.390]:001 >>> PWN.help
55
+ pwn[v0.4.394]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn CHANGED
@@ -7,8 +7,24 @@ require 'tty-prompt'
7
7
  require 'tty-reader'
8
8
 
9
9
  begin
10
- class LineCount
11
- attr_accessor :total
10
+ def gen_ps1_proc(opts = {})
11
+ delim = opts[:delim]
12
+
13
+ # Custom Main & Wait (Multi-Line) Prompts
14
+ title = "\001\e[1m\002\001\e[31m\002pwn\001\e[0m\002" # Bold Red
15
+ version = "\001\e[36m\002v#{PWN::VERSION}\001\e[0m\002" # Cyan
16
+ dchars = "\001\e[32m\002>>>\001\e[0m\002" # Green
17
+ dchars = "\001\e[33m\002***\001\e[0m\002" if delim == :splat # Yellow
18
+
19
+ proc do |_target_self, _nest_level, pry|
20
+ pry.config.pwn_repl_line += 1
21
+ line_pad = format(
22
+ '%0.3d',
23
+ pry.config.pwn_repl_line
24
+ )
25
+ line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
26
+ "#{title}[#{version}]:#{line_count} #{dchars} ".to_s.scrub
27
+ end
12
28
  end
13
29
 
14
30
  class Pry
@@ -24,8 +40,6 @@ begin
24
40
  last_line = nil
25
41
  end
26
42
 
27
- # return line if line == last_line
28
-
29
43
  @history << line
30
44
  @history_line_count += 1
31
45
  @saver.call(line) if !should_ignore?(line) &&
@@ -37,49 +51,30 @@ begin
37
51
  end
38
52
  end
39
53
 
40
- prompt = TTY::Prompt.new
41
- reader = TTY::Reader.new
42
-
43
- cli = Pry
44
- cli.config.hooks.add_hook(:before_eval, :autocomplete) do |output, _binding, _pry|
45
- reader.on(:keypress) do |key_event|
46
- output.puts "Key: #{key_event.inspect}"
47
- prompt.select('', key_event)
48
- end
54
+ Pry.config.prompt_name = :pwn
55
+ Pry.config.pwn_repl_line = 0
56
+ Pry.config.tty_prompt = TTY::Prompt.new
57
+ Pry.config.tty_reader = TTY::Reader.new
58
+
59
+ Pry.config.hooks.add_hook(:before_session, :welcome) do |output, _binding, _pry|
60
+ output.puts 'Use the #help method for more options.'
61
+ output.puts 'e.g help'
62
+ output.puts 'e.g PWN.help'
63
+ output.puts 'e.g PWN::Plugins.help'
64
+ output.puts 'e.g PWN::Plugins::TransparentBrowser.help'
49
65
  end
50
66
 
51
- cli::Commands.create_command 'toggle-pager' do
67
+ Pry::Commands.create_command 'toggle-pager' do
52
68
  description 'Toggle less on returned objects surpassing the terminal.'
53
69
 
54
70
  def process
55
- _pry_.config.pager ? _pry_.config.pager = false : _pry_.config.pager = true
71
+ pi = pry_instance
72
+ pi.config.pager ? pi.config.pager = false : pi.config.pager = true
56
73
  end
57
74
  end
58
75
 
59
- # Custom Main & Wait (Multi-Line) Prompts
60
- title = "\001\e[1m\002\001\e[31m\002pwn\001\e[0m\002" # Bold Red
61
- version = "\001\e[36m\002v#{PWN::VERSION}\001\e[0m\002" # Cyan
62
- @line_count = LineCount.new
63
- @line_count.total = 0
64
- arrow = "\001\e[32m\002>>>\001\e[0m\002" # Green
65
- splat = "\001\e[33m\002***\001\e[0m\002" # Yellow
66
-
67
- # arrow_ps1_proc = proc do |_target_self, _nest_level, _pry|
68
- arrow_ps1_proc = proc do
69
- @line_count.total += 1
70
- line_pad = format('%0.3d', @line_count.total)
71
- line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
72
- "#{title}[#{version}]:#{line_count} #{arrow} ".to_s.scrub
73
- end
74
-
75
- # splat_ps1_proc = proc do |_target_self, _nest_level, _pry|
76
- splat_ps1_proc = proc do
77
- @line_count.total += 1
78
- line_pad = format('%0.3d', @line_count.total)
79
- line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
80
- "#{title}[#{version}]:#{line_count} #{splat} ".to_s.scrub
81
- end
82
-
76
+ arrow_ps1_proc = gen_ps1_proc
77
+ splat_ps1_proc = gen_ps1_proc(delim: :splat)
83
78
  prompt_ps1 = [arrow_ps1_proc, splat_ps1_proc]
84
79
 
85
80
  pwn_prompt = Pry::Prompt.new(
@@ -88,7 +83,7 @@ begin
88
83
  prompt_ps1
89
84
  )
90
85
 
91
- cli.start(
86
+ Pry.start(
92
87
  self,
93
88
  prompt: pwn_prompt
94
89
  )
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.4.390'
4
+ VERSION = '0.4.394'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.390
4
+ version: 0.4.394
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-01 00:00:00.000000000 Z
11
+ date: 2022-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport