pwn 0.5.406 → 0.5.407

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: 3a4875ea87dd3f0605bc2ac889621fc124d43016086b2ef914a71dd8104879ff
4
- data.tar.gz: 68addc891a15eea06b39b9e575fd98ce3b9e5a4d3e490c20bdfbe138699b8f2e
3
+ metadata.gz: 6cdcedb953c971c8feccabd99bb44f1e229254d4adbaf8f5d06c53416da1d3c7
4
+ data.tar.gz: 2642aa96456651ef17d042794f21ad69754335e8d3b8d7e3415e311adb1dbd05
5
5
  SHA512:
6
- metadata.gz: 6b9211d610152046dec2ddcb6c96687085ae3004d104713064831c511e7ce1aa490c5f4e69c12066bc6d11e4f81b47dd90e6b289d5df88a6a5d65abb67d24dd7
7
- data.tar.gz: e43570d37f21c2a3dc4008da1b42ee0aa379f4aebe5880dd47bb1b4c881a767db74a85b4121a125fbcdb67a4fc7526e239dfb595fd2327dbc0742c67e76027c7
6
+ metadata.gz: 8041d87f4162ebb4fb28c9b6acc5cfae7394fb4e082cd8a4a99e6ac22f1181701a0e32d28e97593d7e169cadc80ca71c76d0144d7e313e16c8c9b1ee799bd20a
7
+ data.tar.gz: 0a654b39bf9c3f63b24accc464fd7b8222f060dfd5748118e99771d8ef9897e6551c95e63b40fdd4b0eabfe21694241a448c3a00607e21306b7e64683b871500
data/.rubocop_todo.yml CHANGED
@@ -1,31 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-05-30 23:04:07 UTC using RuboCop version 1.75.8.
3
+ # on 2025-09-11 18:09:38 UTC using RuboCop version 1.80.2.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 24
10
- # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
12
- # URISchemes: http, https
13
- Layout/LineLength:
14
- Exclude:
15
- - 'Vagrantfile'
16
- - 'bin/pwn_diff_csv_files_w_column_exclude'
17
- - 'lib/pwn/banner/jmp_esp.rb'
18
- - 'lib/pwn/banner/radare2_ai.rb'
19
- - 'lib/pwn/plugins/mail_agent.rb'
20
- - 'lib/pwn/plugins/ollama.rb'
21
- - 'lib/pwn/plugins/open_ai.rb'
22
- - 'lib/pwn/reports/fuzz.rb'
23
- - 'lib/pwn/reports/phone.rb'
24
- - 'lib/pwn/reports/sast.rb'
25
- - 'lib/pwn/reports/uri_buster.rb'
26
- - 'lib/pwn/sast/banned_function_calls_c.rb'
27
- - 'packer/provisioners/aliases.rb'
28
-
29
9
  # Offense count: 1
30
10
  # This cop supports safe autocorrection (--autocorrect).
31
11
  # Configuration parameters: AllowInHeredoc.
@@ -50,37 +30,18 @@ Lint/RedundantTypeConversion:
50
30
  - 'lib/pwn/plugins/jenkins.rb'
51
31
  - 'lib/pwn/plugins/repl.rb'
52
32
 
53
- # Offense count: 307
33
+ # Offense count: 320
54
34
  # This cop supports safe autocorrection (--autocorrect).
55
- # Configuration parameters: AutoCorrect.
56
35
  Lint/UselessAssignment:
57
36
  Enabled: false
58
37
 
59
38
  # Offense count: 1
60
39
  # This cop supports safe autocorrection (--autocorrect).
61
- # Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects.
40
+ # Configuration parameters: CheckForMethodsWithNoSideEffects.
62
41
  Lint/Void:
63
42
  Exclude:
64
43
  - 'bin/pwn_web_cache_deception'
65
44
 
66
- # Offense count: 5
67
- # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
68
- # AllowedMethods: refine
69
- Metrics/BlockLength:
70
- Exclude:
71
- - '**/*.gemspec'
72
- - 'lib/pwn/plugins/android.rb'
73
- - 'lib/pwn/plugins/msr206.rb'
74
- - 'lib/pwn/plugins/repl.rb'
75
- - 'lib/pwn/sast/banned_function_calls_c.rb'
76
-
77
- # Offense count: 2
78
- # Configuration parameters: CountBlocks, CountModifierForms, Max.
79
- Metrics/BlockNesting:
80
- Exclude:
81
- - 'lib/pwn/plugins/son_micro_rfid.rb'
82
- - 'lib/pwn/plugins/tor.rb'
83
-
84
45
  # Offense count: 1
85
46
  # Configuration parameters: LengthThreshold.
86
47
  Metrics/CollectionLiteralLength:
@@ -99,22 +60,13 @@ Metrics/MethodLength:
99
60
  Exclude:
100
61
  - 'lib/pwn/banner/code_cave.rb'
101
62
 
102
- # Offense count: 12
63
+ # Offense count: 3
103
64
  # Configuration parameters: CountComments, Max, CountAsOne.
104
65
  Metrics/ModuleLength:
105
66
  Exclude:
106
67
  - 'lib/pwn/banner/code_cave.rb'
