pwn 0.4.665 → 0.4.667
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/pwn_diff_csv_files_w_column_exclude +44 -31
- data/bin/pwn_nessus_cloud_vulnscan +1 -3
- data/lib/pwn/plugins/nessus_cloud.rb +6 -0
- 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: 5a4f0feaba882e917c331a010d42bba31372d7d8ab264f2ba73be4722f865e10
|
4
|
+
data.tar.gz: 19060d5bb2a8be71b62ac7ccdbf06e4d5685971547d80060b56315f7e4c3d7d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
-
|
47
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
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
|
-
|
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}..."
|
@@ -79,6 +79,12 @@ module PWN
|
|
79
79
|
sleep 3
|
80
80
|
|
81
81
|
response
|
82
|
+
rescue RestClient::ExceptionWithResponse => e
|
83
|
+
puts "URI: #{base_nessus_cloud_api_uri}/#{rest_call}"
|
84
|
+
puts "Params: #{params.inspect}"
|
85
|
+
puts "HTTP POST Body: #{http_body}"
|
86
|
+
|
87
|
+
raise e
|
82
88
|
rescue StandardError, SystemExit, Interrupt => e
|
83
89
|
raise e
|
84
90
|
end
|
data/lib/pwn/version.rb
CHANGED