pwn 0.5.17 → 0.5.19

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: 699a38ae80f88b75aad0a4dd1d8a76251572be9ce6ce99603506a946d982c88b
4
- data.tar.gz: 457c82f3d230d8b99460e2742167087a914bd06f1cb0ffb9d27fef32530c0330
3
+ metadata.gz: 760af23894c1c3935f4cd7446cc6fc91c7e4bc17b7e7706579ea5f537d23b33f
4
+ data.tar.gz: ed23bc43c52e0039223d60e72c314850958f7cf5b1c22a7bff81b40e57654154
5
5
  SHA512:
6
- metadata.gz: e1d883a3079b28649e51609c04bd3e7c7dc78580a8ba6c79e3e8e6c768bc8f58d42d304b5ddbbe2882c5597b282c2e22bb119b34d0f3b3c820d7482a3c0e481d
7
- data.tar.gz: 76273576715746ac2a15d16f7b92ab93822a89e607d3c8f0343b2a1f8416d1907255765830a2a37262145aed378f2e8d4e1dbd20ba188e21bb64475a70b7c3c8
6
+ metadata.gz: add4ef7cf69683f089fc5f7c1d0d2373c978455ebb14cff1ee968735386d6ce92b9d89ccc5ee0e78cf1c94b09ffc21bbba5577244728aa9e4a6bc74793b6697c
7
+ data.tar.gz: 1e32fa66801433801b0e771ad2fc9bc9a475724facf68734434c2ede4401fc862b14356c881f05a4bb8ca66ee6d23268be4cdc26a044e384a620bd947c9b761f
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.17]:001 >>> PWN.help
40
+ pwn[v0.5.19]: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.17]:001 >>> PWN.help
55
+ pwn[v0.5.19]: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.17]:001 >>> PWN.help
65
+ pwn[v0.5.19]: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,33 +8,28 @@ module PWN
8
8
  module Assembly
9
9
  # Supported Method Parameters::
10
10
  # PWN::Plugins::Assembly.opcode_to_asm(
11
- # opcodes: 'required - hex escaped opcode(s) (e.g. '\x90\x90\x90')',
12
- # arch: 'optional - architecture (defaults to PWN::Plugins::DetectOS.arch)'
11
+ # opcodes: 'required - hex escaped opcode(s) (e.g. '\x90\x90\x90')'
13
12
  # )
14
13
 
15
14
  public_class_method def self.opcodes_to_asm(opts = {})
16
15
  opcodes = opts[:opcodes]
17
- arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
18
16
 
19
17
  opcodes_tmp = Tempfile.new('pwn_opcodes')
20
18
  File.binwrite(opcodes_tmp.path, opcodes)
21
- asm = `objdump -M intel -b binary -D #{opcodes_tmp.path}`
22
- opcodes_tmp.unlink
23
-
24
- asm
19
+ `objdump -D #{opcodes_tmp.path}`
25
20
  rescue StandardError => e
26
21
  raise e
22
+ ensure
23
+ opcodes_tmp.unlink if File.exist?(opcodes_tmp.path)
27
24
  end
28
25
 
29
26
  # Supported Method Parameters::
30
27
  # PWN::Plugins::Assembly.asm_to_opcode(
31
- # asm: 'required - assembly code(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)',
32
- # arch: 'optional - architecture (defaults to PWN::Plugins::DetectOS.arch)'
28
+ # asm: 'required - assembly instruction(s) (e.g. 'nop\nnop\nnop\njmp rsp\n)'
33
29
  # )
34
30
 
35
- public_class_method def self.asm_to_opcode(opts = {})
31
+ public_class_method def self.asm_to_opcodes(opts = {})
36
32
  asm = opts[:asm]
37
- arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
38
33
 
39
34
  asm_code = ".global _start\n_start:\n#{asm}"
40
35
 
@@ -43,12 +38,12 @@ module PWN
43
38
  asm_tmp.close
44
39
 
45
40
  system('as', '-o', "#{asm_tmp.path}.o", asm_tmp.path)
46
- opcodes = `objdump -D #{asm_tmp.path}.o`
47
- asm_tmp.unlink
48
-
49
- opcodes
41
+ `objdump -D #{asm_tmp.path}.o`
50
42
  rescue StandardError => e
51
43
  raise e
44
+ ensure
45
+ asm_tmp.unlink if File.exist?(asm_tmp.path)
46
+ File.unlink("#{asm_tmp.path}.o") if File.exist?("#{asm_tmp.path}.o")
52
47
  end
53
48
 
54
49
  # Author(s):: 0day Inc. <request.pentest@0dayinc.com>
@@ -63,14 +58,12 @@ module PWN
63
58
 
64
59
  public_class_method def self.help
65
60
  puts "USAGE:
66
- #{self}.opcode_to_asm(
67
- opcodes: 'required - hex escaped opcode(s) (e.g. '\\x90\\x90\\x90')',
68
- arch: 'optional - architecture (defaults to PWN::Plugins::DetectOS.arch)'
61
+ #{self}.opcodes_to_asm(
62
+ opcodes: 'required - hex escaped opcode(s) (e.g. '\\x90\\x90\\x90')'
69
63
  )
70
64
 
71
- #{self}.asm_to_opcode(
72
- asm: 'required - assembly code(s) (e.g. 'jmp rsp')',
73
- arch: 'optional - architecture (defaults to PWN::Plugins::DetectOS.arch)'
65
+ #{self}.asm_to_opcodes(
66
+ asm: 'required - assembly instruction(s) (e.g. 'jmp rsp')'
74
67
  )
75
68
 
76
69
  #{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.17'
4
+ VERSION = '0.5.19'
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.17
4
+ version: 0.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.