pwn 0.4.810 → 0.4.813

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: 882c1d390d4998cf8afa29f9c2f9ef744c0f7c6119ebc7a498a0c91df4b0a3fc
4
- data.tar.gz: a5f61eb7011a689c7549ad33cfd11bebfea98d332568478086b961a3e2abf385
3
+ metadata.gz: 4180ba499107cf08547cffbb006d958959eadb02df8e336f534e114348194bdc
4
+ data.tar.gz: e250433e80715ffc153b303b6dac0bb06ec6a22fea437d6b6e5ab49ea0122429
5
5
  SHA512:
6
- metadata.gz: 684ab1368fc47db2cd4af7adbd988f34966937390c57990138342dc0ae085758b51e80f5d5b590094351cebd0e8eaaa0799b147ddd5ea8576d359c6f9879841b
7
- data.tar.gz: 1c023903bf84336ff469d93d40eec8d8ddcc0e244dfc8182d5b04893883229d57d9d52a03e22f00e18c3ac51be5dd1a180c267aa21084df02053742e228af007
6
+ metadata.gz: 8a209a39abc1ff6088b141afe3a19592e91e955dae687a6adc3d3e9c264b8bb1ba84dd8c276d9442f83c0760cd131839929be5ac54567a0fb4193d4c3687dca0
7
+ data.tar.gz: e88c7b94dff0693f9ee99caeb5f821698f865e22660c939ef52f7efcea8b313eb86216dfc0d0eab250b282907072940962f08cb8efca7141f2cae16c01e37da1
data/Gemfile CHANGED
@@ -42,7 +42,6 @@ gem 'luhn', '1.0.2'
42
42
  gem 'mail', '2.8.1'
43
43
  gem 'mongo', '2.19.1'
44
44
  gem 'msfrpc-client', '1.1.2'
45
- gem 'neovim', '0.9.0'
46
45
  gem 'netaddr', '2.0.6'
47
46
  gem 'net-ldap', '0.18.0'
48
47
  gem 'net-openvpn', '0.8.7'
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.810]:001 >>> PWN.help
40
+ pwn[v0.4.813]: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.810]:001 >>> PWN.help
55
+ pwn[v0.4.813]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -67,6 +67,10 @@ OptionParser.new do |options|
67
67
  opts[:max_threads] = i
68
68
  end
69
69
 
70
+ options.on('-nREPORTNAME', '--report-name=REPORTNAME', '<Optional Report Name (Defaults to, "File.basename(Dir.pwd)")>') do |n|
71
+ opts[:report_name] = n
72
+ end
73
+
70
74
  options.on('-s', '--[no-]start-reporting-server', '<Optional - Start Simple HTTP Server for Reporting>') do |s|
71
75
  opts[:start_reporting_server] = s
72
76
  end
