pwn 0.5.30 → 0.5.32

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: d4e7b87e5244c746192d143d56434889226b231f2cf4edfb9b88a86426d0bd2b
4
- data.tar.gz: f3df82054c4cf1ec228a169759637c91ed343aafde84123c0a7e8c7578ddefdb
3
+ metadata.gz: f23ad9826be7dce7611f61d4069abb3fe8a278911acaf9dbac182a41784164c5
4
+ data.tar.gz: a133ddb8c0525ed8026a3624d77c3c9da3c08385dbee6af8eb900ea9b763c37f
5
5
  SHA512:
6
- metadata.gz: 7c197bef416d8e168ee308047b9cef8f00e1584008c67c6afcd482779b78a1f8c7aacd17b5f16aca6bb48b95eb50f1bbd93047ed7c1283eee40dd26ad5bae70f
7
- data.tar.gz: e14809146771166af109a354c12999e0412fb0313d5b4325c3d2d44fa080d9c8605b342df6fa52400fa4fdb4843eed950a3da2e68bec91603a9f2575b37f7f54
6
+ metadata.gz: daf84f4d89ffa73eb4d1c37bc421a18fdd628064e09e1454cdb672a79052f914fc65ed102ad101317e93f812f2029d64772961e4026bee8d2d96cda90bce8a8f
7
+ data.tar.gz: fa7fe4bd6fb8bb7f51adac89e4d18b8806aa3558d2397f38bde923d2ec9175b6048debc4776bf471ff227564c8da9402b49fb337935e5186c40be454d03c1b01
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.30]:001 >>> PWN.help
40
+ pwn[v0.5.32]: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.0@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.30]:001 >>> PWN.help
55
+ pwn[v0.5.32]: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.0@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.30]:001 >>> PWN.help
65
+ pwn[v0.5.32]: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:
@@ -19,15 +19,17 @@ module PWN
19
19
  arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
20
20
  endian = opts[:endian] ||= :little
21
21
 
22
+ pwn_asm_tmp = Tempfile.new('pwn_asm')
23
+
24
+ raise 'ERROR: opcodes parameter is required.' if opcodes.nil?
25
+
22
26
  case arch
23
- when 'i386', 'i686', 'x86'
24
- arch_obj = Metasm::Ia32.new(endian)
25
- when 'amd64', 'x86_64'
26
- arch_obj = Metasm::X86_64.new(endian)
27
+ when 'amd64', 'i386', 'i686', 'x86', 'x86_64'
28
+ arch = 'i386'
27
29
  when 'armv4l', 'armv4b', 'armv5l', 'armv5b', 'armv6l', 'armv6b', 'armv7b', 'armv7l', 'arm', 'armhf'
28
- arch_obj = Metasm::ARM.new(endian)
30
+ arch = 'arm'
29
31
  when 'aarch64', 'arm64'
30
- arch_obj = Metasm::ARM64.new(endian)
32
+ arch = 'aarch64'
31
33
  else
32
34
  raise "Unsupported architecture: #{arch}"
33
35
  end
@@ -41,9 +43,13 @@ module PWN
41
43
  # If opcodes appear to be '909090' then convert to "\x90\x90\x90"
42
44
  opcodes = opcodes.chars.each_slice(2).map(&:join).map { |x| format('\x%02x', x.to_i(16)) }.join if opcodes.length.even?
43
45
 
44
- Metasm::Shellcode.disassemble(arch_obj, opcodes).to_s
46
+ File.binwrite(pwn_asm_tmp.path, opcodes)
47
+ `objdump -D -b binary -m #{arch} -M intel --endian #{endian} #{pwn_asm_tmp.path}`
45
48
  rescue StandardError => e
46
49
  raise e
50
+ ensure
51
+ tmp_file = [pwn_asm_tmp.path]
52
+ FileUtils.rm_f(tmp_file) if File.exist?(pwn_asm_tmp.path)
47
53
  end
48
54
 
49
55
  # Supported Method Parameters::
@@ -58,6 +64,8 @@ module PWN
58
64
  arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
59
65
  endian = opts[:endian] ||= :little
60
66
 
67
+ raise 'ERROR: asm parameter is required.' if asm.nil?
68
+
61
69
  case arch
62
70
  when 'i386', 'i686', 'x86'
63
71
  arch_obj = Metasm::Ia32.new(endian)
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.30'
4
+ VERSION = '0.5.32'
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.5.30
4
+ version: 0.5.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.