pwn 0.4.908 → 0.4.910
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 +2 -2
- data/bin/pwn_www_checkip +12 -9
- data/lib/pwn/plugins/ip_info.rb +16 -16
- data/lib/pwn/plugins/sock.rb +8 -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: 0e5b5fcff5cfcc3cd255ad4002d83e380cddcbad9a292f6f49f6b661b9c99042
|
4
|
+
data.tar.gz: b2b9f09b64164da56b798af7ab4d11d0fb5874ad35295cf32d5aacbdcd3f683a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68afcd359bf5660e29902575849e58239717d4116e2673828592c2b39135a780197e059405effd1b752b52c0f621095a269b413d82f789f8a0d992629f794b70
|
7
|
+
data.tar.gz: 3402edfa4ad389f09753638959884d99055ccb4b0465f09e01684da69185e6125e985aa74c33a1aa7ad28a5d45fe2702d67b1b03e56b8f124143c181277f42ad
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
37
37
|
$ rvm list gemsets
|
38
38
|
$ gem install --verbose pwn
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.4.
|
40
|
+
pwn[v0.4.910]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.2.2@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.4.
|
55
|
+
pwn[v0.4.910]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
data/bin/pwn_www_checkip
CHANGED
@@ -14,6 +14,10 @@ OptionParser.new do |options|
|
|
14
14
|
opts[:target] = t
|
15
15
|
end
|
16
16
|
|
17
|
+
options.on('-PPORT', '--tls-port=PORT', '<Optional - TLS Port to Check (Default - 443). Will not execute if --proxy parameter is set.>') do |p|
|
18
|
+
opts[:tls_port] = p
|
19
|
+
end
|
20
|
+
|
17
21
|
options.on('-i', '--[no-]ipinfo', '<Optional - Return Details about Public IP Returned from CheckIP>') do |i|
|
18
22
|
opts[:ipinfo] = i
|
19
23
|
end
|
@@ -24,40 +28,39 @@ OptionParser.new do |options|
|
|
24
28
|
end.parse!
|
25
29
|
|
26
30
|
target = opts[:target]
|
31
|
+
tls_port = opts[:tls_port]
|
27
32
|
ipinfo = opts[:ipinfo]
|
28
33
|
proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
|
29
34
|
|
30
35
|
begin
|
31
|
-
if proxy
|
36
|
+
if proxy && opts[:target].nil?
|
32
37
|
browser_obj = PWN::Plugins::TransparentBrowser.open(
|
33
38
|
browser_type: :rest,
|
34
39
|
proxy: proxy
|
35
40
|
)
|
36
|
-
|
37
|
-
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
|
38
|
-
end
|
39
|
-
browser = browser_obj[:browser]::Request
|
40
|
-
|
41
|
-
if proxy && opts[:target].nil?
|
41
|
+
browser = browser_obj[:browser]::Request
|
42
42
|
target = browser.execute(
|
43
43
|
method: :get,
|
44
44
|
url: 'https://checkip.amazonaws.com',
|
45
45
|
verify_ssl: false
|
46
46
|
).to_s.chomp
|
47
47
|
elsif opts[:target].nil?
|
48
|
+
browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
|
49
|
+
browser = browser_obj[:browser]::Request
|
48
50
|
target = browser.execute(
|
49
51
|
method: :get,
|
50
52
|
url: 'https://checkip.amazonaws.com'
|
51
53
|
).to_s.chomp
|
52
54
|
end
|
53
55
|
|
54
|
-
puts "[ { \"
|
56
|
+
puts "[ { \"query\": \"#{target}\" } ]" if ipinfo.nil? && opts[:target].nil?
|
55
57
|
|
56
58
|
ipinfo = true if ipinfo.nil? && opts[:target]
|
57
59
|
if ipinfo
|
58
60
|
ip_info_obj = PWN::Plugins::IPInfo.get(
|
59
61
|
target: target,
|
60
|
-
proxy: proxy
|
62
|
+
proxy: proxy,
|
63
|
+
tls_port: tls_port
|
61
64
|
)
|
62
65
|
puts JSON.pretty_generate(ip_info_obj)
|
63
66
|
end
|
data/lib/pwn/plugins/ip_info.rb
CHANGED
@@ -81,18 +81,18 @@ module PWN
|
|
81
81
|
)
|
82
82
|
|
83
83
|
ip_resp[:tls_avail] = tls_port_avail
|
84
|
-
ip_resp[:ca_issuer_uris] =
|
85
|
-
ip_resp[:cert_subject] =
|
86
|
-
ip_resp[:cert_issuer] =
|
87
|
-
ip_resp[:cert_serial] =
|
88
|
-
ip_resp[:crl_uris] =
|
89
|
-
ip_resp[:extensions] =
|
90
|
-
ip_resp[:not_before] =
|
91
|
-
ip_resp[:not_after] =
|
92
|
-
ip_resp[:oscsp_uris] =
|
93
|
-
ip_resp[:pem] =
|
94
|
-
ip_resp[:signature_algorithm] =
|
95
|
-
ip_resp[:version] =
|
84
|
+
ip_resp[:ca_issuer_uris] = nil
|
85
|
+
ip_resp[:cert_subject] = nil
|
86
|
+
ip_resp[:cert_issuer] = nil
|
87
|
+
ip_resp[:cert_serial] = nil
|
88
|
+
ip_resp[:crl_uris] = nil
|
89
|
+
ip_resp[:extensions] = nil
|
90
|
+
ip_resp[:not_before] = nil
|
91
|
+
ip_resp[:not_after] = nil
|
92
|
+
ip_resp[:oscsp_uris] = nil
|
93
|
+
ip_resp[:pem] = nil
|
94
|
+
ip_resp[:signature_algorithm] = nil
|
95
|
+
ip_resp[:version] = nil
|
96
96
|
next unless tls_port_avail
|
97
97
|
|
98
98
|
cert_obj = PWN::Plugins::Sock.get_tls_cert(
|
@@ -102,15 +102,15 @@ module PWN
|
|
102
102
|
|
103
103
|
next unless cert_obj.is_a?(OpenSSL::X509::Certificate)
|
104
104
|
|
105
|
-
ip_resp[:ca_issuer_uris] = cert_obj.ca_issuer_uris.to_s
|
105
|
+
ip_resp[:ca_issuer_uris] = cert_obj.ca_issuer_uris.map(&:to_s) unless cert_obj.ca_issuer_uris.nil?
|
106
106
|
ip_resp[:cert_subject] = cert_obj.subject.to_s
|
107
107
|
ip_resp[:cert_issuer] = cert_obj.issuer.to_s
|
108
108
|
ip_resp[:cert_serial] = cert_obj.serial.to_s
|
109
|
-
ip_resp[:crl_uris] = cert_obj.crl_uris.to_s
|
110
|
-
ip_resp[:extensions] = cert_obj.extensions.map
|
109
|
+
ip_resp[:crl_uris] = cert_obj.crl_uris.map(&:to_s) unless cert_obj.crl_uris.nil?
|
110
|
+
ip_resp[:extensions] = cert_obj.extensions.map(&:to_s) unless cert_obj.extensions.nil?
|
111
111
|
ip_resp[:not_before] = cert_obj.not_before.to_s
|
112
112
|
ip_resp[:not_after] = cert_obj.not_after.to_s
|
113
|
-
ip_resp[:oscsp_uris] = cert_obj.ocsp_uris.to_s
|
113
|
+
ip_resp[:oscsp_uris] = cert_obj.ocsp_uris.map(&:to_s) unless cert_obj.ocsp_uris.nil?
|
114
114
|
ip_resp[:pem] = cert_obj.to_pem.to_s
|
115
115
|
ip_resp[:signature_algorithm] = cert_obj.signature_algorithm.to_s
|
116
116
|
ip_resp[:version] = cert_obj.version.to_s
|
data/lib/pwn/plugins/sock.rb
CHANGED
@@ -151,7 +151,8 @@ module PWN
|
|
151
151
|
server_ip = opts[:server_ip].to_s.scrub
|
152
152
|
port = opts[:port].to_i
|
153
153
|
opts[:protocol].nil? ? protocol = :tcp : protocol = opts[:protocol].to_s.downcase.to_sym
|
154
|
-
|
154
|
+
tls = true if opts[:tls]
|
155
|
+
tls ||= false
|
155
156
|
|
156
157
|
case protocol
|
157
158
|
when :tcp
|
@@ -271,7 +272,12 @@ module PWN
|
|
271
272
|
tls: 'optional - boolean listen on TLS-enabled socket (defaults to false)'
|
272
273
|
)
|
273
274
|
|
274
|
-
|
275
|
+
cert_obj = #{self}.get_tls_cert(
|
276
|
+
target: 'required - target host or ip',
|
277
|
+
port: 'optional - target port (defaults to 443)'
|
278
|
+
)
|
279
|
+
|
280
|
+
sock_obj = #{self}.disconnect(
|
275
281
|
sock_obj: 'required - sock_obj returned from #connect method'
|
276
282
|
)
|
277
283
|
|
data/lib/pwn/version.rb
CHANGED