pwn 0.5.15 → 0.5.16

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: ca005bf83f64e7926d3e22c14ce0a0b742ef1853c5ea6da768a324ab0504ac3d
4
- data.tar.gz: 29b3ee47db3700a71b3f06a53337d8b225e6c5c43bb8fb88eb824d5e212c1988
3
+ metadata.gz: cc85d1a101656ee9aec078f6d1f22ce6321eb026411a99741016b0a6f9f57825
4
+ data.tar.gz: 1d5ea91b0a93c1b883e33464431c68acdcdac06d6d2a6d33d7d7dfb07f9ccde0
5
5
  SHA512:
6
- metadata.gz: 532f192473d0b71ded741f93a1eae042d8ad0a3c7ab833b676011d7e22ea8da43763f4d1b8c3c30f946eec467b9ba2e2e435e13554ee67d86786e5fd8025b83a
7
- data.tar.gz: 9dd7580d09ed7215c5fe35f0658250b3face53484d2a87dd90719d0e1b3bc1e1857992ff1a210761009a41c688c3b99af2c7ed4df77841395a6950bd6de48c58
6
+ metadata.gz: 1a08f6c2484a5e31cb51068d67c0964f76b310b1046d7ce34ff33661af91ef7538ac58f060acc9b02b09846e8703de636c0d9e65d68ba9c10bfbe43adb2058ce
7
+ data.tar.gz: 5556463bff9ea637bd8fa7659d37234c15bab2e6cf002b2db0dbe1cb04fd0274eafd838484440f81029d19f6c6ebece8d5847aae062d911755be0fac66444e6b
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.15]:001 >>> PWN.help
40
+ pwn[v0.5.16]: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.15]:001 >>> PWN.help
55
+ pwn[v0.5.16]: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.15]:001 >>> PWN.help
65
+ pwn[v0.5.16]: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:
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tempfile'
4
+
5
+ module PWN
6
+ module Plugins
7
+ # This plugin converts images to readable text
8
+ module Assembly
9
+ # Supported Method Parameters::
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)'
13
+ # )
14
+
15
+ public_class_method def self.opcode_to_asm(opts = {})
16
+ opcodes = opts[:opcodes]
17
+ arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
18
+
19
+ opcodes_tmp = Tempfile.new('pwn_opcodes')
20
+ File.binwrite(opcodes_tmp.path, opcodes)
21
+ asm = `objdump -M intel -b binary -m #{arch} -D #{opcodes_tmp.path}`
22
+ opcodes_tmp.unlink
23
+
24
+ asm
25
+ rescue StandardError => e
26
+ raise e
27
+ end
28
+
29
+ # Supported Method Parameters::
30
+ # 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)'
33
+ # )
34
+
35
+ public_class_method def self.asm_to_opcode(opts = {})
36
+ asm = opts[:asm]
37
+ arch = opts[:arch] ||= PWN::Plugins::DetectOS.arch
38
+
39
+ asm_code = ".global _start\n_start:\n#{asm}"
40
+
41
+ asm_tmp = Tempfile.new('pwn_asm')
42
+ asm_tmp.write(asm_code)
43
+ asm_tmp.close
44
+
45
+ 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
50
+ rescue StandardError => e
51
+ raise e
52
+ end
53
+
54
+ # Author(s):: 0day Inc. <request.pentest@0dayinc.com>
55
+
56
+ public_class_method def self.authors
57
+ "AUTHOR(S):
58
+ 0day Inc. <request.pentest@0dayinc.com>
59
+ "
60
+ end
61
+
62
+ # Display Usage for this Module
63
+
64
+ public_class_method def self.help
65
+ 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)'
69
+ )
70
+
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)'
74
+ )
75
+
76
+ #{self}.authors
77
+ "
78
+ end
79
+ end
80
+ end
81
+ end
@@ -46,6 +46,8 @@ module PWN
46
46
  puts "USAGE:
47
47
  #{self}.type
48
48
 
49
+ #{self}.arch
50
+
49
51
  #{self}.authors
50
52
  "
51
53
  end
data/lib/pwn/plugins.rb CHANGED
@@ -7,6 +7,7 @@ module PWN
7
7
  module Plugins
8
8
  autoload :Android, 'pwn/plugins/android'
9
9
  autoload :AnsibleVault, 'pwn/plugins/ansible_vault'
10
+ autoload :Assembly, 'pwn/plugins/assembly'
10
11
  autoload :AuthenticationHelper, 'pwn/plugins/authentication_helper'
11
12
  autoload :BareSIP, 'pwn/plugins/baresip'
12
13
  autoload :BasicAuth, 'pwn/plugins/basic_auth'
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.15'
4
+ VERSION = '0.5.16'
5
5
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe PWN::Plugins::Assembly do
6
+ it 'should display information for authors' do
7
+ authors_response = PWN::Plugins::Assembly
8
+ expect(authors_response).to respond_to :authors
9
+ end
10
+
11
+ it 'should display information for existing help method' do
12
+ help_response = PWN::Plugins::Assembly
13
+ expect(help_response).to respond_to :help
14
+ end
15
+ end
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.15
4
+ version: 0.5.16
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-02-24 00:00:00.000000000 Z
11
+ date: 2024-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -1707,6 +1707,7 @@ files:
1707
1707
  - lib/pwn/plugins.rb
1708
1708
  - lib/pwn/plugins/android.rb
1709
1709
  - lib/pwn/plugins/ansible_vault.rb
1710
+ - lib/pwn/plugins/assembly.rb
1710
1711
  - lib/pwn/plugins/authentication_helper.rb
1711
1712
  - lib/pwn/plugins/baresip.rb
1712
1713
  - lib/pwn/plugins/basic_auth.rb
@@ -2032,6 +2033,7 @@ files:
2032
2033
  - spec/lib/pwn/ffi_spec.rb
2033
2034
  - spec/lib/pwn/plugins/android_spec.rb
2034
2035
  - spec/lib/pwn/plugins/ansible_vault_spec.rb
2036
+ - spec/lib/pwn/plugins/assembly_spec.rb
2035
2037
  - spec/lib/pwn/plugins/authentication_helper_spec.rb
2036
2038
  - spec/lib/pwn/plugins/baresip_spec.rb
2037
2039
  - spec/lib/pwn/plugins/basic_auth_spec.rb