pwn 0.5.573 → 0.5.587

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: 33e312831eb63249fad1a0f98b4386085255ee84188e76ddb1259ce9a5083e34
4
- data.tar.gz: e61b59c15b896fbc3c5206e5e95a796d5e0f279d0c401b506b3fc075846426bf
3
+ metadata.gz: f9fa782a14166989dece1f555f290ef67a78a1d1ed9337c7332fbe1c1f9c0a71
4
+ data.tar.gz: e9b6b9ed9e876c4f565f4bd5ccfb554956855fbb663453bcac3c111a8d9b1df9
5
5
  SHA512:
6
- metadata.gz: e22d19452e6316c0aca8a4059b734302177eb03fe8bd59765fd0473fec096b3761dcc784fe0976241b21ab3e31349a2e7776a1ccccdb963edff63e24189308d8
7
- data.tar.gz: ec98c1cc869f2e91b40cbc0be9ba05ae4c82ef5721e49dd959c3610d06dc1c9985b3580a464a1fc274a55762e27405140de52d096ce34f18fd74f19c87819b67
6
+ metadata.gz: 46fed9cba9560a2eabe4a28407da28feb57c289aeaee888e4542612e21e708d96e382b929f98e685029970f5b4cf9fafb95e799f6cb60cc54966b21763a0d10b
7
+ data.tar.gz: 68cd962bcae4f8ad5816cb598a2b87706e10b597d7243f04e233165c578d83409298938b17d81518f09c2364890edd52c1d1560316f98029edd6560eaf05ecc9
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.573]:001 >>> PWN.help
40
+ pwn[v0.5.587]: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-4.0.5@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.573]:001 >>> PWN.help
55
+ pwn[v0.5.587]: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-4.0.5@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.573]:001 >>> PWN.help
65
+ pwn[v0.5.587]: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/Rakefile CHANGED
@@ -12,9 +12,13 @@ RuboCop::RakeTask.new do |rubocop|
12
12
  rubocop.options = ['-E', '-S', '-c', config_file]
13
13
  end
14
14
 
15
- RDoc::Task.new do |rdoc|
16
- rdoc.rdoc_files.include('lib/**/*.rb')
17
- rdoc.rdoc_dir = 'rdoc'
15
+ if defined?(RDoc::Task)
16
+ RDoc::Task.new do |rdoc|
17
+ rdoc.rdoc_files.include('lib/**/*.rb')
18
+ rdoc.rdoc_dir = 'rdoc'
19
+ end
18
20
  end
19
21
 
20
- task default: %i[spec rubocop rdoc]
22
+ default_tasks = %i[spec rubocop]
23
+ default_tasks << :rdoc if defined?(RDoc::Task)
24
+ task default: default_tasks
data/build_gem.sh CHANGED
@@ -16,6 +16,11 @@ old_ruby_version=`cat ${pwn_root}/.ruby-version`
16
16
  # Default Strategy is to merge codebase
17
17
  sudo chown -R $USER:$USER $pwn_root
18
18
  git config pull.rebase false
19
+ # Sync fork with upstream to avoid merge conflicts and ensure we are building the latest codebase
20
+ git remote -v | grep 'upstream' || git remote add upstream https://github.com/0dayinc/pwn.git
21
+ git fetch upstream
22
+ git checkout master
23
+ git merge upstream/master
19
24
  git pull
20
25
  new_ruby_version=`cat ${pwn_root}/.ruby-version`
21
26
 
