pwn 0.4.384 → 0.4.385

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: 01e5e3df0ac88dc250a1802ee64b5cc2f86b5914a629b73962248d834edac063
4
- data.tar.gz: 3addee02b1cb5672ad73d9fcb37034e728411fa61285f5d489c58fe2d56cd505
3
+ metadata.gz: 75736869902b7c6f459eba755d600c32701d7dbc7195aaf9d38219575fbf3f03
4
+ data.tar.gz: 47e399e9a118b2213dcc69273b8c21ecd9d57e2954c36cc90abb0dd9767ec1fb
5
5
  SHA512:
6
- metadata.gz: 75b5d00ca3d50dc0047f57cea1fcf192fae4fdf25c25ba3432118e93f0346437bd64eb7d6dc78f7b5b10fb6b057914a8cd630f586a6d58c9e4d56b899b546234
7
- data.tar.gz: 74f07a6e5fce1dfa28a1e2bf67f59d71f007bfad73e2c3098a9b0931a9ff7fdaa0b06b559a9305c9378eff33361893af238e2e3e83562b6b7ed6f410afaa2222
6
+ metadata.gz: c24ab122a7f3973a06b53593e3da3fe2ff230afcfd379f0fcfd07150ef1a5abe7f16b7158d1ff26b19b6f0b9ca04241740d0a052f02a08ab2d49ddb65bebc863
7
+ data.tar.gz: e33a0711c81d27e1889038d8fbde16a564bd179d6f0f49a277f8a457c0ae57d05d37afd808b93dd4a7e715a009f59e36537ee71e41d87b79a958b0ab8cff19a2
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.1@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.384]:001 >>> PWN.help
40
+ pwn[v0.4.385]: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.1.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.384]:001 >>> PWN.help
55
+ pwn[v0.4.385]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -66,7 +66,7 @@ begin
66
66
  browser_obj.goto('https://domainbigdata.com')
67
67
 
68
68
  # Type Registrant Filter in Char-by-Char to Ensure Everyone is Happy ;)
69
- PWN::Plugins::TransparentBrowser.type_as_human(q: registrant_filter) do |char|
69
+ PWN::Plugins::TransparentBrowser.type_as_human(string: registrant_filter) do |char|
70
70
  browser_obj.text_field(id: 'txtSearchTopPage').wait_until(&:present?).send_keys(char)
71
71
  end
72
72
  browser_obj.button(id: 'btnTopSearch').wait_until(&:present?).click
@@ -5,6 +5,7 @@ require 'selenium/webdriver'
5
5
  require 'selenium/devtools'
6
6
  require 'rest-client'
7
7
  require 'socksify'
8
+ require 'openssl'
8
9
  require 'em/pure_ruby'
9
10
  require 'faye/websocket'
10
11
 
@@ -260,12 +261,12 @@ module PWN
260
261
 
261
262
  # Supported Method Parameters::
262
263
  # PWN::Plugins::TransparentBrowser.type_as_human(
263
- # q: 'required - query string to randomize',
264
+ # string: 'required - string to type as human',
264
265
  # rand_sleep_float: 'optional - float timing in between keypress (defaults to 0.09)'
265
266
  # )
266
267
 
267
268
  public_class_method def self.type_as_human(opts = {})
268
- query_string = opts[:q].to_s
269
+ string = opts[:string].to_s
269
270
 
270
271
  rand_sleep_float = if opts[:rand_sleep_float]
271
272
  opts[:rand_sleep_float].to_f
@@ -273,7 +274,7 @@ module PWN
273
274
  0.09
274
275
  end
275
276
 
276
- query_string.each_char do |char|
277
+ string.each_char do |char|
277
278
  yield char
278
279
  sleep Random.rand(rand_sleep_float)
279
280
  end
@@ -342,32 +343,55 @@ module PWN
342
343
 
343
344
  * Debugging DOM and Sending JavaScript to Console
