pwn 0.4.387 → 0.4.390

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/README.md +2 -2
  4. data/bin/pwn +42 -20
  5. data/lib/pwn/version.rb +1 -1
  6. metadata +1 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69e0d57c1556e5adb3cfd5afe9c38f43dcf4158ec0dea58b76b05dade6124818
4
- data.tar.gz: 28d847dcf1306254508beb5bed47486762d5051d0251586738619ee443d1fe8b
3
+ metadata.gz: 1980f14b63483ec6b681ecbe3c97b18acfe587b73a3bb94cc08a6ff6cc9a940e
4
+ data.tar.gz: b8aedccf9888c441752213c20cf93281755c4e01a0e3902c7b00a5d1c57eeaf1
5
5
  SHA512:
6
- metadata.gz: a581d275147b239b3b022fdcfb2b436acb3e2bd70489bb59fffc03522645539440d07218c3a8d4502b8015a23e70a3329670ad62d298d57cdc485e0cf1cc4c4c
7
- data.tar.gz: 1575cebddfe1b9d9667afc53f1de79c26e633721c0688c6638dc53eac856e1636f2ea16ebede288a714c5d0c93eb2982ca67d65befbb106458ed6eb6c2807df6
6
+ metadata.gz: ba09da802442ca21edf0ce271dbc68a81e30fa410e01c8d85f6c54e9dcc068702314d69215d048f87b26ba20d0cd886d8268c42f384dbaac3c6084c66932bd57
7
+ data.tar.gz: eb03adcd9751694fca6fe5023c3000ed1ec88158bf8236dc0a271a8e8bbe0deb3c95448b88c9babdddb916dcb5ee16111c689ccb065381030709e5b0dddcd48a
data/Gemfile CHANGED
@@ -47,7 +47,6 @@ gem 'packetfu', '1.1.13'
47
47
  gem 'pdf-reader', '2.9.2'
48
48
  gem 'pg', '1.3.5'
49
49
  gem 'pry', '0.14.1'
50
- gem 'pry-bond', '0.0.1'
51
50
  gem 'pry-doc', '1.3.0'
52
51
  gem 'rake', '13.0.6'
53
52
  gem 'rb-readline', '0.5.5'
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.387]:001 >>> PWN.help
40
+ pwn[v0.4.390]: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.387]:001 >>> PWN.help
55
+ pwn[v0.4.390]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn CHANGED
@@ -3,12 +3,14 @@
3
3
 
4
4
  require 'pwn'
5
5
  require 'pry'
6
- require 'pry_bond'
7
6
  require 'tty-prompt'
8
7
  require 'tty-reader'
9
8
 
10
9
  begin
11
- # TODO: Remove once this feature is available in mainline
10
+ class LineCount
11
+ attr_accessor :total
12
+ end
13
+
12
14
  class Pry
13
15
  # Overwrite Pry::History.push method in History class to get duplicate history entries
14
16
  # in order to properly replay automation in this prototyping driver
@@ -35,12 +37,15 @@ begin
35
37
  end
36
38
  end
37
39
 
38
- cli = Pry
40
+ prompt = TTY::Prompt.new
41
+ reader = TTY::Reader.new
39
42
 
40
- cli.config.hooks.add_hook(:before_eval, :autocomplete) do
41
- prompt = TTY::Prompt.new
42
- reader = TTY::Reader.new
43
- reader.on(:keypress) { |key_event| prompt(key_event) }
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
44
49
  end
45
50
 
46
51
  cli::Commands.create_command 'toggle-pager' do
@@ -54,22 +59,39 @@ begin
54
59
  # Custom Main & Wait (Multi-Line) Prompts
55
60
  title = "\001\e[1m\002\001\e[31m\002pwn\001\e[0m\002" # Bold Red
56
61
  version = "\001\e[36m\002v#{PWN::VERSION}\001\e[0m\002" # Cyan
62
+ @line_count = LineCount.new
63
+ @line_count.total = 0
57
64
  arrow = "\001\e[32m\002>>>\001\e[0m\002" # Green
58
65
  splat = "\001\e[33m\002***\001\e[0m\002" # Yellow
59
66
 
60
- prompt = [
61
- proc do |_target_self, _nest_level, pry|
62
- line_pad = format('%0.3d', pry.input_ring.size)
63
- line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
64
- "#{title}[#{version}]:#{line_count} #{arrow} ".to_s.scrub
65
- end,
66
- proc do |_target_self, _nest_level, pry|
67
- line_pad = format('%0.3d', pry.input_ring.size)
68
- line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
69
- "#{title}[#{version}]:#{line_count} #{splat} ".to_s.scrub
70
- end
71
- ]
72
- cli.start(self, prompt: Pry::Prompt.new(:pwn, 'PWN_PROTOTYPING_DRIVER', prompt))
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
+
83
+ prompt_ps1 = [arrow_ps1_proc, splat_ps1_proc]
84
+
85
+ pwn_prompt = Pry::Prompt.new(
86
+ :pwn,
87
+ 'PWN_PROTOTYPING_DRIVER',
88
+ prompt_ps1
89
+ )
90
+
91
+ cli.start(
92
+ self,
93
+ prompt: pwn_prompt
94
+ )
73
95
  rescue StandardError => e
74
96
  raise e
75
97
  end
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.387'
4
+ VERSION = '0.4.390'
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.4.387
4
+ version: 0.4.390
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -486,20 +486,6 @@ dependencies:
486
486
  - - '='
487
487
  - !ruby/object:Gem::Version
488
488
  version: 0.14.1
489
- - !ruby/object:Gem::Dependency
490
- name: pry-bond
491
- requirement: !ruby/object:Gem::Requirement
492
- requirements:
493
- - - '='
494
- - !ruby/object:Gem::Version
495
- version: 0.0.1
496
- type: :runtime
497
- prerelease: false
498
- version_requirements: !ruby/object:Gem::Requirement
499
- requirements:
500
- - - '='
501
- - !ruby/object:Gem::Version
502
- version: 0.0.1
503
489
  - !ruby/object:Gem::Dependency
504
490
  name: pry-doc
505
491
  requirement: !ruby/object:Gem::Requirement