pwn 0.4.907 → 0.4.909

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: fe78a4cdaa98fc3d5f8c27a93df730f0d6f868ed4c836eae301c14491e148e78
4
- data.tar.gz: 7331f43b33095b76b3405ed41c0b731b013d304355c097f58cd11ef0ff1b2023
3
+ metadata.gz: 39bbf680a6045bb2e60bceab8462fb445e59455e32e36c82eda6fd8533b34474
4
+ data.tar.gz: 87aa92579f26b3fc91e7b8a9a5e0b96ba6760bf61442bf57cd0c2848d73af505
5
5
  SHA512:
6
- metadata.gz: 29217fbd9e14fb93731c04ba41f543cbae4fc78cc0ba5dd021c5aa74ed7d9762fa0e8c16ce89ee81af21a8baddba9ffaab6e8fc0bf261647a495437f13d260b1
7
- data.tar.gz: 6f912c186e3b7b8a5b5595b3125508314d385c4cd91c2925fb94208701ed3b6821887d1d44dcf07f0358247ab6f2173a2b87548ea2edbd0c1bd2bdf1e2c992b9
6
+ metadata.gz: bab3d7df059662720204c2e6c110de09ea9975bdfd013335fd1f14d5cabdccce9a83d89e0c7010e3ae7287882ec333be5ca49782a7dad7200aed060895b6c1f2
7
+ data.tar.gz: 94a7f8b7282e4e3ea2d3353c3f2889168570ee0f76aa368f121ba4c7337b73802f5bc74740b00d9aee60c12456f2c1688f3561cb3fe5b820d866a52b531024af
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.907]:001 >>> PWN.help
40
+ pwn[v0.4.909]: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.2.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.907]:001 >>> PWN.help
55
+ pwn[v0.4.909]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn_www_checkip CHANGED
@@ -10,49 +10,57 @@ OptionParser.new do |options|
10
10
  options.banner = "USAGE:
11
11
  #{$PROGRAM_NAME} [opts]
12
12
  "
13
+ options.on('-tIP_HOST', '--target=IP_HOST', '<Optional - IP or Host to Check (Default - Your Public IP)>') do |t|
14
+ opts[:target] = t
15
+ end
13
16
 
14
- options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || tor>') do |p|
15
- opts[:proxy] = p
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
16
19
  end
17
20
 
18
21
  options.on('-i', '--[no-]ipinfo', '<Optional - Return Details about Public IP Returned from CheckIP>') do |i|
19
22
  opts[:ipinfo] = i
20
23
  end
24
+
25
+ options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || tor>') do |p|
26
+ opts[:proxy] = p
27
+ end
21
28
  end.parse!
22
29
 
23
- proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
30
+ target = opts[:target]
31
+ tls_port = opts[:tls_port]
24
32
  ipinfo = opts[:ipinfo]
33
+ proxy = opts[:proxy].to_s.scrub.strip.chomp unless opts[:proxy].nil?
25
34
 
26
35
  begin
27
- if proxy
36
+ if proxy && opts[:target].nil?
28
37
  browser_obj = PWN::Plugins::TransparentBrowser.open(
29
38
  browser_type: :rest,
30
39
  proxy: proxy
31
40
  )
32
- else
33
- browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
34
- end
35
- browser = browser_obj[:browser]::Request
36
-
37
- if proxy
38
- public_ip_address = browser.execute(
41
+ browser = browser_obj[:browser]::Request
42
+ target = browser.execute(
39
43
  method: :get,
40
44
  url: 'https://checkip.amazonaws.com',
41
45
  verify_ssl: false
42
46
  ).to_s.chomp
43
- else
44
- public_ip_address = browser.execute(
47
+ elsif opts[:target].nil?
48
+ browser_obj = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
49
+ browser = browser_obj[:browser]::Request
50
+ target = browser.execute(
45
51
  method: :get,
46
52
  url: 'https://checkip.amazonaws.com'
47
53
  ).to_s.chomp
48
54
  end
49
55
 
50
- puts "PUBLIC IP: #{public_ip_address}" unless ipinfo
56
+ puts "[ { \"public_ip\": \"#{target}\" } ]" if ipinfo.nil? && opts[:target].nil?
51
57
 
58
+ ipinfo = true if ipinfo.nil? && opts[:target]
52
59
  if ipinfo
53
60
  ip_info_obj = PWN::Plugins::IPInfo.get(
54
- target: public_ip_address,
55
- proxy: proxy
61
+ target: target,
62
+ proxy: proxy,
63
+ tls_port: tls_port
56
64
  )
57
65
  puts JSON.pretty_generate(ip_info_obj)
58
66
  end
@@ -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] = false
85
- ip_resp[:cert_subject] = false
86
- ip_resp[:cert_issuer] = false
87
- ip_resp[:cert_serial] = false
88
- ip_resp[:crl_uris] = false
89
- ip_resp[:extensions] = false
90
- ip_resp[:not_before] = false
91
- ip_resp[:not_after] = false
92
- ip_resp[:oscsp_uris] = false
93
- ip_resp[:pem] = false
94
- ip_resp[:signature_algorithm] = false
95
- ip_resp[:version] = false
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 { |ext| ext.to_s }
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
@@ -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
- opts[:tls].nil? ? tls = false : tls = true
154
+ tls = true if opts[:tls]
155
+ tls ||= false
155
156
 
156
157
  case protocol
157
158
  when :tcp
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.907'
4
+ VERSION = '0.4.909'
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.4.907
4
+ version: 0.4.909
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.