344
345
  devtools.send_cmd('Runtime.enable')
346
+ devtools.send_cmd('Console.enable')
345
347
  devtools.send_cmd('DOM.enable')
348
+ devtools.send_cmd('Page.enable')
349
+ devtools.send_cmd('Network.enable')
346
350
  devtools.send_cmd('Log.enable')
347
351
  devtools.send_cmd('Debugger.enable')
348
352
  devtools.send_cmd('Debugger.pause')
349
- console_cmd = {
350
- expression: 'console.log(global);'
351
- }
352
353
  step = 1
354
+ next_step = 60
353
355
  loop do
356
+ console_events = []
357
+ b.driver.on_log_event(:console) { |event| console_events.push(event) }
358
+
354
359
  devtools.send_cmd('Debugger.stepInto')
355
360
  puts \"Step: \#{step}\"
356
- this_call = devtools.instance_variable_get('@messages').last['params']['callFrames'].last if devtools.instance_variable_get('@messages').last['method'] == 'Debugger.paused'
357
- puts \"Function Name: \#{this_call['functionName']}\"
361
+
358
362
  this_document = devtools.send_cmd('DOM.getDocument')
359
363
  puts \"This #document:\\n\#{this_document}\\n\\n\\n\"
360
364
 
361
- this_global = devtools.send_cmd(
362
- 'Runtime.evaluate',
363
- **console_cmd
364
- )
365
- puts \"This #global:\\n\#{this_global}\\n\\n\\n\"
365
+ console_cmd = {
366
+ expression: 'for(var pop_var in window) { if (window.hasOwnProperty(pop_var) && window[pop_var] != null) console.log(pop_var + \" = \" + window[pop_var]); }'
367
+ }
368
+ puts devtools.send_cmd('Runtime.evaluate', **console_cmd)
366
369
 
367
- sleep 9
370
+ print '-' * 180
371
+ print \"\\n\"
372
+ console_events.each do |event|
373
+ puts event.args
374
+ end
375
+ puts \"Console Response Length: \#{console_events.length}\"
376
+ console_events_digest = OpenSSL::Digest::SHA256.hexdigest(
377
+ console_events.inspect
378
+ )
379
+ puts \"Console Events Array SHA256 Digest: \#{console_events_digest}\"
380
+ print '-' * 180
381
+ puts \"\\n\\n\\n\"
382
+
383
+ print \"Next Step in \"
384
+ next_step.downto(1) {|n| print \"\#{n} \"; sleep 1 }
385
+ puts 'READY!'
386
+ step += 1
368
387
  end
388
+
369
389
  devtools.send_cmd('Debugger.disable')
390
+ devtools.send_cmd('Log.disable')
391
+ devtools.send_cmd('Network.disable')
392
+ devtools.send_cmd('Page.disable')
370
393
  devtools.send_cmd('DOM.disable')
394
+ devtools.send_cmd('Console.disable')
371
395
  devtools.send_cmd('Runtime.disable')
372
396
  * End of DevTools Examples
373
397
  ********************************************************
@@ -377,9 +401,9 @@ module PWN
377
401
  )
378
402
 
379
403
  #{self}.type_as_human(
380
- q: 'required - query string to randomize',
404
+ string: 'required - string to type as human',
381
405
  rand_sleep_float: 'optional - float timing in between keypress (defaults to 0.09)'
382
- ) {|char| browser_obj1.text_field(name: \"q\").send_keys(char) }
406
+ ) {|char| browser_obj1.text_field(name: \"search\").send_keys(char) }
383
407
 
384
408
  browser_obj1 = #{self}.close(
385
409
  browser_obj: 'required - browser_obj returned from #open method)'
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.384'
4
+ VERSION = '0.4.385'
5
5
  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.4.384
4
+ version: 0.4.385
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-29 00:00:00.000000000 Z
11
+ date: 2022-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport