pwn 0.4.992 → 0.4.993

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: c4cfb474de933ef8da17ef86e6277a9591f60e76f61f83da12120ef2a44516f6
4
- data.tar.gz: 3beeaed5e19e992145068084da485d8155db075326122acd32cb2d4fac48a33f
3
+ metadata.gz: 84008b06b85408aed7b64e9ee6ae23d392d7713028b21b7f6f85ddf20433d9fa
4
+ data.tar.gz: 6a7749cb6897c478325ef819039a3790cbc5a126b3da0e907ab8e9ca145737ba
5
5
  SHA512:
6
- metadata.gz: 23a5a2308ecf58cc24b6ab3a2d64b8dd3ea780541049f80ef28bc0d4c28913db4b482376cbbc1a07cc4f51ab545f4ae562cfe13e3fbc522073322f4e7f34dc3c
7
- data.tar.gz: 307bec354fe8b1d333b53325d21d28be20f55f2a1a9e077bd84686ec00cb7a711de054807eeca50b11034848eb1d5aad7ceaf79121b5818b405227ef9e3ccc74
6
+ metadata.gz: 681a65c0de2438a658cefb719e3d9d009bc295eaf5af5f54e7ef7710994113809b72279549c535dd89efdd621561ec3eb93e0d0d4f941360f4cd20dc1788587a
7
+ data.tar.gz: 802a27fd787dd8745c6e20de8cabcf7f76cae6bd6fea9d2431f9a8ea3b11574016ef03925855c7e6c712c37fbd366aaddd8f70fd513905f4e81fe530096e1e44
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.4.992]:001 >>> PWN.help
40
+ pwn[v0.4.993]: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.4.992]:001 >>> PWN.help
55
+ pwn[v0.4.993]: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.4.992]:001 >>> PWN.help
65
+ pwn[v0.4.993]: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:
@@ -7,12 +7,12 @@ module PWN
7
7
  # Supported Method Parameters::
8
8
  # PWN::Plugins::XXD.dump(
9
9
  # file: 'required - path to binary file to dump',
10
- # hexdump_arr: 'optional - return array of hashes instead of string (default: false)'
10
+ # hashed: 'optional - return hexdump as hash instead of string (default: false)'
11
11
  # )
12
12
 
13
13
  public_class_method def self.dump(opts = {})
14
14
  file = opts[:file]
15
- hexdump_arr = opts[:hexdump_arr] ||= false
15
+ hashed = opts[:hashed] ||= false
16
16
 
17
17
  raise ArgumentError, 'file is required' if file.nil?
18
18
 
@@ -21,7 +21,7 @@ module PWN
21
21
  input = File.binread(file)
22
22
 
23
23
  io = StringIO.new
24
- hex_arr = [] if hexdump_arr
24
+ hashed_hexdump = {}
25
25
  res = input.bytes.each_slice(2).each_slice(8).with_index do |row, index|
26
26
  fmt_row = format(
27
27
  "%<s1>07x0: %<s2>-40s %<s3>-16s\n",
@@ -32,19 +32,19 @@ module PWN
32
32
 
33
33
  io.write(fmt_row)
34
34
 
35
- if hexdump_arr
36
- fmt_row_hash = {
37
- address: fmt_row.split.first.delete(':'),
35
+ if hashed
36
+ hashed_hexdump["#{fmt_row.split.first.delete(':')}"] = {
38
37
  hex: fmt_row.split[1..8],
39
38
  ascii: fmt_row.split[9..-1].join
40
39
  }
41
-
42
- hex_arr.push(fmt_row_hash)
43
40
  end
44
41
  end
45
42
 
46
- hex_arr if hexdump_arr
47
- io.string unless hexdump_arr
43
+ if hashed
44
+ return hashed_hexdump
45
+ else
46
+ return io.string
47
+ end
48
48
  rescue StandardError => e
49
49
  raise e
50
50
  end
@@ -91,7 +91,7 @@ module PWN
91
91
  puts "USAGE:
92
92
  #{self}.dump(
93
93
  file: 'required - path to binary file to dump',
94
- hexdump_arr: 'optional - return array of hashes instead of string (default: false)'
94
+ hashed: 'optional - return hexdump as hash instead of string (default: false)'
95
95
  )
96
96
 
97
97
  #{self}.reverse_dump(
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.4.992'
4
+ VERSION = '0.4.993'
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.4.992
4
+ version: 0.4.993
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.