pwn 0.4.381 → 0.4.384

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: 6b4a3fb3530004d315ca505daa165aa522e1e42cb1d0a67dcea4404ca3c03d97
4
- data.tar.gz: 8f7bc5333c051e88b84d3e19790a60b69cc6020db62685a37665315094f7ae72
3
+ metadata.gz: 01e5e3df0ac88dc250a1802ee64b5cc2f86b5914a629b73962248d834edac063
4
+ data.tar.gz: 3addee02b1cb5672ad73d9fcb37034e728411fa61285f5d489c58fe2d56cd505
5
5
  SHA512:
6
- metadata.gz: 2dfcb3127cddf9314b7512a7b8323f217a17c4adf70ad35f44ae0be43463a9b6af594a52de14ceb5e51d0b18883dc19b08d036a9548d89f365d247e19eb852b8
7
- data.tar.gz: 0fcf308f4305de23f332e292684830e8528f4de2fc7007ec2d12faba74d31077a58f97a03e07e5608af1d66d3c92b0a536d4e81ead40cb9dea2d29eda0ab1faf
6
+ metadata.gz: 75b5d00ca3d50dc0047f57cea1fcf192fae4fdf25c25ba3432118e93f0346437bd64eb7d6dc78f7b5b10fb6b057914a8cd630f586a6d58c9e4d56b899b546234
7
+ data.tar.gz: 74f07a6e5fce1dfa28a1e2bf67f59d71f007bfad73e2c3098a9b0931a9ff7fdaa0b06b559a9305c9378eff33361893af238e2e3e83562b6b7ed6f410afaa2222
data/README.md CHANGED
@@ -31,12 +31,13 @@ Leveraging various pre-built modules and the pwn prototyper, you can mix-and-mat
31
31
  Tested on Linux, & OSX leveraging Ruby via RVM.
32
32
 
33
33
  ```
34
+ $ rvm use ruby-3.1.1@global
34
35
  $ rvm gemset create pwn
36
+ $ rvm use ruby-3.1.1@pwn
35
37
  $ rvm list gemsets
36
- $ rvm use ruby-<VERSION>@pwn
37
38
  $ gem install --verbose pwn
38
39
  $ pwn
39
- pwn[v0.4.381]:001 >>> PWN.help
40
+ pwn[v0.4.384]:001 >>> PWN.help
40
41
  ```
41
42
 
42
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -47,11 +48,11 @@ pwn[v0.4.381]:001 >>> PWN.help
47
48
  It's wise to update pwn often as numerous versions are released/week:
48
49
  ```
49
50
  $ rvm list gemsets
50
- $ rvm use ruby-<VERSION>@pwn
51
+ $ rvm use ruby-3.1.1@pwn
51
52
  $ gem uninstall --all --executables pwn
52
53
  $ gem install --verbose pwn
53
54
  $ pwn
54
- pwn[v0.4.381]:001 >>> PWN.help
55
+ pwn[v0.4.384]:001 >>> PWN.help
55
56
  ```
56
57
 
57
58
 
@@ -5,6 +5,7 @@ require 'pwn'
5
5
 
6
6
  old_rev = PWN::VERSION
7
7
  readme_md_path = './README.md'
8
+ current_ruby = './.ruby-version'
8
9
  placeholder_arr = old_rev.split('.')
9
10
  major = placeholder_arr[0].to_i
10
11
  minor = placeholder_arr[1].to_i
@@ -37,11 +38,18 @@ File.open('./lib/pwn/version.rb', 'w') do |f|
37
38
  end
38
39
 
39
40
  # Update README.md
41
+ current_ruby_version = "ruby-#{File.read(current_ruby).chomp}"
40
42
  old_readme_md = File.read(readme_md_path, encoding: 'utf-8')
43
+ pwn_regex = 'pwn\[v.+\..+\..+\]'
44
+ rb_regex = 'ruby-.+'
41
45
  File.open(readme_md_path, 'w') do |file|
