pwn 0.4.680 → 0.4.682

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e73bd67263ace8f9f5aa216fe0c0196bbfa25be71769a6ca481e05019c5c0ff
4
- data.tar.gz: 3f613847407a0f17ea04cc9ef1e96160cc43377bf31e08345f36a92681615cc6
3
+ metadata.gz: ff2630dcb10e95139743093026f1f2210bb4735a241abacf2d87682bb5ed0f4b
4
+ data.tar.gz: 11df6a65e5956837bac3a84a6ad6f35af63626c1e8f0cd10f076cb0eeb9166e2
5
5
  SHA512:
6
- metadata.gz: e3605d4a97ba12d392a9a6b359bbcffd598d83d193ae4f66788b59915017b057c2bbf119ae526318e189cda9a51599e8962e9ee64e15dc0aef429df038896ee4
7
- data.tar.gz: c3666977f6a9286b156e0360012c7674e2c1fb68eb988b26305c34d9ba0cef25d2545986f01627da368585028fa4610f3a597a3b9d7511a346227319e1895d0b
6
+ metadata.gz: 2b71de5e43b85215cfc389d46f3aaff7ebbbf7d5c10a4e3a5cf064d5f3c6bfba1d541e99ac0739961ea83ac104852e150ac3de116d12f26e16e93d8f5edab030
7
+ data.tar.gz: 7fad3ff770bbd8337a548890a713d6c7176783950f43f6abb8d57b25be111a0ed86b5db062cb7bee45c121f04d1d067f37a2a630bfcf5cd688c737de3ddb8f78
data/Gemfile CHANGED
@@ -66,7 +66,7 @@ gem 'rspec', '3.12.0'
66
66
  gem 'rtesseract', '3.1.2'
67
67
  gem 'rubocop', '1.50.2'
68
68
  gem 'rubocop-rake', '0.6.0'
69
- gem 'rubocop-rspec', '2.21.0'
69
+ gem 'rubocop-rspec', '2.22.0'
70
70
  gem 'ruby-audio', '1.6.1'
71
71
  gem 'ruby-nmap', '1.0.1'
72
72
  gem 'ruby-saml', '1.15.0'
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.680]:001 >>> PWN.help
40
+ pwn[v0.4.682]: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.680]:001 >>> PWN.help
55
+ pwn[v0.4.682]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -42,6 +42,17 @@ if opts.empty?
42
42
  exit 1
43
43
  end
44
44
 
45
+ def ommit_columns_by_indices(opts = {})
46
+ csv = opts[:csv]
47
+ columns_index_arr = opts[:columns_index_arr]
48
+
49
+ csv.each do |line_arr|
50
+ line_arr.delete_if.with_index do |_, index|
51
+ columns_index_arr.include?(index)
52
+ end
53
+ end
54
+ end
55
+
45
56
  def csv_diff(opts = {})
46
57
  c1_path = opts[:c1_path]
47
58
  c2_path = opts[:c2_path]
@@ -77,24 +88,22 @@ def csv_diff(opts = {})
77
88
  end
78
89
 
79
90
  if columns_index_arr.any?
80
- larger_csv.each do |line_arr|
81
- line_arr.delete_if.with_index do |_, index|
82
- columns_index_arr.include?(index)
83
- end
84
- end
85
-
86
- smaller_csv.each do |line_arr|
87
- line_arr.delete_if.with_index do |_, index|
88
- columns_index_arr.include?(index)
89
- end
90
- end
91
+ larger_csv = ommit_columns_by_indices(
92
+ csv: larger_csv,
93
+ columns_index_arr: columns_index_arr
94
+ )
95
+
96
+ smaller_csv = ommit_columns_by_indices(
97
+ csv: smaller_csv,
98
+ columns_index_arr: columns_index_arr
99
+ )
91
100
  end
92
101
 
93
102
  # Write diff with redacted columns (to find differences we care about)
94
103
  File.open(diff_path, 'w') do |f|
95
104
  larger_csv.each do |line_arr|
96
105
  line = line_arr.join(',')
97
- f.puts line unless smaller_csv.include?(line_arr)
106
+ f.puts line unless smaller_csv.select { |sc| sc.join(',') == line }
98
107
  end
99
108
  end
100
109
  diff_csv = CSV.read(diff_path)
@@ -105,13 +114,13 @@ def csv_diff(opts = {})
105
114
  if no_headers
106
115
  larger_csv_orig.each do |line_arr|
107
116
  line = line_arr.join(',')
108
- f.puts line if diff_csv.include?(line_arr)
117
+ f.puts line if diff_csv.select { |dc| dc.join(',') == line }
109
118
  end