107
68
  - 'lib/pwn/plugins/android.rb'
108
- - 'lib/pwn/plugins/black_duck_binary_analysis.rb'
109
- - 'lib/pwn/plugins/defect_dojo.rb'
110
- - 'lib/pwn/plugins/gqrx.rb'
111
69
  - 'lib/pwn/plugins/msr206.rb'
112
- - 'lib/pwn/plugins/nessus_cloud.rb'
113
- - 'lib/pwn/plugins/open_ai.rb'
114
- - 'lib/pwn/plugins/packet.rb'
115
- - 'lib/pwn/plugins/repl.rb'
116
- - 'lib/pwn/plugins/son_micro_rfid.rb'
117
- - 'lib/pwn/plugins/transparent_browser.rb'
118
70
 
119
71
  # Offense count: 2
120
72
  Naming/AccessorMethodName:
@@ -133,7 +85,7 @@ Style/Alias:
133
85
  Style/ClassVars:
134
86
  Enabled: false
135
87
 
136
- # Offense count: 280
88
+ # Offense count: 274
137
89
  # This cop supports safe autocorrection (--autocorrect).
138
90
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
139
91
  # SupportedStyles: assign_to_condition, assign_inside_condition
@@ -146,12 +98,11 @@ Style/ExplicitBlockArgument:
146
98
  Exclude:
147
99
  - 'lib/pwn/plugins/nmap_it.rb'
148
100
 
149
- # Offense count: 2
101
+ # Offense count: 1
150
102
  # This cop supports safe autocorrection (--autocorrect).
151
103
  Style/IfUnlessModifier:
152
104
  Exclude:
153
105
  - 'lib/pwn/plugins/baresip.rb'
154
- - 'lib/pwn/plugins/mail_agent.rb'
155
106
 
156
107
  # Offense count: 9
157
108
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -165,7 +116,7 @@ Style/MapIntoArray:
165
116
  - 'lib/pwn/plugins/char.rb'
166
117
  - 'lib/pwn/plugins/nexpose_vuln_scan.rb'
167
118
 
168
- # Offense count: 9
119
+ # Offense count: 7
169
120
  # This cop supports safe autocorrection (--autocorrect).
170
121
  # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
171
122
  Style/MultipleComparison:
@@ -175,11 +126,15 @@ Style/MultipleComparison:
175
126
  - 'lib/pwn/sast/cmd_execution_ruby.rb'
176
127
  - 'lib/pwn/sast/deserial_java.rb'
177
128
  - 'lib/pwn/sast/factory.rb'
178
- - 'lib/pwn/sast/logger.rb'
179
- - 'lib/pwn/sast/throw_errors.rb'
180
129
  - 'lib/pwn/www/duckduckgo.rb'
181
130
  - 'lib/pwn/www/twitter.rb'
182
131
 
132
+ # Offense count: 1
133
+ # This cop supports safe autocorrection (--autocorrect).
134
+ Style/RedundantAssignment:
135
+ Exclude:
136
+ - 'lib/pwn/plugins/zaproxy.rb'
137
+
183
138
  # Offense count: 1
184
139
  # This cop supports safe autocorrection (--autocorrect).
185
140
  Style/RedundantBegin:
@@ -222,7 +177,7 @@ Style/RedundantStringEscape:
222
177
  - 'lib/pwn/sast/redos.rb'
223
178
  - 'vagrant/provisioners/kali_customize.rb'
224
179
 
225
- # Offense count: 58
180
+ # Offense count: 62
226
181
  # This cop supports unsafe autocorrection (--autocorrect-all).
227
182
  Style/SlicingWithRange:
228
183
  Enabled: false
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.406]:001 >>> PWN.help
40
+ pwn[v0.5.407]: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.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.406]:001 >>> PWN.help
55
+ pwn[v0.5.407]: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.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.406]:001 >>> PWN.help
65
+ pwn[v0.5.407]: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:
@@ -436,6 +436,31 @@ module PWN
436
436
  raise e
437
437
  end
438
438
 
439
+ # Supported Method Parameters::
440
+ # repeater_id = PWN::Plugins::BurpSuite.find_sitemap_entries(
441
+ # burp_obj: 'required - burp_obj returned by #start method',
442
+ # search_string: 'required - string to search for in the sitemap entries'
443
+ # )
444
+
445
+ public_class_method def self.find_sitemap_entries(opts = {})
446
+ burp_obj = opts[:burp_obj]
447
+ raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
448
+
449
+ search_string = opts[:search_string]
450
+ raise 'ERROR: search_string parameter is required' if search_string.nil?
451
+
452
+ rest_browser = burp_obj[:rest_browser]
453
+ mitm_rest_api = burp_obj[:mitm_rest_api]
454
+
455
+ json_sitemap = get_sitemap(burp_obj: burp_obj)
456
+ matching_entries = json_sitemap.select do |entry|
457
+ decoded_request = Base64.strict_decode64(entry[:request])
458
+ decoded_request.include?(search_string)
459
+ end
460
+ rescue StandardError => e
461
+ raise e
462
+ end
463
+
439
464
  # Supported Method Parameters:
