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 +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/zaproxy.rb +15 -2
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d06c6b5e12a9f4cf4234fac12f6ab411827e323c3e9e0a47619f0dbef244c48
|
4
|
+
data.tar.gz: 3add4e6e3d8aa13f210500668182dafccc85c212e1d4b13cabda9d932ccaf668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
40
|
+
pwn[v0.5.408]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
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.
|
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:
|
data/lib/pwn/plugins/zaproxy.rb
CHANGED
@@ -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
|
-
|
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