110
119
  else
111
120
  f.puts csv_headers_orig
112
121
  larger_csv_orig[1..-1].each do |line_arr|
113
122
  line = line_arr.join(',')
114
- f.puts line if diff_csv.include?(line_arr)
123
+ f.puts line if diff_csv.select { |dc| dc.join(',') == line }
115
124
  end
116
125
  end
117
126
  end
@@ -15,7 +15,7 @@ OptionParser.new do |options|
15
15
  opts[:target_range] = t
16
16
  end
17
17
 
18
- options.on('-eFILE', '--target-exclude-file=FILE', '<Optional - nmap excludes file>') do |e|
18
+ options.on('-eFILE', '--target-exclude-file=FILE', '<Optional - IP excludes file>') do |e|
19
19
  opts[:exclude_file] = e
20
20
  end
21
21
 
@@ -23,6 +23,10 @@ OptionParser.new do |options|
23
23
  opts[:interface] = i
24
24
  end
25
25
 
26
+ options.on('-rDIR', '--results-root=DIR', '<Optional - nmap results root (Default: /tmp)>') do |r|
27
+ opts[:results_root] = r
28
+ end
29
+
26
30
  options.on('-T', '--tor', '<Optional - Source Scans from Tor Nodes>') do |t|
27
31
  opts[:with_tor] = t
28
32
  end
@@ -41,22 +45,28 @@ puts "\n\n\n#{banner}"
41
45
  puts "- STARTED: #{started_at} "
42
46
 
43
47
  target_range = opts[:target_range]
48
+
49
+ results_root = opts[:results_root]
50
+ results_root ||= '/tmp'
51
+ FileUtils.mkdir_p results_root
52
+ puts "Results Saved in: #{results_root}"
53
+
44
54
  exclude_file = opts[:exclude_file]
45
- exclude_file ||= '/tmp/nmap_targets_exclude.txt'
55
+ exclude_file ||= "#{results_root}/nmap_targets_exclude.txt"
56
+ # We create an exclude file (even if its empty)
57
+ File.new(exclude_file, 'w') unless File.exist?(exclude_file)
58
+
46
59
  interface = opts[:interface]
47
60
  interface ||= 'eth0'
61
+
48
62
  with_tor = true if opts[:with_tor]
49
63
  with_tor ||= false
64
+
50
65
  if with_tor
51
66
  tor_obj = PWN::Plugins::Tor.start
52
67
  proxy = ["socks4://#{tor_obj[:ip]}:#{tor_obj[:port]}"]
53
68
  end
54
69
 
55
- File.new(exclude_file, 'w') unless File.exist?(exclude_file)
56
- nmap_results_root = File.dirname(exclude_file)
57
- FileUtils.mkdir_p nmap_results_root
58
- puts "nmap Results Saved in: #{nmap_results_root}"
59
-
60
70
  discovery_tcp_ports = {
61
71
  ftp: 21,
62
72
  ssh: 22,
@@ -126,10 +136,10 @@ discovery_sctp_ports = {
126
136
  sicc: 38_412
127
137
  }
128
138
 
129
- target_file = "#{nmap_results_root}/nmap_targets.txt"
130
- latest_discovery_results = "#{nmap_results_root}/nmap_discovery_results.xml"
131
- latest_tcp_results = "#{nmap_results_root}/nmap_tcp_results"
132
- latest_udp_results = "#{nmap_results_root}/nmap_udp_results"
139
+ target_file = "#{results_root}/nmap_targets.txt"
140
+ latest_discovery_results = "#{results_root}/nmap_discovery_results.xml"
141
+ latest_tcp_results = "#{results_root}/nmap_tcp_results"
142
+ latest_udp_results = "#{results_root}/nmap_udp_results"
133
143
 
134
144
  begin
135
145
  # Per man nmap:
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.680'
4
+ VERSION = '0.4.682'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.680
4
+ version: 0.4.682
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -786,14 +786,14 @@ dependencies:
786
786
  requirements:
787
787
  - - '='
788
788
  - !ruby/object:Gem::Version
789
- version: 2.21.0
789
+ version: 2.22.0
790
790
  type: :runtime
791
791
  prerelease: false
792
792
  version_requirements: !ruby/object:Gem::Requirement
793
793
  requirements:
794
794
  - - '='
795
795
  - !ruby/object:Gem::Version
796
- version: 2.21.0
796
+ version: 2.22.0
797
797
  - !ruby/object:Gem::Dependency
798
798
  name: ruby-audio
799
799
  requirement: !ruby/object:Gem::Requirement