pwn 0.5.221 → 0.5.222

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: 56bc927fefcca786f8646cefaa86fc3a4a342074cdbb645167be70c8b70218ac
4
- data.tar.gz: 5ffc4ae7e039e4229565b083e07eb0fa7e010b9362be2a341220e40d7abb6f47
3
+ metadata.gz: bd6e555a2d8ef7c201ec907f9fc623d2f6c858b55a6c951294c972209a3e83b8
4
+ data.tar.gz: 283f21e8170868880e244160a37ad2dbcd2541671816b053c539e92e6138034c
5
5
  SHA512:
6
- metadata.gz: 9b1a7d34370a7560f7a505ec55e6562e8b4fef8a60e1171b71ea59e1d241b383b41fe4313cabceb08348907b0565a218eb6c6f4c473458b6f251321739d16ed0
7
- data.tar.gz: 2a208a7602c0044fd0a7949ad13fea777a07d3019fd8001726e73517fd01613e622d8a4a8b47a9a144512ef0074f3c387ac5f1951514f86de260bc20658a2600
6
+ metadata.gz: 6e4359266db4d1beac5b074f475b58a89192dde95c259349eb1a0b563241a113cb50f0b151e671aaefd95aa206e17701f51358f9da4e3f2967e7d1a712989039
7
+ data.tar.gz: f63f5a254a37976e203bd4faa5818eeeb8e7a32c1f718e8c4b87a7b7b928b0f92a5ab3bc4dc6bb541d8706075785e9e20e8467fda12eda76d2621929d2e24730
data/Gemfile CHANGED
@@ -72,7 +72,7 @@ gem 'pry-doc', '1.5.0'
72
72
  gem 'rake', '13.2.1'
73
73
  gem 'rb-readline', '0.5.5'
74
74
  gem 'rbvmomi2', '3.8.0'
75
- gem 'rdoc', '6.8.1'
75
+ gem 'rdoc', '6.9.0'
76
76
  gem 'rest-client', '2.1.0'
77
77
  gem 'rex', '2.0.13'
78
78
  gem 'rmagick', '6.0.1'
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.221]:001 >>> PWN.help
40
+ pwn[v0.5.222]: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.3.5@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.221]:001 >>> PWN.help
55
+ pwn[v0.5.222]: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.3.5@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.221]:001 >>> PWN.help
65
+ pwn[v0.5.222]: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:
@@ -13,14 +13,21 @@ module PWN
13
13
  # opcodes: 'required - hex escaped opcode(s) (e.g. "\x90\x90\x90")',
14
14
  # opcodes_always_string_obj: 'optional - always interpret opcodes passed in as a string object (defaults to false)',
15
15
  # arch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',
16
- # endian: 'optional - endianess (defaults to :little)'
16
+ # endian: 'optional - endianess :big|:little (defaults to current system endianess)'
17
17
  # )
18
18
 
19
19
  public_class_method def self.opcodes_to_asm(opts = {})
20
20
  opcodes = opts[:opcodes]
21
21
  opcodes_always_string_obj = opts[:opcodes_always_string_obj] ||= false
22
22
  arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
23
- endian = opts[:endian] ||= :little
23
+ endian = opts[:endian]
24
+
25
+ if opts[:endian].nil? && [1].pack('I') == [1].pack('N')
26
+ endian = :big
27
+ else
28
+ endian = :little
29
+ end
30
+
24
31
  endian = endian.to_sym if opts[:endian]
25
32
 
26
33
  raise 'ERROR: opcodes parameter is required.' if opcodes.nil?
@@ -118,13 +125,20 @@ module PWN
118
125
  # PWN::Plugins::Assembly.asm_to_opcodes(
119
126
  # asm: 'required - assembly instruction(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)',
120
127
  # arch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',
121
- # endian: 'optional - endianess (defaults to :little)'
128
+ # endian: 'optional - endianess :big|:little (defaults to current system endianess)'
122
129
  # )
123
130
 
124
131
  public_class_method def self.asm_to_opcodes(opts = {})
125
132
  asm = opts[:asm]
126
133
  arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
127
134
  endian = opts[:endian] ||= :little
135
+
136
+ if opts[:endian].nil? && [1].pack('I') == [1].pack('N')
137
+ endian = :big
138
+ else
139
+ endian = :little
140
+ end
141
+
128
142
  endian = endian.to_sym if opts[:endian]
129
143
 
130
144
  asm_tmp = Tempfile.new('pwn_asm')
@@ -243,13 +257,13 @@ module PWN
243
257
  opcodes: 'required - hex escaped opcode(s) (e.g. \"\\x90\\x90\\x90\")',