@@ -103,9 +107,16 @@ opts[:char_encoding].nil? ? char_encoding = 'UTF-8' : char_encoding = opts[:char
103
107
  response_timeout = opts[:response_timeout]
104
108
  request_rate_limit = opts[:request_rate_limit]
105
109
  opts[:max_threads].nil? ? max_threads = 1 : max_threads = opts[:max_threads].to_i
110
+ report_name = opts[:report_name]
111
+ report_name ||= File.basename(Dir.pwd)
106
112
  start_reporting_server = opts[:start_reporting_server]
107
113
 
108
- results_hash = { data: [] }
114
+ results_hash = {
115
+ report_name: HTMLEntities.new.encode(
116
+ report_name.to_s.strip.scrub.chomp
117
+ ),
118
+ data: []
119
+ }
109
120
  results_arr = []
110
121
  mutex = Mutex.new
111
122
 
@@ -150,13 +161,13 @@ puts 'complete.'
150
161
 
151
162
  # Start Simple HTTP Server (If Requested)
152
163
  if start_reporting_server
153
- listen_port = 3333
164
+ listen_port = PWN::Plugins::Sock.get_random_unused_port
154
165
  if pwn_provider == 'docker'
155
166
  listen_ip = '0.0.0.0'
156
167
  else
157
168
  listen_ip = '127.0.0.1'
158
169
  end
159
- puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/pwn_fuzz_net_app_proto.html"
170
+ puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/#{report_name}.html"
160
171
  simple_http_server_params = "-i #{listen_ip} -p #{listen_port}"
161
172
  Dir.chdir(dir_path)
162
173
  system(
data/bin/pwn_phone CHANGED
@@ -42,6 +42,10 @@ OptionParser.new do |options|
42
42
  opts[:randomize] = r
43
43
  end
44
44
 
45
+ options.on('-nREPORTNAME', '--report-name=REPORTNAME', '<Optional Report Name (Defaults to, "File.basename(Dir.pwd)")>') do |n|
46
+ opts[:report_name] = n
47
+ end
48
+
45
49
  options.on('-H', '--[no-]start-reporting-server', '<Optional - Start Simple HTTP Server for Reporting>') do |s|
46
50
  opts[:start_reporting_server] = s
47
51
  end
@@ -81,6 +85,8 @@ begin
81
85
 
82
86
  # Optional Flag Variables
83
87
  randomize = opts[:randomize]
88
+ report_name = opts[:report_name]
89
+ report_name ||= File.basename(Dir.pwd)
84
90
  start_reporting_server = opts[:start_reporting_server]
85
91
  speech_to_text = opts[:speech_to_text]
86
92
  src_num_rules = opts[:src_num_rules]
@@ -94,7 +100,8 @@ begin
94
100
  src_num_rules: src_num_rules,
95
101
  seconds_to_record: seconds_to_record,
96
102
  sox_bin: sox_bin,
97
- speech_to_text: speech_to_text
103
+ speech_to_text: speech_to_text,
104
+ report_name: report_name
98
105
  )
99
106
 
100
107
  # Generate HTML Report
@@ -107,7 +114,7 @@ begin
107
114
 
108
115
  # Start Simple HTTP Server (If Requested)
109
116
  if start_reporting_server
110
- listen_port = Random.rand(1_025..65_535).to_s
117
+ listen_port = PWN::Plugins::Sock.get_random_unused_port
111
118
 
112
119
  if pwn_provider == 'docker'
113
120
  listen_ip = '0.0.0.0'
@@ -115,7 +122,7 @@ begin
115
122
  listen_ip = '127.0.0.1'
116
123
  end
117
124
 
118
- puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/pwn_phone.html"
125
+ puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/#{report_name}.html"
119
126
  Dir.chdir(session_root)
120
127
  system(
121
128
  'pwn_simple_http_server',
data/bin/pwn_sast CHANGED
@@ -162,7 +162,7 @@ begin
162
162
 
163
163
  # Start Simple HTTP Server (If Requested)
164
164
  if start_reporting_server
165
- listen_port = Random.rand(1_025..65_535).to_s
165
+ listen_port = PWN::Plugins::Sock.get_random_unused_port
166
166
 
167
167
  if pwn_provider == 'docker'
168
168
  listen_ip = '0.0.0.0'
@@ -170,7 +170,7 @@ begin
170
170
  listen_ip = '127.0.0.1'
171
171
  end
172
172
 
173
- puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/pwn_scan_git_source.html"
173
+ puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/#{report_name}.html"
174
174
  Dir.chdir(dir_path)
175
175
  system(
176
176
  'pwn_simple_http_server',
@@ -21,11 +21,15 @@ OptionParser.new do |options|
21
21
  opts[:wordlist] = w
22
22
  end
23
23
 
24
+ options.on('-aPATTERN', '--append=PATTERN', '<Optional - Append Pattern to Each Entry in the Wordlist (e.g .inc, .BAK, .git, etc>') do |a|
25
+ opts[:append_pattern] = a
26
+ end
27
+
24
28
  options.on('-pPROXY', '--proxy=PROXY', '<Optional - Proxy SCHEME://ADDRESS:PORT>') do |p|
25
29
  opts[:proxy] = p
26
30
  end
27
31
 
28
- options.on('-tTHREADS', '--max-threads=THREADS', '<Optional # HTTP Requests to Run Simultaneously (Default 100)>') do |t|
32
+ options.on('-tTHREADS', '--max-threads=THREADS', '<Optional # HTTP Requests to Run Simultaneously (Default 25)>') do |t|
29
33
  opts[:max_threads] = t
30
34
  end
31
35
 
@@ -105,6 +109,7 @@ def request_path(opts = {})
105
109
  raise 'ERROR: Connection(s) Refused. Try lowering the --max-threads value.'
106
110
  rescue Errno::ECONNRESET,
107
111
  RestClient::Exceptions::ReadTimeout,
112
+ RestClient::Exceptions::OpenTimeout,
108
113
  RestClient::ServerBrokeConnection => e
109
114
  rest_client_resp_hash = {
110
115
  request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
@@ -115,14 +120,25 @@ def request_path(opts = {})
115
120
  http_resp: e.class
116
121
  }
117
122
  rescue RestClient::ExceptionWithResponse => e
118
- rest_client_resp_hash = {
119
- request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
120
- http_uri: http_uri,
121
- http_method: http_method,
122
- http_resp_code: e.response.code,
123
- http_resp_length: e.response.body.length,
124
- http_resp: "#{e.response.body[0..300]}..."
125
- }
123
+ if e.responds_to?(:response)
124
+ rest_client_resp_hash = {
125
+ request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
126
+ http_uri: http_uri,
127
+ http_method: http_method,
128
+ http_resp_code: e.response.code,
129
+ http_resp_length: e.response.body.length,
130
+ http_resp: "#{e.response.body[0..300]}..."
131
+ }
132
+ else
133
+ resp_client_resp_hash = {
134
+ request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
135
+ http_uri: http_uri,
136
+ http_method: http_method,
137
+ http_resp_code: 'N/A',
138
+ http_resp_length: 'N/A',
139
+ http_resp: 'N/A'
140
+ }
141
+ end
126
142
  rescue URI::InvalidURIError
127
143
  url_encoded_wordlist_arr = []
128
144
  wordlist_line.split('/').each do |path|
@@ -150,10 +166,11 @@ begin
150
166
  wordlist = opts[:wordlist]
151
167
  raise "ERROR: #{wordlist} Does Not Exist." unless File.exist?(wordlist)
152
168
 
169
+ append_pattern = opts[:append_pattern]
153
170
  proxy = opts[:proxy]
154
171
 
155
172
  max_threads = opts[:max_threads]
156
- max_threads ||= 100
173
+ max_threads ||= 25
157
174
 
158
175
  http_request_headers = opts[:http_request_headers]
159
176
  http_response_codes = opts[:http_response_codes]
@@ -191,7 +208,7 @@ begin
191
208
  target_url: target_url,
192
209
  proxy: proxy,
193
210
  http_request_headers: http_request_headers,
194
- wordlist_line: wordlist_line,
211
+ wordlist_line: "#{wordlist_line}#{append_pattern}",
195
212
  http_method: http_method
196
213
  )
197
214
 
@@ -216,7 +233,7 @@ begin
216
233
 
217
234
  # Start Simple HTTP Server (If Requested)
218
235
  if start_reporting_server
219
- listen_port = Random.rand(1_025..65_535).to_s
236
+ listen_port = PWN::Plugins::Sock.get_random_unused_port
220
237
 
221
238
  if pwn_provider == 'docker'
222
239
  listen_ip = '0.0.0.0'
@@ -224,7 +241,7 @@ begin
224
241
  listen_ip = '127.0.0.1'
225
242
  end
226
243
 
227
- puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/pwn_www_uri_buster.html"
244
+ puts "For Scan Results Navigate to: http://127.0.0.1:#{listen_port}/#{report_name}.html"
228
245
  Dir.chdir(dir_path)
229
246
  system(
230
247
  'pwn_simple_http_server',
@@ -623,6 +623,7 @@ module PWN
623
623
  sox_bin = opts[:sox_bin] if File.exist?(opts[:sox_bin].to_s)
624
624
  sox_bin ||= '/usr/bin/sox'
625
625
  speech_to_text = opts[:speech_to_text]
626
+ report_name = opts[:report_name]
626
627
 
627
628
  target_range = parse_target_file(
628
629
  target_file: target_file,
@@ -630,6 +631,9 @@ module PWN
630
631
  )
631
632
 
632
633
  results_hash = {
634
+ report_name: HTMLEntities.new.encode(
635
+ report_name.to_s.scrub.strip.chomp
636
+ ),
633
637
  session_started: Time.now.strftime('%Y-%m-%d_%H.%M.%S'),
634
638
  data: []
635
639
  }
@@ -10,13 +10,15 @@ module PWN
10
10
  # PWN::Plugins::DetectOS.type
11
11
 
12
12
  public_class_method def self.type
13
- :cygwin if OS.cygwin?
14
- :freebsd if OS.freebsd?
15
- :linux if OS.linux?
16
- :netbsd if OS.host_os.include?('netbsd')
17
- :openbsd if OS.host_os.include?('openbsd')
18
- :osx if OS.osx?
19
- :windows if OS.windows?
13
+ os = :cygwin if OS.cygwin?
14
+ os = :freebsd if OS.freebsd?
15
+ os = :linux if OS.linux?
16
+ os = :netbsd if OS.host_os.include?('netbsd')
17
+ os = :openbsd if OS.host_os.include?('openbsd')
18
+ os = :osx if OS.osx?
19
+ os = :windows if OS.windows?
20
+
21
+ os
20
22
  rescue StandardError => e
21
23
  raise e
22
24
  end
@@ -21,10 +21,11 @@ module PWN
21
21
  raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil?
22
22
 
23
23
  results_hash = opts[:results_hash]
24
+ report_name = results_hash[:report_name]
24
25
  opts[:char_encoding].nil? ? char_encoding = 'UTF-8' : char_encoding = opts[:char_encoding].to_s
25
26
 
26
27
  # JSON object Completion
27
- File.open("#{dir_path}/pwn_fuzz_net_app_proto.json", "w:#{char_encoding}") do |f|
28
+ File.open("#{dir_path}/#{report_name}.json", "w:#{char_encoding}") do |f|
28
29
  f.print(
29
30
  JSON.pretty_generate(results_hash).force_encoding(char_encoding)
30
31
  )
@@ -239,7 +240,7 @@ module PWN
239
240
  </html>
240
241
  }
241
242
 
242
- File.open("#{dir_path}/pwn_fuzz_net_app_proto.html", 'w') do |f|
243
+ File.open("#{dir_path}/#{report_name}.html", 'w') do |f|
243
244
  f.print(html_report)
244
245
  end
245
246
  rescue StandardError => e
@@ -17,9 +17,10 @@ module PWN
17
17
  raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil?
18
18
 
19
19
  results_hash = opts[:results_hash]
20
+ report_name = results_hash[:report_name]
20
21
 
21
22
  File.write(
22
- "#{dir_path}/pwn_phone.json",
23
+ "#{dir_path}/#{report_name}.json",
23
24
  JSON.pretty_generate(results_hash)
24
25
  )
25
26
 
@@ -280,7 +281,7 @@ module PWN
280
281
  </html>
281
282
  }
282
283
 
283
- File.open("#{dir_path}/pwn_phone.html", 'w') do |f|
284
+ File.open("#{dir_path}/#{report_name}.html", 'w') do |f|
284
285
  f.print(html_report)
285
286
  end
286
287
  rescue StandardError => e
@@ -20,13 +20,14 @@ module PWN
20
20
  raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil?
21
21
 
22
22
  results_hash = opts[:results_hash]
23
+ report_name = results_hash[:report_name]
23
24
 
24
25
  # JSON object Completion
25
26
  # File.open("#{dir_path}/pwn_scan_git_source.json", 'w') do |f|
26
27
  # f.print(results_hash.to_json)
27
28
  # end
28
29
  File.write(
29
- "#{dir_path}/pwn_scan_git_source.json",
30
+ "#{dir_path}/#{report_name}.json",
30
31
  JSON.pretty_generate(results_hash)
31
32
  )
32
33
 
@@ -279,7 +280,7 @@ module PWN
279
280
  </html>
280
281
  }
