pwn 0.5.32 → 0.5.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/assembly.rb +11 -15
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f879ebdd5ad454c5a57dab480906a255c1a1c9551c33895b346417f26b320784
|
4
|
+
data.tar.gz: e78218a0680ed4982aad8a13e5368bfac5fc5b04b548a1bd2410389ce2945c0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d94948a701a5716491c3c058168c34ffd16038e07c048a4284f4471c47a00b8a79122c4562e47a068ff249c24fbcd4575bc8df7b81518c589c9648ca2f8d6c03
|
7
|
+
data.tar.gz: 1b9d36a3f3ee1f4a54a7cb7cce7a40ecbd47eff55593dd38f479604d7ed21c8bc8a17e4fcdd4db1f252b87052d985eac468d31420a14b51df0eb6fae47c7e191
|
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.
|
40
|
+
pwn[v0.5.34]: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.
|
55
|
+
pwn[v0.5.34]: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.
|
65
|
+
pwn[v0.5.34]: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/lib/pwn/plugins/assembly.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'metasm'
|
4
|
-
require 'tempfile'
|
5
4
|
|
6
5
|
module PWN
|
7
6
|
module Plugins
|
@@ -19,37 +18,34 @@ module PWN
|
|
19
18
|
arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
|
20
19
|
endian = opts[:endian] ||= :little
|
21
20
|
|
22
|
-
pwn_asm_tmp = Tempfile.new('pwn_asm')
|
23
|
-
|
24
21
|
raise 'ERROR: opcodes parameter is required.' if opcodes.nil?
|
25
22
|
|
26
23
|
case arch
|
27
|
-
when '
|
28
|
-
|
24
|
+
when 'i386', 'i686', 'x86'
|
25
|
+
arch_obj = Metasm::Ia32.new(endian)
|
26
|
+
when 'amd64', 'x86_64'
|
27
|
+
arch_obj = Metasm::X86_64.new(endian)
|
29
28
|
when 'armv4l', 'armv4b', 'armv5l', 'armv5b', 'armv6l', 'armv6b', 'armv7b', 'armv7l', 'arm', 'armhf'
|
30
|
-
|
29
|
+
arch_obj = Metasm::ARM.new(endian)
|
31
30
|
when 'aarch64', 'arm64'
|
32
|
-
|
31
|
+
arch_obj = Metasm::ARM64.new(endian)
|
33
32
|
else
|
34
33
|
raise "Unsupported architecture: #{arch}"
|
35
34
|
end
|
36
35
|
|
36
|
+
# TOOD: Fix this
|
37
37
|
# If opcodes appear to be '"90", "90", "90"' then convert to "\x90\x90\x90"
|
38
|
-
opcodes = opcodes.split(',').map { |x| format('\x%02x', x.gsub('"', '').to_i(16)) }.join if opcodes.include?('"') && opcodes.include?(',')
|
38
|
+
# opcodes = opcodes.split(',').map { |x| format('\x%02x', x.gsub('"', '').to_i(16)) }.join if opcodes.include?('"') && opcodes.include?(',')
|
39
39
|
|
40
40
|
# If opcodes appear to be '90 90 90' then convert to "\x90\x90\x90"
|
41
|
-
opcodes = opcodes.split.map { |x| format('\x%02x', x.to_i(16)) }.join if opcodes.include?(' ')
|
41
|
+
# opcodes = opcodes.split.map { |x| format('\x%02x', x.to_i(16)) }.join if opcodes.include?(' ')
|
42
42
|
|
43
43
|
# If opcodes appear to be '909090' then convert to "\x90\x90\x90"
|
44
|
-
opcodes = opcodes.chars.each_slice(2).map(&:join).map { |x| format('\x%02x', x.to_i(16)) }.join if opcodes.length.even?
|
44
|
+
# opcodes = opcodes.chars.each_slice(2).map(&:join).map { |x| format('\x%02x', x.to_i(16)) }.join if opcodes.length.even?
|
45
45
|
|
46
|
-
|
47
|
-
`objdump -D -b binary -m #{arch} -M intel --endian #{endian} #{pwn_asm_tmp.path}`
|
46
|
+
Metasm::Shellcode.disassemble(arch_obj, opcodes).to_s
|
48
47
|
rescue StandardError => e
|
49
48
|
raise e
|
50
|
-
ensure
|
51
|
-
tmp_file = [pwn_asm_tmp.path]
|
52
|
-
FileUtils.rm_f(tmp_file) if File.exist?(pwn_asm_tmp.path)
|
53
49
|
end
|
54
50
|
|
55
51
|
# Supported Method Parameters::
|
data/lib/pwn/version.rb
CHANGED