pwn 0.4.388 → 0.4.391

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 +48 -19
  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: 6fff86c0915ceb8c3bda26566fa0f3c49d5c7bc29f8fad99b72936ea62f0d10f
4
- data.tar.gz: 7fd7e3bbbc60ee0b1bc3b06664bea5efd410aa03cd4dd3ad9c88d3ade03ad709
3
+ metadata.gz: 20f6117dd5a357f49c9cb2319b43b5189eca333b73a2607d0c05124cc685e4c7
4
+ data.tar.gz: e631631795c7b0d4ecc28afb7d544c5b7ad82868a564a6dba4c914a60e477c12
5
5
  SHA512:
6
- metadata.gz: 665f698b87d92a38d761e58cd9e9081fcbe4303cd9b048c06ce954ae0222e9743683ddf95590283e56d738cf4d4c1088a9e6149a26176850bbfb4eeba18527e9
7
- data.tar.gz: c954551ab4b906f75b8c575ec04b733c30cf98030aad0b7aceee001a3095d28abbad8facd5736895568a2381d87b92de314ec3d885361cf2da4410166e26aee3
6
+ metadata.gz: 82d47c1278b2d7dabb9740beb4dec9bbc20b472dcf368d5dca5e3552ad201cc70d0bad0ac4bf36ac196342e3ccf0ee353e63f4250a31bcaab797e6bf4275a4eb
7
+ data.tar.gz: a60120db35b707cd6e2678c88c89d702117a4473764708507106e9b42bd41e79090a6b533e977610363fae0e8b943c7f4483fe75492dcfbab70799354512ea9a
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.388]:001 >>> PWN.help
40
+ pwn[v0.4.391]: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.388]:001 >>> PWN.help
55
+ pwn[v0.4.391]: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,22 @@ begin
35
37
  end
36
38
  end
37
39
 
40
+ prompt = TTY::Prompt.new
41
+ reader = TTY::Reader.new
42
+
38
43
  cli = Pry
44
+ cli.config.hooks.add_hook(:before_session, :welcome) do |output, _binding, _pry|
45
+ output.puts 'Use the #help method for more options.'
46
+ output.puts 'e.g PWN.help'
47
+ output.puts 'e.g PWN::Plugins.help'
48
+ output.puts 'e.g PWN::Plugins::TransparentBrowser.help'
49
+ end
39
50
 
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) }
51
+ cli.config.hooks.add_hook(:before_eval, :autocomplete) do |output, _binding, _pry|
52
+ reader.on(:keypress) do |key_event|
53
+ output.puts "Key: #{key_event.inspect}"
54
+ prompt.select('', key_event)
55
+ end
44
56
  end
45
57
 
46
58
  cli::Commands.create_command 'toggle-pager' do
@@ -54,22 +66,39 @@ begin
54
66
  # Custom Main & Wait (Multi-Line) Prompts
55
67
  title = "\001\e[1m\002\001\e[31m\002pwn\001\e[0m\002" # Bold Red
56
68
  version = "\001\e[36m\002v#{PWN::VERSION}\001\e[0m\002" # Cyan
69
+ @line_count = LineCount.new
70
+ @line_count.total = 0
57
71
  arrow = "\001\e[32m\002>>>\001\e[0m\002" # Green
58
72
  splat = "\001\e[33m\002***\001\e[0m\002" # Yellow
59
73
 
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))
74
+ # arrow_ps1_proc = proc do |_target_self, _nest_level, _pry|
75
+ arrow_ps1_proc = proc do
76
+ @line_count.total += 1
77
+ line_pad = format('%0.3d', @line_count.total)
78
+ line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
79
+ "#{title}[#{version}]:#{line_count} #{arrow} ".to_s.scrub
80
+ end
81
+
82
+ # splat_ps1_proc = proc do |_target_self, _nest_level, _pry|
83
+ splat_ps1_proc = proc do
84
+ @line_count.total += 1
85
+ line_pad = format('%0.3d', @line_count.total)
86
+ line_count = "\001\e[34m\002#{line_pad}\001\e[0m\002" # Blue
87
+ "#{title}[#{version}]:#{line_count} #{splat} ".to_s.scrub
88
+ end
89
+
90
+ prompt_ps1 = [arrow_ps1_proc, splat_ps1_proc]
91
+
92
+ pwn_prompt = Pry::Prompt.new(
93
+ :pwn,
94
+ 'PWN_PROTOTYPING_DRIVER',
95
+ prompt_ps1
96
+ )
97
+
98
+ cli.start(
99
+ self,
100
+ prompt: pwn_prompt
101
+ )
73
102
  rescue StandardError => e
74
103
  raise e
75
104
  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.388'
4
+ VERSION = '0.4.391'
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.388
4
+ version: 0.4.391
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