244
258
  opcodes_always_string_obj: 'optional - always interpret opcodes passed in as a string object (defaults to false)',
245
259
  arch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',
246
- endian: 'optional - endianess (defaults to :little)'
260
+ endian: 'optional - endianess :big|:little (defaults to system endianess)'
247
261
  )
248
262
 
249
263
  #{self}.asm_to_opcodes(
250
264
  asm: 'required - assembly instruction(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)',
251
265
  arch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',
252
- endian: 'optional - endianess (defaults to :little)'
266
+ endian: 'optional - endianess :big|:little (defaults to system endianess)'
253
267
  )
254
268
 
255
269
  #{self}.list_supported_archs
@@ -31,8 +31,13 @@ module PWN
31
31
  dchars = "\001\e[33m\002***\001\e[0m\002" if mode == :splat
32
32
 
33
33
  if pi.config.pwn_asm
34
- arch = pi.config.pwn_asm_arch
34
+ arch = pi.config.pwn_asm_arch || PWN::Plugins::DetectOS.arch
35
35
  endian = pi.config.pwn_asm_endian
36
+ if endian.nil? && [1].pack('I') == [1].pack('N')
37
+ endian = 'big'
38
+ else
39
+ endian = 'little'
40
+ end
36
41
 
37
42
  pi.config.prompt_name = "pwn.asm:#{arch}/#{endian}"
38
43
  name = "\001\e[1m\002\001\e[37m\002#{pi.config.prompt_name}\001\e[0m\002"
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.221'
4
+ VERSION = '0.5.222'
5
5
  end
@@ -431,6 +431,7 @@
431
431
  {"messages":[{"role":"user","content":"PWN::Plugins::Assembly.asm_to_opcodes Usage"},{"role":"assistant","content":"`PWN::Plugins::Assembly.asm_to_opcodes`: Supported Method Parameters\n\nPWN::Plugins::Assembly.asm_to_opcodes(\n\nasm: 'required - assembly instruction(s) (e.g. 'nop\\nnop\\nnop\\njmp rsp\\n)',\narch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',\nendian: 'optional - endianess (defaults to :little)'\n\n)\n"}]}
432
432
  {"messages":[{"role":"user","content":"PWN::Plugins::Assembly.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::Assembly.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
433
433
  {"messages":[{"role":"user","content":"PWN::Plugins::Assembly.help Usage"},{"role":"assistant","content":"`PWN::Plugins::Assembly.help`: "}]}
434
+ {"messages":[{"role":"user","content":"PWN::Plugins::Assembly.list_supported_archs Usage"},{"role":"assistant","content":"`PWN::Plugins::Assembly.list_supported_archs`: Supported Method Parameters\n\nPWN::Plugins::Assembly.list_archs\n"}]}
434
435
  {"messages":[{"role":"user","content":"PWN::Plugins::Assembly.opcodes_to_asm Usage"},{"role":"assistant","content":"`PWN::Plugins::Assembly.opcodes_to_asm`: Supported Method Parameters\n\nPWN::Plugins::Assembly.opcodes_to_asm(\n\nopcodes: 'required - hex escaped opcode(s) (e.g. \"\\x90\\x90\\x90\")',\nopcodes_always_string_obj: 'optional - always interpret opcodes passed in as a string object (defaults to false)',\narch: 'optional - architecture returned from objdump --info (defaults to PWN::Plugins::DetectOS.arch)',\nendian: 'optional - endianess (defaults to :little)'\n\n)\n"}]}
435
436
  {"messages":[{"role":"user","content":"PWN::Plugins::AuthenticationHelper.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::AuthenticationHelper.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
436
437
  {"messages":[{"role":"user","content":"PWN::Plugins::AuthenticationHelper.help Usage"},{"role":"assistant","content":"`PWN::Plugins::AuthenticationHelper.help`: "}]}
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.5.221
4
+ version: 0.5.222
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -828,14 +828,14 @@ dependencies:
828
828
  requirements:
829
829
  - - '='
830
830
  - !ruby/object:Gem::Version
831
- version: 6.8.1
831
+ version: 6.9.0
832
832
  type: :development
833
833
  prerelease: false
834
834
  version_requirements: !ruby/object:Gem::Requirement
835
835
  requirements:
836
836
  - - '='
837
837
  - !ruby/object:Gem::Version
838
- version: 6.8.1
838
+ version: 6.9.0
839
839
  - !ruby/object:Gem::Dependency
840
840
  name: rest-client
841
841
  requirement: !ruby/object:Gem::Requirement