pwn 0.5.21 → 0.5.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aad6799fdb7bce39796565b9aa0f077654d394c1b3f0a2c1bcca99a5ce578a83
4
- data.tar.gz: cde21f9dbe0c2d8060a437352ca7935fc4d71fe9d66cc4bd8d05010d5c212c9c
3
+ metadata.gz: 891006d13f97eb099047b3596fef7232f66532b32431914990360d0d0274fa26
4
+ data.tar.gz: a426cafcccb59fbaf64a1d728b0e45a251dd713f9684aa894f8b56d2e34acde6
5
5
  SHA512:
6
- metadata.gz: f1cd4d4a140eabbcbc4c7c088f9242783484887f34d0173a08a19d31f1f3594dec78a85ac5eaa3f244af9fa267f20e8977d90f620827f8e87dab373ed1494513
7
- data.tar.gz: ce5493069b272ccde1df0319dbba06d1400b457a55a6b32d8656b04039caccec0145b1b10efe1af09d8e1eb539ca47050aebb8d106e768c0fd8fdad186cf59b9
6
+ metadata.gz: b71a807d4441bd2b3a94a76c02d80a6505e82a87ffe8f7469f1bd88f71a89e1dfc9220606765726dea68065c4532d40c016090aeb2aceaeae6b7ba0afc2891a4
7
+ data.tar.gz: c9d404cd2f07bdee5bdc6bda8f256d255997220dfc584dc5ca559b794b24f90104bec3e138cf71d49d983015a17b81b3bc2a038d72c929c361c07673ffb08e9f
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.21]:001 >>> PWN.help
40
+ pwn[v0.5.23]: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.21]:001 >>> PWN.help
55
+ pwn[v0.5.23]: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.21]:001 >>> PWN.help
65
+ pwn[v0.5.23]: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:
@@ -8,15 +8,19 @@ module PWN
8
8
  module Assembly
9
9
  # Supported Method Parameters::
10
10
  # PWN::Plugins::Assembly.opcodes_to_asm(
11
- # opcodes: 'required - hex escaped opcode(s) (e.g. "\x90\x90\x90")'
11
+ # opcodes: 'required - hex escaped opcode(s) (e.g. "\x90\x90\x90")',
12
+ # arch: 'optional - objdump -i architecture (defaults to i386)'
12
13
  # )
13
14
 
14
15
  public_class_method def self.opcodes_to_asm(opts = {})
15
16
  opcodes = opts[:opcodes]
17
+ arch = opts[:arch] || 'i386'
16
18
 
17
19
  opcodes_tmp = Tempfile.new('pwn_opcodes')
18
20
  File.binwrite(opcodes_tmp.path, opcodes)
19
- `objdump -D #{opcodes_tmp.path}`
21
+ # TODO: Implement support for other architectures
22
+ # for both 32bit and 64bit
23
+ `objdump --disassemble-all --target binary --architecture #{arch} #{opcodes_tmp.path}`
20
24
  rescue StandardError => e
21
25
  raise e
22
26
  ensure
@@ -25,11 +29,13 @@ module PWN
25
29
 
26
30
  # Supported Method Parameters::
27
31
  # PWN::Plugins::Assembly.asm_to_opcodes(
28
- # asm: 'required - assembly instruction(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)'
32
+ # asm: 'required - assembly instruction(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)',
33
+ # arch: 'optional - objdump -i architecture (defaults to i386)'
29
34
  # )
30
35
 
31
36
  public_class_method def self.asm_to_opcodes(opts = {})
32
37
  asm = opts[:asm]
38
+ arch = opts[:arch] || 'i386'
33
39
 
34
40
  asm_code = ".global _start\n_start:\n#{asm}"
35
41
 
@@ -38,8 +44,10 @@ module PWN
38
44
  asm_tmp.close
39
45
 
40
46
  asm_tmp_o = "#{asm_tmp.path}.o"
47
+ # TODO: Implement support for other architectures
48
+ # for both 32bit and 64bit
41
49
  system('as', '-o', asm_tmp_o, asm_tmp.path)
42
- `objdump -D #{asm_tmp.path}.o`
50
+ `objdump --disassemble-all #{asm_tmp.path}.o`
43
51
  rescue StandardError => e
44
52
  raise e
45
53
  ensure
@@ -60,11 +68,13 @@ module PWN
60
68
  public_class_method def self.help
61
69
  puts "USAGE:
62
70
  #{self}.opcodes_to_asm(
63
- opcodes: 'required - hex escaped opcode(s) (e.g. \"\\x90\\x90\\x90\")'
71
+ opcodes: 'required - hex escaped opcode(s) (e.g. \"\\x90\\x90\\x90\")',
72
+ arch: 'optional - objdump -i architecture (defaults to i386)'
64
73
  )
65
74
 
66
75
  #{self}.asm_to_opcodes(
67
- asm: 'required - assembly instruction(s) (e.g. 'jmp rsp')'
76
+ asm: 'required - assembly instruction(s) (e.g. 'jmp rsp')',
77
+ arch: 'optional - objdump -i architecture (defaults to i386)'
68
78
  )
69
79
 
70
80
  #{self}.authors
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.21'
4
+ VERSION = '0.5.23'
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.21
4
+ version: 0.5.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.