pwn 0.4.666 → 0.4.667

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: 668626b1a3332cf0b09f04a683d7b79462724328afd3535a3d47652b120aca93
4
- data.tar.gz: 921a004b8a3bcf11031589da46b45b3e347f3cd6a7fe33854adaf3f61f2cf9ef
3
+ metadata.gz: 5a4f0feaba882e917c331a010d42bba31372d7d8ab264f2ba73be4722f865e10
4
+ data.tar.gz: 19060d5bb2a8be71b62ac7ccdbf06e4d5685971547d80060b56315f7e4c3d7d1
5
5
  SHA512:
6
- metadata.gz: 9e1b117de7f4eceaf24145de0f8923394fb225356a7b79bd6024548476ba3770aa829c9cb65830a5eda93f280b79acbb6ecaf75178262ec9b6c2790ea34f37c0
7
- data.tar.gz: 03de28428d438c9394ca0254ca7f5093e5c8e6b23d4f217edb8fdc88edaa33dc0e7be5d643c2282e6d13f2a95e834e1809cb10d6530ae68658ed0b0cf285b692
6
+ metadata.gz: 3e4d2c00b17b32b2042d7e76b7c9e9d92ba7d3de8edaeeb46a1975b26687f0a9404e0dd8d420a17cf26d278271f1fcd6f565e7ad279262e7925b2e88e51863d4
7
+ data.tar.gz: 37492df2e12eb18cd4145373b9f34bc3a83624caa54187134f45db16c120dc4dc467255baa36fa72db851f4013f35aef5b501fa5fddf84a9e8705b52e4749a22
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.666]:001 >>> PWN.help
40
+ pwn[v0.4.667]: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.666]:001 >>> PWN.help
55
+ pwn[v0.4.667]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -43,15 +43,33 @@ if opts.empty?
43
43
  end
44
44
 
45
45
  def csv_diff(opts = {})
46
- larger_csv = opts[:larger_csv]
47
- smaller_csv = opts[:smaller_csv]
46
+ c1_path = opts[:c1_path]
47
+ c2_path = opts[:c2_path]
48
48
  diff_path = opts[:diff_path]
49
49
  include_csv_headers = opts[:include_csv_headers]
50
- column_names_to_exclude = opts[:column_names_to_exclude]
50
+ column_names_to_exclude = opts[:column_names_to_exclude].to_s.split(',')
51
51
 
52
- # TODO: Exclude the column values for diff consideration
53
- # while including the columns in the diff...figure out what
54
- # to do with the columns' values.
52
+ csv1 = CSV.read(c1_path)
53
+ csv2 = CSV.read(c2_path)
54
+
55
+ if csv1.length >= csv2.length
56
+ larger_csv = csv1
57
+ larger_csv_orig = CSV.read(c1_path)
58
+
59
+ smaller_csv = csv2
60
+ smaller_csv_orig = CSV.read(c2_path)
61
+ end
62
+
63
+ if csv2.length >= csv1.length
64
+ larger_csv = csv2
65
+ larger_csv_orig = CSV.read(c2_path)
66
+
67
+ smaller_csv = csv1
68
+ smaller_csv_orig = CSV.read(c1_path)
69
+ end
70
+
71
+ # Exclude the column values for diff to ensure the same rows
72
+ # with for example different timestamps aren't included.
55
73
  columns_index_arr = []
56
74
  column_names_to_exclude&.each do |column_name|
57
75
  column_index = smaller_csv.first.find_index(column_name)
@@ -72,44 +90,39 @@ def csv_diff(opts = {})
72
90
  end
73
91
  end
74
92
 
75
- csv_headers = larger_csv.first.join(',')
93
+ # Write diff with redacted columns (to find differences we care about)
76
94
  File.open(diff_path, 'w') do |f|
77
- f.puts csv_headers if include_csv_headers
78
95
  larger_csv.each do |line_arr|
79
96
  line = line_arr.join(',')
80
97
  f.puts line unless smaller_csv.include?(line_arr)
81
98
  end
82
99
  end
100
+ diff_csv = CSV.read(diff_path)
101
+
102
+ # Write diff again with all columns.
103
+ csv_headers_orig = larger_csv_orig.first.join(',')
104
+ File.open(diff_path, 'w') do |f|
105
+ f.puts csv_headers_orig if include_csv_headers
106
+ larger_csv_orig.each do |line_arr|
107
+ line = line_arr.join(',')
108
+ f.puts line if diff_csv.include?(line_arr)
109
+ end
110
+ end
83
111
  end
84
112
 
85
113
  c1_path = opts[:c1_path]
86
- csv1 = CSV.read(c1_path)
87
-
88
114
  c2_path = opts[:c2_path]
89
- csv2 = CSV.read(c2_path)
90
-
91
115
  diff_path = opts[:diff_path]
92
-
93
- column_names_to_exclude = opts[:column_names_to_exclude].to_s.split(',')
116
+ column_names_to_exclude = opts[:column_names_to_exclude]
94
117
 
95
118
  include_csv_headers = false if opts[:no_headers]
96
119
  include_csv_headers ||= true
97
120
 
98
121
  # Compare which two is larger
99
- if csv1.length >= csv2.length
100
- csv_diff(
101
- larger_csv: csv1,
102
- smaller_csv: csv2,
103
- diff_path: diff_path,
104
- include_csv_headers: include_csv_headers,
105
- column_names_to_exclude: column_names_to_exclude
106
- )
107
- else
108
- csv_diff(
109
- larger_csv: csv2,
110
- smaller_csv: csv1,
111
- diff_path: diff_path,
112
- include_csv_headers: include_csv_headers,
113
- column_names_to_exclude: column_names_to_exclude
114
- )
115
- end
122
+ csv_diff(
123
+ c1_path: c1_path,
124
+ c2_path: c2_path,
125
+ diff_path: diff_path,
126
+ include_csv_headers: include_csv_headers,
127
+ column_names_to_exclude: column_names_to_exclude
128
+ )
@@ -77,12 +77,10 @@ begin
77
77
  )
78
78
 
79
79
  scan_status = scan_status_resp[:status]
80
- # break if scan_status != 'initializing' && scan_status != 'pending' && scan_status != 'running' && scan_status != 'publishing'
80
+
81
81
  break if scan_status == 'completed'
82
82
  end
83
83
 
84
- # raise "Scan status reached an unexpected condition: #{scan_status}. Re-verify the scan config for, '#{scan_name}' and try again." unless scan_status == 'completed'
85
-
86
84
  puts 'scan complete.'
87
85
 
88
86
  print "Exporting results to #{path_to_export}..."
@@ -80,9 +80,10 @@ module PWN
80
80
 
81
81
  response
82
82
  rescue RestClient::ExceptionWithResponse => e
83
- puts "#{base_nessus_cloud_api_uri}/#{rest_call}"
84
- puts params
85
- puts http_body
83
+ puts "URI: #{base_nessus_cloud_api_uri}/#{rest_call}"
84
+ puts "Params: #{params.inspect}"
85
+ puts "HTTP POST Body: #{http_body}"
86
+
86
87
  raise e
87
88
  rescue StandardError, SystemExit, Interrupt => e
88
89
  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.4.666'
4
+ VERSION = '0.4.667'
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.666
4
+ version: 0.4.667
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.