pwn 0.4.833 → 0.4.834

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: 95b4068d5ecf75a58b7b656ac783761e5fdfbba364aef3a4e983e3b1346a02f2
4
- data.tar.gz: efd8163a0b49cbef0bd1e03d90066e2c26bad118d9337877694e79bd866a058f
3
+ metadata.gz: 3b73180eeb781bc4beafb24d1d0edb2aa282fa84ea3212e8f262cee936783f58
4
+ data.tar.gz: eee0dc190a49b6fcb9ee31c57e4f72fe520f88b9f5ff2ca382ce03e80164ab40
5
5
  SHA512:
6
- metadata.gz: da532d1a0d8211a2917d7582832e4776fe7000db0d2ca3965352ebf39b1b7c14449535159c60264dc666b9eeb92ccd8d5dc95ae62c84432d2734587971a1a629
7
- data.tar.gz: 98814d44204a7f65ddd6ecaee2c327eb2cd28c5c35b242c37ba0e4fa7e7c7023012fc5f42c8e8ebac9538897ae65191fb7e176f91965e8941393a858899259dd
6
+ metadata.gz: 1a05cda9748c9dc51c332f481e676d6d47016369f88bb1321abd23fa0b60576efd0a70311e2b370acb345b39ee731558ef2889f0c193be7e68fb3f0ae99984d0
7
+ data.tar.gz: 74a0cb8a1b736d94029e78de10ecb8c80525890245946c2c09b38f85880d0ca2cfd201cc4170c005c224cb8757dd5ea49f5c8c5d67f36b5d2a8a5e143d1ad55b
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.833]:001 >>> PWN.help
40
+ pwn[v0.4.834]: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.2.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.833]:001 >>> PWN.help
55
+ pwn[v0.4.834]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -13,19 +13,36 @@ module PWN
13
13
  @@logger = PWN::Plugins::PWNLogger.create
14
14
 
15
15
  # Supported Method Parameters::
16
- # extract_and_validate_uris((
16
+ # valid_uri?(
17
17
  # search_results_hash: 'required - iteration of search results'
18
18
  # )
19
19
 
20
- private_class_method def self.extract_and_validate_uris(opts = {})
20
+ private_class_method def self.valid_uri?(opts = {})
21
+ uri = URI.parse(opts[:uri].to_s)
22
+ %w[http https].include?(uri.scheme) && URI.parse(uri).host
23
+ rescue URI::BadURIError,
24
+ URI::InvalidURIError,
25
+ URI::InvalidComponentError
26
+
27
+ false
28
+ rescue StandardError => e
29
+ raise e
30
+ end
31
+
32
+ # Supported Method Parameters::
33
+ # extract_uris(
34
+ # search_results_hash: 'required - iteration of search results'
35
+ # )
36
+
37
+ private_class_method def self.extract_uris(opts = {})
21
38
  search_results_hash = opts[:search_results_hash]
22
- uri_arr = []
23
- search_results_hash.each_value do |search_results_value|
24
- URI.extract(search_results_value.to_s).each do |uri|
25
- uri_arr.push(uri) if %w[http https].include?(URI.parse(uri).scheme)
39
+ search_results_hash.each_with_object([]) do |value, uris|
40
+ valid_uris_from_value = *URI.extract(value.to_s).select do |uri|
41
+ valid_uri?(uri: uri)
26
42
  end
43
+
44
+ uris.push(valid_uris_from_value)
27
45
  end
28
- uri_arr
29
46
  rescue URI::BadURIError,
30
47
  URI::InvalidURIError,
31
48
  URI::InvalidComponentError
@@ -505,7 +522,7 @@ module PWN
505
522
  search_results = opts[:search_results]
506
523
 
507
524
  search_results.map do |search_results_hash|
508
- extract_and_validate_uris(
525
+ extract_uris(
509
526
  search_results_hash: search_results_hash
510
527
  )
511
528
  end.flatten
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.833'
4
+ VERSION = '0.4.834'
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.833
4
+ version: 0.4.834
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.