440
465
  # json_sitemap = PWN::Plugins::BurpSuite.import_openapi_to_sitemap(
441
466
  # burp_obj: 'required - burp_obj returned by #start method',
@@ -1013,31 +1038,6 @@ module PWN
1013
1038
  raise e
1014
1039
  end
1015
1040
 
1016
- # Supported Method Parameters::
1017
- # repeater_id = PWN::Plugins::BurpSuite.find_sitemap_entries(
1018
- # burp_obj: 'required - burp_obj returned by #start method',
1019
- # search_string: 'required - string to search for in the sitemap entries'
1020
- # )
1021
-
1022
- public_class_method def self.find_sitemap_entries(opts = {})
1023
- burp_obj = opts[:burp_obj]
1024
- raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
1025
-
1026
- search_string = opts[:search_string]
1027
- raise 'ERROR: search_string parameter is required' if search_string.nil?
1028
-
1029
- rest_browser = burp_obj[:rest_browser]
1030
- mitm_rest_api = burp_obj[:mitm_rest_api]
1031
-
1032
- json_sitemap = get_sitemap(burp_obj: burp_obj)
1033
- matching_entries = json_sitemap.select do |entry|
1034
- decoded_request = Base64.strict_decode64(entry[:request])
1035
- decoded_request.include?(search_string)
1036
- end
1037
- rescue StandardError => e
1038
- raise e
1039
- end
1040
-
1041
1041
  # Supported Method Parameters::
1042
1042
  # repeater_id = PWN::Plugins::BurpSuite.add_repeater_tab(
1043
1043
  # burp_obj: 'required - burp_obj returned by #start method',
@@ -1395,6 +1395,11 @@ module PWN
1395
1395
  }
1396
1396
  )
1397
1397
 
1398
+ #{self}.find_sitemap_entry(
1399
+ burp_obj: 'required - burp_obj returned by #start method',
1400
+ search_string: 'required - string to search for in the sitemap entries'
1401
+ )
1402
+
1398
1403
  json_sitemap = #{self}.import_openapi_to_sitemap(
1399
1404
  burp_obj: 'required - burp_obj returned by #start method',
1400
1405
  openapi_spec: 'required - path to OpenAPI JSON or YAML specification file',
@@ -296,40 +296,23 @@ module PWN
296
296
  # Supported Method Parameters::
297
297
  # PWN::Plugins::Zaproxy.find_har_entries(
298
298
  # zap_obj: 'required - zap_obj returned from #open method',
299
- # request: 'required - base64 encoded request or HAR entry :request (e.g. from #get_sitemap method)'
299
+ # search_string: 'required - string to search for in the sitemap entries'
300
300
  # )
301
301
 
302
302
  public_class_method def self.find_har_entries(opts = {})
303
303
  zap_obj = opts[:zap_obj]
304
304
  api_key = zap_obj[:api_key].to_s.scrub
305
- request = opts[:request]
306
- raise 'ERROR: request must be provided' if request.nil?
305
+ search_string = opts[:search_string]
306
+ raise 'ERROR: search_string must be provided' if search_string.nil?
307
307
 
308
308
  har_sitemap = get_sitemap(
309
309
  zap_obj: zap_obj,
310
310
  return_as: :har
311
311
  )
312
312
 
313
- # HAR entry
314
- if request.is_a?(Hash) && request.key?(:method) && request.key?(:url) && request.key?(:httpVersion)
315
- har_entries = har_sitemap.select { |entry| entry[:request] == request }
316
- else
317
- # Base64 encoded string
318
- dec_request = Base64.strict_decode64(request).force_encoding('ASCII-8BIT') unless dec_request.is_a?(Hash)
319
-
320
- # Find the har request for the given base64 decoded dec_request value
321
- har_entries = har_sitemap.select do |entry|
322
- req = entry[:request]
323
- req_line = "#{req[:method]} #{req[:url]} #{req[:httpVersion]}\r\n"
324
- req_headers = req[:headers].map { |h| "#{h[:name]}: #{h[:value]}\r\n" }.join
325
- req_body = ''
326
- if req[:postData] && req[:postData][:text]
327
- req_body = req[:postData][:text]
328
- req_body = Base64.decode64(req_body) if req[:postData][:encoding] == 'base64'
329
- end
330
- full_req = "#{req_line}#{req_headers}\r\n#{req_body}".force_encoding('ASCII-8BIT')
331
- full_req == dec_request
332
- end
313
+ har_entries = har_sitemap.select do |entry|
314
+ json_request = entry[:request].to_json
315
+ json_request.include?(search_string)
333
316
  end
334
317
 
335
318
  har_entries
@@ -781,7 +764,7 @@ module PWN
781
764
 
782
765
  #{self}.find_har_entries(
783
766
  zap_obj: 'required - zap_obj returned from #open method',
784
- request: 'required - base64 encoded request or HAR entry :request (e.g. from #get_sitemap method)'
767
+ search_string: 'required - string to search for in the sitemap entries'
785
768
  )
786
769
 
787
770
  #{self}.requester(
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.406'
4
+ VERSION = '0.5.407'
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.406
4
+ version: 0.5.407
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.