pwn 0.4.675 → 0.4.676
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 +4 -4
- data/README.md +2 -2
- data/bin/pwn_nmap_discover_tcp_udp +47 -16
- 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: fa9249af262af0f9d2dbaea4245691d09da20bc452967e60095ff4c28a404eba
|
4
|
+
data.tar.gz: 02b24daf26e3107a37e25392e27fd4176a0a7c8af63f41d3f8c38bf2d3207abc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c648625f56139d973443eee4ba91478e6b9a6e67db1d38c65a86de2b8cba6b245046616a426d9c8ed865b1a20250744b4d5eaf158022b218e58d3ab9051edfbb
|
7
|
+
data.tar.gz: 3955ada6705bfefdc4ec255e60de2b9579dba5407e8ebb36cad2a20ed96ba89cb5285ab540ed0974bab11d381cf7cb2a35da63e81bf39212f388cd4e579bc9c0
|
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.676]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.676]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
@@ -35,6 +35,7 @@ end
|
|
35
35
|
|
36
36
|
ftimestr = '%Y-%m-%d %H:%M:%S.%N%z'
|
37
37
|
started_at = Time.now.strftime(ftimestr)
|
38
|
+
started_at_parse = Time.parse(started_at)
|
38
39
|
banner = '-' * 64
|
39
40
|
puts "\n\n\n#{banner}"
|
40
41
|
puts "- STARTED: #{started_at} "
|
@@ -153,18 +154,21 @@ begin
|
|
153
154
|
puts "\n\n\n#{banner}"
|
154
155
|
puts '- PHASE 1: Target Discovery'
|
155
156
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
157
|
+
if with_tor
|
158
|
+
nmap.syn_discovery = discovery_tcp_ports.values
|
159
|
+
nmap.ack_discovery = discovery_tcp_ports.values
|
160
|
+
else
|
161
|
+
nmap.ping = true
|
162
|
+
nmap.arp_ping = true
|
163
|
+
nmap.icmp_echo_discovery = true
|
164
|
+
nmap.icmp_timestamp_discovery = true
|
165
|
+
nmap.udp_discovery = discovery_udp_ports.values
|
166
|
+
nmap.sctp_init_ping = discovery_sctp_ports.values
|
167
|
+
end
|
156
168
|
nmap.verbose = true
|
157
169
|
nmap.exclude_file = exclude_file
|
158
170
|
nmap.interface = interface
|
159
171
|
nmap.insane_timing = true
|
160
|
-
nmap.ping = true
|
161
|
-
nmap.arp_ping = true
|
162
|
-
nmap.icmp_echo_discovery = true
|
163
|
-
nmap.icmp_timestamp_discovery = true
|
164
|
-
nmap.syn_discovery = discovery_tcp_ports.values
|
165
|
-
nmap.ack_discovery = discovery_tcp_ports.values
|
166
|
-
nmap.udp_discovery = discovery_udp_ports.values
|
167
|
-
nmap.sctp_init_ping = discovery_sctp_ports.values
|
168
172
|
nmap.output_xml = latest_discovery_results
|
169
173
|
nmap.targets = target_range
|
170
174
|
nmap.randomize_hosts = true
|
@@ -181,7 +185,8 @@ begin
|
|
181
185
|
xml_file: latest_discovery_results
|
182
186
|
) do |xml|
|
183
187
|
xml.each_host do |host|
|
184
|
-
next
|
188
|
+
next if File.read(exclude_file).include?(host.ip) ||
|
189
|
+
host.status.state != :up
|
185
190
|
|
186
191
|
hosts_arr = host.hostnames.map { |h| h[:name] }
|
187
192
|
f.print host.ip
|
@@ -194,6 +199,18 @@ begin
|
|
194
199
|
sorted_targets = File.readlines(target_file).sort.join
|
195
200
|
File.write(target_file, sorted_targets)
|
196
201
|
|
202
|
+
phase1_ended_at = Time.now.strftime(ftimestr)
|
203
|
+
phase1_ended_at_parse = Time.parse(phase1_ended_at)
|
204
|
+
elapsed_in_seconds = (phase1_ended_at_parse - started_at_parse).to_f
|
205
|
+
fmt_elapsed_in_seconds = format('%0.2f', elapsed_in_seconds)
|
206
|
+
puts "\n\n\n#{banner}"
|
207
|
+
puts "- DISCOVERY COMPLETE! DURATION: #{fmt_elapsed_in_seconds} seconds"
|
208
|
+
|
209
|
+
puts "\n\n\n#{banner}"
|
210
|
+
puts '- PHASE 2: TCP Port Scanning'
|
211
|
+
phase2_started_at = Time.now.strftime(ftimestr)
|
212
|
+
phase2_started_at_parse = Time.parse(phase2_started_at)
|
213
|
+
|
197
214
|
# Switch Tor Exit Node if with_tor
|
198
215
|
if with_tor
|
199
216
|
puts "\n\n\n#{banner}"
|
@@ -204,8 +221,6 @@ begin
|
|
204
221
|
# TCP Scan
|
205
222
|
# Using -T5 template to reduce number of
|
206
223
|
# retransmission attempts on filtered ports.
|
207
|
-
puts "\n\n\n#{banner}"
|
208
|
-
puts '- PHASE 2: TCP Port Scanning'
|
209
224
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
210
225
|
nmap.verbose = true
|
211
226
|
nmap.target_file = target_file
|
@@ -228,6 +243,17 @@ begin
|
|
228
243
|
nmap.proxies = proxy if with_tor
|
229
244
|
end
|
230
245
|
FileUtils.cp("#{latest_tcp_results}.nmap", "#{latest_tcp_results}.txt")
|
246
|
+
phase2_ended_at = Time.now.strftime(ftimestr)
|
247
|
+
phase2_ended_at_parse = Time.parse(phase2_ended_at)
|
248
|
+
elapsed_in_seconds = (phase2_ended_at_parse - phase2_started_at).to_f
|
249
|
+
fmt_elapsed_in_seconds = format('%0.2f', elapsed_in_seconds)
|
250
|
+
puts "\n\n\n#{banner}"
|
251
|
+
puts "- TCP SCAN COMPLETE! DURATION: #{fmt_elapsed_in_seconds} seconds"
|
252
|
+
|
253
|
+
puts "\n\n\n#{banner}"
|
254
|
+
puts '- PHASE 3: UDP Port Scanning'
|
255
|
+
phase3_started_at = Time.now.strftime(ftimestr)
|
256
|
+
phase3_started_at_parse = Time.parse(phase3_started_at)
|
231
257
|
|
232
258
|
# Switch Tor Exit Node if with_tor
|
233
259
|
if with_tor
|
@@ -239,9 +265,11 @@ begin
|
|
239
265
|
# UDP Scan
|
240
266
|
# Using -T5 template to reduce number of
|
241
267
|
# retransmission attempts on filtered ports.
|
242
|
-
puts "\n\n\n#{banner}"
|
243
|
-
puts '- PHASE 3: UDP Port Scanning'
|
244
268
|
PWN::Plugins::NmapIt.port_scan do |nmap|
|
269
|
+
unless with_tor
|
270
|
+
nmap.default_script = true
|
271
|
+
nmap.update_scriptdb = true
|
272
|
+
end
|
245
273
|
nmap.verbose = true
|
246
274
|
nmap.target_file = target_file
|
247
275
|
nmap.fast = true
|
@@ -254,8 +282,6 @@ begin
|
|
254
282
|
nmap.insane_timing = true
|
255
283
|
nmap.skip_discovery = true
|
256
284
|
nmap.udp_scan = true
|
257
|
-
nmap.default_script = true unless with_tor
|
258
|
-
nmap.update_scriptdb = true unless with_tor
|
259
285
|
nmap.output_all = latest_udp_results
|
260
286
|
nmap.min_parallelism = 36
|
261
287
|
nmap.max_retries = 0
|
@@ -264,6 +290,12 @@ begin
|
|
264
290
|
nmap.proxies = proxy if with_tor
|
265
291
|
end
|
266
292
|
FileUtils.cp("#{latest_udp_results}.nmap", "#{latest_udp_results}.txt")
|
293
|
+
phase3_ended_at = Time.now.strftime(ftimestr)
|
294
|
+
phase3_ended_at_parse = Time.parse(phase3_ended_at)
|
295
|
+
elapsed_in_seconds = (phase3_ended_at_parse - phase3_started_at).to_f
|
296
|
+
fmt_elapsed_in_seconds = format('%0.2f', elapsed_in_seconds)
|
297
|
+
puts "\n\n\n#{banner}"
|
298
|
+
puts "- UDP SCAN COMPLETE! DURATION: #{fmt_elapsed_in_seconds} seconds"
|
267
299
|
rescue SystemExit, Interrupt
|
268
300
|
puts "\nGoodbye."
|
269
301
|
rescue StandardError => e
|
@@ -274,7 +306,6 @@ ensure
|
|
274
306
|
puts "\n\n\n#{banner}"
|
275
307
|
puts "- ENDED: #{ended_at}"
|
276
308
|
|
277
|
-
started_at_parse = Time.parse(started_at)
|
278
309
|
ended_at_parse = Time.parse(ended_at)
|
279
310
|
elapsed_in_seconds = (ended_at_parse - started_at_parse).to_f
|
280
311
|
fmt_elapsed_in_seconds = format('%0.2f', elapsed_in_seconds)
|
data/lib/pwn/version.rb
CHANGED