pwn 0.5.407 → 0.5.408

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: 6cdcedb953c971c8feccabd99bb44f1e229254d4adbaf8f5d06c53416da1d3c7
4
- data.tar.gz: 2642aa96456651ef17d042794f21ad69754335e8d3b8d7e3415e311adb1dbd05
3
+ metadata.gz: 8d06c6b5e12a9f4cf4234fac12f6ab411827e323c3e9e0a47619f0dbef244c48
4
+ data.tar.gz: 3add4e6e3d8aa13f210500668182dafccc85c212e1d4b13cabda9d932ccaf668
5
5
  SHA512:
6
- metadata.gz: 8041d87f4162ebb4fb28c9b6acc5cfae7394fb4e082cd8a4a99e6ac22f1181701a0e32d28e97593d7e169cadc80ca71c76d0144d7e313e16c8c9b1ee799bd20a
7
- data.tar.gz: 0a654b39bf9c3f63b24accc464fd7b8222f060dfd5748118e99771d8ef9897e6551c95e63b40fdd4b0eabfe21694241a448c3a00607e21306b7e64683b871500
6
+ metadata.gz: 715b74eaecca58b65bfabe0b9e025eb807068ce7774ab04d3ed21ba29c52b597a7e730c45fff58a6a97d95566dd9d987fb29f2f63b212f28e0d9869c21822374
7
+ data.tar.gz: 7d93377be56f0f32aa29f4e8321d789fb63b100b0a6b212f2857286045035706afcee3138998c7f15428f919a195457449e9945feba15678838c85a724cf44e4
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.407]:001 >>> PWN.help
40
+ pwn[v0.5.408]: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.407]:001 >>> PWN.help
55
+ pwn[v0.5.408]: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.407]:001 >>> PWN.help
65
+ pwn[v0.5.408]: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:
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'cgi'
4
+ require 'fileutils'
4
5
  require 'pty'
5
6
  require 'securerandom'
6
7
  require 'json'
@@ -113,10 +114,15 @@ module PWN
113
114
 
114
115
  zap_obj[:mitm_browser] = browser_obj2
115
116
 
117
+ timestamp = Time.now.strftime('%Y-%m-%d_%H-%M-%S%z')
118
+ session_path = "/tmp/zaproxy-#{timestamp}.session"
119
+ zap_obj[:session_path] = session_path
120
+
116
121
  if headless
117
- zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin} -daemon"
122
+ # TODO: Ensure Default Context still exists and is default context
123
+ zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin} -daemon -newsession #{session_path}"
118
124
  else
119
- zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin}"
125
+ zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin} -newsession #{session_path}"
120
126
  end
121
127
 
122
128
  zaproxy_cmd = "#{zaproxy_cmd} -host #{zap_ip} -port #{zap_port}"
@@ -501,6 +507,8 @@ module PWN
501
507
  scan_policy = opts[:scan_policy] ||= 'Default Policy'
502
508
 
503
509
  exclude_paths.each do |exclude_path|
510
+ # Remove trailing .* from target_url if it exists
511
+ target_url = target_url.delete_suffix('.*') if target_url.end_with?('.*')
504
512
  exclude_path_regex = "#{target_url}#{exclude_path}.*"
505
513
  params = {
506
514
  apikey: api_key,
@@ -717,6 +725,11 @@ module PWN
717
725
  params: params
718
726
  )
719
727
 
728
+ session_path = zap_obj[:session_path]
729
+ session_path_files = Dir.glob("#{session_path}*")
730
+ # Remove session files - need to add a slight delay between each unlink to work around file locks
731
+ session_path_files.each { |f| FileUtils.rm_f(f); sleep 0.3 }
732
+
720
733
  zap_obj = nil
721
734
  rescue StandardError, SystemExit, Interrupt => e
722
735
  raise e
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.407'
4
+ VERSION = '0.5.408'
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.407
4
+ version: 0.5.408
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.