42
46
  old_readme_md.each_line do |line|
43
- if line.to_s.scrub.match?(/pwn\[v.+\..+\..+\]/)
44
- new_line = line.to_s.gsub(/pwn\[v#{old_rev}\]/, "pwn\[v#{new_rev}\]")
47
+ if line.to_s.scrub.match?(/#{pwn_regex}/) ||
48
+ line.to_s.scrub.match?(/#{rb_regex}/)
49
+
50
+ new_line = line.to_s.gsub(/pwn\[v#{old_rev}\]/, "pwn\[v#{new_rev}\]") if line.to_s.scrub.match?(/#{pwn_regex}/)
51
+ new_line = line.to_s.gsub(/ruby-.+(?=(@))/, current_ruby_version) if line.to_s.scrub.match?(/#{rb_regex}/)
52
+
45
53
  file.puts new_line
46
54
  else
47
55
  file.puts line
@@ -317,22 +317,61 @@ module PWN
317
317
  with_devtools: 'optional - boolean (defaults to false)'
318
318
  )
319
319
  puts browser_obj1.public_methods
320
- * Only works w/ Chrome
320
+
321
+ ********************************************************
322
+ * DevTools Interaction Only works w/ Chrome
321
323
  * All DevTools Commands can be found here:
322
324
  * https://chromedevtools.github.io/devtools-protocol/
325
+ * Examples
323
326
  devtools = browser_obj1.driver.devtools
324
327
  puts devtools.public_methods
325
328
  puts devtools.instance_variables
326
329
  puts devtools.instance_variable_get('@messages')
330
+
331
+ * Tracing
327
332
  devtools.send_cmd('Tracing.start')
328
333
  devtools.send_cmd('Tracing.requestMemoryDump')
329
334
  devtools.send_cmd('Tracing.end')
330
335
  puts devtools.instance_variable_get('@messages')
336
+
337
+ * Network
331
338
  devtools.send_cmd('Network.enable')
332
- last_ws_resp = devtools.instance_variable_get('@messages').last if devtools.instance_variable_get('@messages')['method'] == 'Network.webSocketFrameReceived'
339
+ last_ws_resp = devtools.instance_variable_get('@messages').last if devtools.instance_variable_get('@messages').last['method'] == 'Network.webSocketFrameReceived'
333
340
  puts last_ws_resp
334
341
  devtools.send_cmd('Network.disable')
335
342
 
343
+ * Debugging DOM and Sending JavaScript to Console
344
+ devtools.send_cmd('Runtime.enable')
345
+ devtools.send_cmd('DOM.enable')
346
+ devtools.send_cmd('Log.enable')
347
+ devtools.send_cmd('Debugger.enable')
348
+ devtools.send_cmd('Debugger.pause')
349
+ console_cmd = {
350
+ expression: 'console.log(global);'
351
+ }
352
+ step = 1
353
+ loop do
354
+ devtools.send_cmd('Debugger.stepInto')
355
+ 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']}\"
358
+ this_document = devtools.send_cmd('DOM.getDocument')
359
+ puts \"This #document:\\n\#{this_document}\\n\\n\\n\"
360
+
361
+ this_global = devtools.send_cmd(
362
+ 'Runtime.evaluate',
363
+ **console_cmd
364
+ )
365
+ puts \"This #global:\\n\#{this_global}\\n\\n\\n\"
366
+
367
+ sleep 9
368
+ end
369
+ devtools.send_cmd('Debugger.disable')
370
+ devtools.send_cmd('DOM.disable')
371
+ devtools.send_cmd('Runtime.disable')
372
+ * End of DevTools Examples
373
+ ********************************************************
374
+
336
375
  browser_obj1 = #{self}.linkout(
337
376
  browser_obj: 'required - browser_obj returned from #open method)'
338
377
  )
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.381'
4
+ VERSION = '0.4.384'
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.381
4
+ version: 0.4.384
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-28 00:00:00.000000000 Z
11
+ date: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport