pwn 0.4.679 → 0.4.680

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: 98918a56d63ac8ef47261e94f0b9d00e42b90e0c60ccaaeecfa0f1c28591af50
4
- data.tar.gz: 55e972d187270c847d7729278ee155a99afbe3d348b72202125becbaeaa584af
3
+ metadata.gz: 6e73bd67263ace8f9f5aa216fe0c0196bbfa25be71769a6ca481e05019c5c0ff
4
+ data.tar.gz: 3f613847407a0f17ea04cc9ef1e96160cc43377bf31e08345f36a92681615cc6
5
5
  SHA512:
6
- metadata.gz: c8ad1f6d63ad8d3162c74b31ee24e0be22360dc739039a236f6dfd00bf53cdb8a8e91f630d42d27f5300537c06a06ffaca59f943eb6827caa68cb822722b1004
7
- data.tar.gz: 987790249425f4580f251a11ae284c78b2b0f88278e0fd4be7ac22c91700a8fb70cf4f1da854bd4d7eab56542ac6810578b9e3ddeadd59fce5456f30982ab918
6
+ metadata.gz: e3605d4a97ba12d392a9a6b359bbcffd598d83d193ae4f66788b59915017b057c2bbf119ae526318e189cda9a51599e8962e9ee64e15dc0aef429df038896ee4
7
+ data.tar.gz: c3666977f6a9286b156e0360012c7674e2c1fb68eb988b26305c34d9ba0cef25d2545986f01627da368585028fa4610f3a597a3b9d7511a346227319e1895d0b
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.679]:001 >>> PWN.help
40
+ pwn[v0.4.680]: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.679]:001 >>> PWN.help
55
+ pwn[v0.4.680]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -151,7 +151,7 @@ begin
151
151
  # Target Discovery Scan
152
152
  # Using -T5 template to reduce number of
153
153
  # retransmission attempts on filtered ports.
154
- puts "\n\n\n#{banner}"
154
+ puts banner
155
155
  puts '- PHASE 1: Target Discovery'
156
156
  PWN::Plugins::NmapIt.port_scan do |nmap|
157
157
  if with_tor
@@ -188,16 +188,32 @@ begin
188
188
  next if File.read(exclude_file).include?(host.ip) ||
189
189
  host.status.state != :up
190
190
 
191
- hosts_arr = host.hostnames.map { |h| h[:name] }
192
- f.print host.ip
193
- f.puts " # { \"hostnames\": #{hosts_arr}}, \"mac\": \"#{host.mac}\" }"
191
+ f.puts host.ip
194
192
  end
195
193
  end
196
194
  end
197
195
 
198
- # Produce a good targets.txt redacting duplicates
199
- sorted_targets = File.readlines(target_file).sort.join
200
- File.write(target_file, sorted_targets)
196
+ # Produce a good targets.txt redacting duplicates && sorting by IP
197
+ sorted_ips = File.readlines(target_file).uniq.map do |ip|
198
+ IPAddr.new(ip.chomp)
199
+ end
200
+ sorted_ips = sorted_ips.sort_by(&:hton)
201
+
202
+ # Now Add additional info about the IP as a comment
203
+ File.open(target_file, 'w') do |f|
204
+ sorted_ips.each do |ip|
205
+ PWN::Plugins::NmapIt.parse_xml_results(
206
+ xml_file: latest_discovery_results
207
+ ) do |xml|
208
+ xml.each_host do |host|
209
+ next unless host.ip.to_s == ip.to_s
210
+
211
+ hosts_arr = host.hostnames.map { |h| h[:name] }
212
+ f.puts "#{ip} # { \"hostnames\": #{hosts_arr}}, \"mac\": \"#{host.mac}\" }"
213
+ end
214
+ end
215
+ end
216
+ end
201
217
 
202
218
  phase1_ended_at = Time.now.strftime(ftimestr)
203
219
  phase1_ended_at_parse = Time.parse(phase1_ended_at)
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.679'
4
+ VERSION = '0.4.680'
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.679
4
+ version: 0.4.680
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.