281
282
 
282
- File.open("#{dir_path}/pwn_scan_git_source.html", 'w') do |f|
283
+ File.open("#{dir_path}/#{report_name}.html", 'w') do |f|
283
284
  f.print(html_report)
284
285
  end
285
286
  rescue StandardError => e
@@ -17,9 +17,10 @@ module PWN
17
17
  raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil?
18
18
 
19
19
  results_hash = opts[:results_hash]
20
+ report_name = results_name[:report_name]
20
21
 
21
22
  File.write(
22
- "#{dir_path}/pwn_www_uri_buster.json",
23
+ "#{dir_path}/#{report_name}.json",
23
24
  JSON.pretty_generate(results_hash)
24
25
  )
25
26
 
@@ -216,7 +217,7 @@ module PWN
216
217
  </html>
217
218
  }
218
219
 
219
- File.open("#{dir_path}/pwn_www_uri_buster.html", 'w') do |f|
220
+ File.open("#{dir_path}/#{report_name}.html", 'w') do |f|
220
221
  f.print(html_report)
221
222
  end
222
223
  rescue StandardError => 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.4.810'
4
+ VERSION = '0.4.813'
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.810
4
+ version: 0.4.813
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -430,20 +430,6 @@ dependencies:
430
430
  - - '='
431
431
  - !ruby/object:Gem::Version
432
432
  version: 1.1.2
433
- - !ruby/object:Gem::Dependency
434
- name: neovim
435
- requirement: !ruby/object:Gem::Requirement
436
- requirements:
437
- - - '='
438
- - !ruby/object:Gem::Version
439
- version: 0.9.0
440
- type: :runtime
441
- prerelease: false
442
- version_requirements: !ruby/object:Gem::Requirement
443
- requirements:
444
- - - '='
445
- - !ruby/object:Gem::Version
446
- version: 0.9.0
447
433
  - !ruby/object:Gem::Dependency
448
434
  name: netaddr
449
435
  requirement: !ruby/object:Gem::Requirement