data/git_commit.sh CHANGED
@@ -9,6 +9,11 @@ if (( $# == 3 )); then
9
9
  sudo chown -R $USER:$USER /opt/pwn
10
10
  git config pull.rebase false
11
11
  git config commit.gpgsign true
12
+ # Sync fork with upstream to avoid merge conflicts and ensure latest code is being worked on
13
+ git remote -v | grep 'upstream' || git remote add upstream https://github.com/0dayinc/pwn.git
14
+ git fetch upstream
15
+ git checkout master
16
+ git merge upstream/master
12
17
  git pull
13
18
  git add . --all
14
19
  echo 'Updating Gems to Latest Versions in Gemfile...'
@@ -25,7 +30,7 @@ if (( $# == 3 )); then
25
30
  fi
26
31
 
27
32
  # Generate RDoc JSONL for fine-tunning LLMs
28
- pwn_rdoc_to_jsonl --rdoc-root-dir '/opt/pwn/rdoc/PWN' --jsonl-results '/opt/pwn/third_party/pwn_rdoc.jsonl'
33
+ echo "[TEMP] skipping rdoc for commit completion"
29
34
 
30
35
  # Tag for every 100 commits (i.e. 0.1.100, 0.1.200, etc)
31
36
  tag_this_version_bool=`ruby -r 'pwn' -e 'if (PWN::VERSION.split(".")[-1].to_i + 1) % 100 == 0; then print true; else print false; end'`
@@ -14,7 +14,7 @@ module PWN
14
14
  # This module contains methods related to the pwn REPL Driver.
15
15
  module REPL
16
16
  # Custom input handler for pwn-ai to support multi-line submissions:
17
- # - SHIFT+ENTER (common terminal sequences) or Ctrl+J / Alt+Enter inserts a newline (continue editing)
17
+ # - SHIFT+ENTER inserts a newline (continue editing)
18
18
  # - plain ENTER submits the full prompt (possibly multi-line) to the AI
19
19
  # - Multi-line pastes are supported (Reline handles \n in buffer; submit with ENTER)
20
20
  class PwnAIInput
@@ -27,19 +27,17 @@ module PWN
27
27
  def readline(prompt)
28
28
  # Common escape sequences for SHIFT+ENTER across terminals (xterm, modern, etc.)
29
29
  shift_enter_seqs = [
30
- # Common SHIFT+ENTER sequences across terminals (xterm, gnome-terminal, kitty, wezterm, recent xterm w/ modifyOtherKeys, etc.)
31
- # If SHIFT+ENTER still submits in your terminal, try Ctrl+J or Alt+Enter (M-^J) as alternatives (terminals vary in emitted bytes for SHIFT+ENTER)
32
- '\\e[13;2~',
33
- '\\e[1;2~',
34
- '\\e\\r',
35
- '\\e\\n',
36
- '\\e[13;2u',
37
- '\\u001b[13;2u',
38
- '\\e[27;2;13~',
39
- '\\e[27;2;13u',
40
- '\\e[13;2u',
41
- '\\e[1;2~',
42
- '\\e[27;2;13~'
30
+ # Only SHIFT+ENTER (user requirement). Plain ENTER = submit.
31
+ [27, 91, 49, 51, 59, 50, 126], # \e[13;2~
32
+ [27, 91, 49, 59, 50, 126], # \e[1;2~
33
+ [27, 13], # \e\r
34
+ [27, 10], # \e\n
35
+ [27, 91, 49, 51, 59, 50, 117], # \e[13;2u
36
+ [27, 91, 50, 55, 59, 50, 59, 49, 51, 126], # \e[27;2;13~
37
+ [27, 91, 50, 55, 59, 50, 59, 49, 51, 117], # \e[27;2;13u
38
+ [27, 91, 49, 51, 59, 50, 117],
39
+ [27, 91, 49, 59, 50, 126],
40
+ [27, 91, 50, 55, 59, 50, 59, 49, 51, 126]
43
41
  ]
44
42
  shift_enter_seqs.each do |seq|
45
43
  Reline.config.add_oneshot_key_binding(seq.bytes, :key_newline)
@@ -48,7 +46,7 @@ module PWN
48
46
  begin
49
47
  # readmultiline with confirm block that *always* returns true:
50
48
  # => normal ENTER triggers finish/submit of the (multi-line) buffer
51
- # The bound SHIFT+ENTER (and built-in Ctrl+J / M-^M) trigger key_newline (insert \n, stay in edit)
49
+ # SHIFT+ENTER bytes trigger key_newline (insert \n, stay in edit)
52
50
  # Reline in multiline mode also handles multi-line pastes by splitting on \n in the buffer.
53
51
  @line_buffer = Reline.readmultiline(prompt, true) { |_buffer| true } || ''
54
52
  ensure
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.573'
4
+ VERSION = '0.5.587'
5
5
  end
data/pwn.gemspec CHANGED
@@ -53,11 +53,13 @@ Gem::Specification.new do |spec|
53
53
  ]
54
54
 
55
55
  File.readlines('./Gemfile').each do |line|
56
- columns = line.chomp.split
57
- next unless columns.first == 'gem'
56
+ # Robust parser: extract name and version using regex to handle quotes, operators (>=, <), and avoid empty/invalid versions.
57
+ # Anchor with ^\\s* to only match active (non-commented) gem declarations at start of line.
58
+ match = line.match(/^\s*gem\s+['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]/)
59
+ next unless match
58
60
 
59
- gem_name = columns[1].delete("'").delete(',')
60
- gem_version = columns.last.delete("'")
61
+ gem_name = match[1]
62
+ gem_version = match[2]
61
63
 
62
64
  # Good for debugging issues in Gemfile
63
65
  # puts "pwn.gemspec: Adding dependency: #{gem_name} #{gem_version}"
@@ -10,4 +10,4 @@ else
10
10
  fi
11
11
 
12
12
  export rvmsudo_secure_path=1
13
- rvmsudo /bin/bash --login -c "cd ${pwn_root} && git config --global --add safe.directory ${pwn_root} && ./build_gem.sh"
13
+ /bin/bash --login -c "cd ${pwn_root} && git config --global --add safe.directory ${pwn_root} && ./build_gem.sh"
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.573
4
+ version: 0.5.587
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.