pwn 0.4.698 → 0.4.700

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: 1876724f8a6e17d3f41247dc8bc4daea0f8fadaf433a99883ed67b016c45205d
4
- data.tar.gz: f5f93dd5ed24f7d8e3d880bcd05d183d3105c10f3515302cf88a8db256e5fdf1
3
+ metadata.gz: f21820a32e67fe03171657ab0c5c382103354ad1465fb2de2a7ecc167ab1f77b
4
+ data.tar.gz: 4ffbee987270f1e6509e4363db92f6ede6c84266c52bdd1032c777f9be3aaa8d
5
5
  SHA512:
6
- metadata.gz: f8703953cf8b45c61a0de488246dd9ee19d213d3c7577e43f756d26283f49842fc45371aeddcc00e734f730f9b89146a8df3363f47e9c9476de1c77f53078383
7
- data.tar.gz: 5403587ece0718fa16fb20a053c37b12a32470cca9c97b0dade132d1ad321a4326253e7826458fbbc9fd50933e7f4fc4def891f8856b38658cf18d0e32297fce
6
+ metadata.gz: ee613e295e8a5d6fcb1e1d49938cac273a2f9fdff4916b26c4cae7e9235bdb6ca4a967c94fd61263f8e3af8f603c05544488efb21916867b5bffb92f5defee9c
7
+ data.tar.gz: 35d4cf79f4199a10171a0561cb5f538ba8a7b0e50dd9500aaafddc6e39850d6f52d5454ccf8d5019a378f4435cdc2cfddad975cc85097e601369907014828886
data/Gemfile CHANGED
@@ -51,6 +51,7 @@ gem 'nexpose', '7.3.0'
51
51
  gem 'nokogiri', '1.15.0'
52
52
  gem 'nokogiri-diff', '0.2.0'
53
53
  gem 'oily_png', '1.2.1'
54
+ gem 'open3', '0.1.2'
54
55
  gem 'os', '1.1.4'
55
56
  gem 'packetfu', '1.1.13'
56
57
  gem 'pdf-reader', '2.11.0'
@@ -80,7 +81,8 @@ gem 'sinatra', '3.0.6'
80
81
  gem 'slack-ruby-client', '2.1.0'
81
82
  gem 'socksify', '1.7.1'
82
83
  gem 'spreadsheet', '1.3.0'
83
- gem 'sqlite3', '1.6.2'
84
+ gem 'sqlite3', '1.6.3'
85
+ gem 'sys-proctable', '1.3.0'
84
86
  gem 'thin', '1.8.2'
85
87
  gem 'tty-prompt', '0.23.1'
86
88
  gem 'tty-spinner', '0.9.3'
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.698]:001 >>> PWN.help
40
+ pwn[v0.4.700]: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.698]:001 >>> PWN.help
55
+ pwn[v0.4.700]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn CHANGED
@@ -4,6 +4,7 @@
4
4
  require 'optparse'
5
5
  require 'pwn'
6
6
  require 'pry'
7
+ require 'sys/proctable'
7
8
  require 'yaml'
8
9
 
9
10
  opts = {}
@@ -292,10 +293,27 @@ begin
292
293
  )
293
294
 
294
295
  # Start PWN REPL
296
+ pwn_pid = Process.pid
295
297
  Pry.start(
296
298
  self,
297
299
  prompt: prompt
298
300
  )
299
301
  rescue StandardError => e
300
302
  raise e
303
+ ensure
304
+ child_pids = Sys::ProcTable.ps(smaps: false).select do |pe|
305
+ pe.ppid == pwn_pid
306
+ end.map(&:pid)
307
+
308
+ grandkid_pids = Sys::ProcTable.ps(smaps: false).select do |pe|
309
+ child_pids.include?(pe.ppid)
310
+ end.map(&:pid)
311
+
312
+ grandkid_pids.each do |grandkid_pid|
313
+ Process.kill('TERM', grandkid_pid)
314
+ end
315
+
316
+ child_pids.each do |child_pid|
317
+ Process.kill('TERM', child_pid)
318
+ end
301
319
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'nmap/command'
4
4
  require 'nmap/xml'
5
+ require 'open3'
5
6
 
6
7
  module PWN
7
8
  module Plugins
@@ -57,6 +58,29 @@ module PWN
57
58
  raise e
58
59
  end
59
60
 
61
+ # Supported Method Parameters::
62
+ # PWN::Plugins::NmapIt.diff_xml_results(
63
+ # xml_a: 'required - path to nmap xml results',
64
+ # xml_b: 'required - path to nmap xml results',
65
+ # diff: 'required - path to nmap xml results diff'
66
+ # )
67
+ public_class_method def self.diff_xml_results(opts = {})
68
+ xml_a = opts[:xml_a].to_s.scrub.strip.chomp
69
+ xml_b = opts[:xml_b].to_s.scrub.strip.chomp
70
+ diff = opts[:diff].to_s.scrub.strip.chomp
71
+
72
+ stdout, _stderr, _status = Open3.capture3(
73
+ 'ndiff',
74
+ '--xml',
75
+ xml_a,
76
+ xml_b
77
+ )
78
+
79
+ File.write(diff, stdout)
80
+ rescue StandardError => e
81
+ raise e
82
+ end
83
+
60
84
  # Author(s):: 0day Inc. <request.pentest@0dayinc.com>
61
85
 
62
86
  public_class_method def self.authors
@@ -98,6 +122,12 @@ module PWN
98
122
  end
99
123
  end
100
124
 
125
+ #{self}.diff_xml_results(
126
+ xml_a: 'required - path to nmap xml results',
127
+ xml_b: 'required - path to nmap xml results',
128
+ diff: 'required - path to nmap xml results diff'
129
+ )
130
+
101
131
  #{self}.authors
102
132
  "
103
133
  end
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.698'
4
+ VERSION = '0.4.700'
5
5
  end
@@ -105,7 +105,7 @@
105
105
  "provisioners/apache2.sh",
106
106
  "provisioners/tor.sh",
107
107
  "provisioners/toggle_tor.sh",
108
- "provisioners/nmap_all_live_hosts.sh",
108
+ "provisioners/nmap.sh",
109
109
  "provisioners/arachni.sh",
110
110
  "provisioners/eyewitness.sh",
111
111
  "provisioners/afl.sh",
@@ -109,7 +109,7 @@
109
109
  "provisioners/apache2.sh",
110
110
  "provisioners/tor.sh",
111
111
  "provisioners/toggle_tor.sh",
112
- "provisioners/nmap_all_live_hosts.sh",
112
+ "provisioners/nmap.sh",
113
113
  "provisioners/arachni.sh",
114
114
  "provisioners/eyewitness.sh",
115
115
  "provisioners/afl.sh",
@@ -136,7 +136,7 @@
136
136
  "provisioners/apache2.sh",
137
137
  "provisioners/tor.sh",
138
138
  "provisioners/toggle_tor.sh",
139
- "provisioners/nmap_all_live_hosts.sh",
139
+ "provisioners/nmap.sh",
140
140
  "provisioners/arachni.sh",
141
141
  "provisioners/eyewitness.sh",
142
142
  "provisioners/afl.sh",
@@ -117,7 +117,7 @@
117
117
  "provisioners/apache2.sh",
118
118
  "provisioners/tor.sh",
119
119
  "provisioners/toggle_tor.sh",
120
- "provisioners/nmap_all_live_hosts.sh",
120
+ "provisioners/nmap.sh",
121
121
  "provisioners/arachni.sh",
122
122
  "provisioners/eyewitness.sh",
123
123
  "provisioners/afl.sh",
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ source /etc/profile.d/globals.sh
3
+
4
+ $screen_cmd "${apt} install -y nmap ncat ndiff ${assess_update_errors}"
5
+ grok_error
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.698
4
+ version: 0.4.700
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -570,6 +570,20 @@ dependencies:
570
570
  - - '='
571
571
  - !ruby/object:Gem::Version
572
572
  version: 1.2.1
573
+ - !ruby/object:Gem::Dependency
574
+ name: open3
575
+ requirement: !ruby/object:Gem::Requirement
576
+ requirements:
577
+ - - '='
578
+ - !ruby/object:Gem::Version
579
+ version: 0.1.2
580
+ type: :runtime
581
+ prerelease: false
582
+ version_requirements: !ruby/object:Gem::Requirement
583
+ requirements:
584
+ - - '='
585
+ - !ruby/object:Gem::Version
586
+ version: 0.1.2
573
587
  - !ruby/object:Gem::Dependency
574
588
  name: os
575
589
  requirement: !ruby/object:Gem::Requirement
@@ -982,14 +996,28 @@ dependencies:
982
996
  requirements:
983
997
  - - '='
984
998
  - !ruby/object:Gem::Version
985
- version: 1.6.2
999
+ version: 1.6.3
986
1000
  type: :runtime
987
1001
  prerelease: false
988
1002
  version_requirements: !ruby/object:Gem::Requirement
989
1003
  requirements:
990
1004
  - - '='
991
1005
  - !ruby/object:Gem::Version
992
- version: 1.6.2
1006
+ version: 1.6.3
1007
+ - !ruby/object:Gem::Dependency
1008
+ name: sys-proctable
1009
+ requirement: !ruby/object:Gem::Requirement
1010
+ requirements:
1011
+ - - '='
1012
+ - !ruby/object:Gem::Version
1013
+ version: 1.3.0
1014
+ type: :runtime
1015
+ prerelease: false
1016
+ version_requirements: !ruby/object:Gem::Requirement
1017
+ requirements:
1018
+ - - '='
1019
+ - !ruby/object:Gem::Version
1020
+ version: 1.3.0
993
1021
  - !ruby/object:Gem::Dependency
994
1022
  name: thin
995
1023
  requirement: !ruby/object:Gem::Requirement
@@ -1137,7 +1165,6 @@ executables:
1137
1165
  - pwn_defectdojo_importscan
1138
1166
  - pwn_defectdojo_reimportscan
1139
1167
  - pwn_diff_csv_files_w_column_exclude
1140
- - pwn_diff_xml_files
1141
1168
  - pwn_domain_reversewhois
1142
1169
  - pwn_fuzz_net_app_proto
1143
1170
  - pwn_ibm_appscan_enterprise
@@ -1205,7 +1232,6 @@ files:
1205
1232
  - bin/pwn_defectdojo_importscan
1206
1233
  - bin/pwn_defectdojo_reimportscan
1207
1234
  - bin/pwn_diff_csv_files_w_column_exclude
1208
- - bin/pwn_diff_xml_files
1209
1235
  - bin/pwn_domain_reversewhois
1210
1236
  - bin/pwn_fuzz_net_app_proto
1211
1237
  - bin/pwn_ibm_appscan_enterprise
@@ -1835,7 +1861,7 @@ files:
1835
1861
  - packer/provisioners/install_vagrant_ssh_key.sh
1836
1862
  - packer/provisioners/jenkins.sh
1837
1863
  - packer/provisioners/metasploit.rb
1838
- - packer/provisioners/nmap_all_live_hosts.sh
1864
+ - packer/provisioners/nmap.sh
1839
1865
  - packer/provisioners/openvas.sh
1840
1866
  - packer/provisioners/openvas_wrappers.sh
1841
1867
  - packer/provisioners/openvpn.sh
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'nokogiri/diff'
5
- require 'optparse'
6
-
7
- opts = {}
8
- OptionParser.new do |options|
9
- options.on('-aXML', '--xml-a=XML', '<Required - First XML to Compare)>') do |x1|
10
- opts[:x1_path] = x1
11
- end
12
-
13
- options.on('-bXML', '--xml-b=XML', '<Required - Second XML to Compare)>') do |x2|
14
- opts[:x2_path] = x2
15
- end
16
-
17
- options.on('-dDIFF', '--xml-diff=DIFF', '<Required - Path of XML Diff to Generate)>') do |d|
18
- opts[:diff_path] = d
19
- end
20
- end.parse!
21
-
22
- if opts.empty?
23
- puts `#{$PROGRAM_NAME} --help`
24
- exit 1
25
- end
26
-
27
- # Compare the diff of two XML files using the nokogiri gem in Ruby
28
- # and output the diff to a new XML file using the same format as the
29
- # the original XML files.
30
- begin
31
- x1_path = opts[:x1_path]
32
- x2_path = opts[:x2_path]
33
- diff_path = opts[:diff_path]
34
-
35
- x1 = Nokogiri::XML(File.read(x1_path))
36
- x2 = Nokogiri::XML(File.read(x2_path))
37
-
38
- diff_xml = Nokogiri::XML::Builder.new do |xml|
39
- xml.diff do
40
- x1.root.traverse do |node|
41
- next unless node.element?
42
-
43
- node_name = node.name
44
- node_x2 = x2.at_xpath(node.path)
45
-
46
- if node_x2.nil?
47
- xml.delete do
48
- xml.send(node_name, node.attributes)
49
- end
50
- elsif node_x2 != node
51
- xml.change do
52
- xml.send(node_name, node.attributes)
53
- end
54
- end
55
- end
56
-
57
- x2.root.traverse do |node|
58
- next unless node.element?
59
-
60
- node_name = node.name
61
- node_x1 = x1.at_xpath(node.path)
62
-
63
- xml.add do
64
- xml.send(node_name, node.attributes) if node_x1.nil?
65
- end
66
- end
67
- end
68
- end
69
-
70
- File.write(diff_path, diff_xml.to_xml)
71
- rescue StandardError => e
72
- puts "Error: #{e.message}"
73
- exit 1
74
- end
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
- source /etc/profile.d/globals.sh
3
-
4
- $screen_cmd "${apt} install -y nmap ncat ${assess_update_errors}"
5
- grok_error
6
-
7
- $screen_cmd "cd /opt && git clone https://github.com/ninp0/nmap_all_live_hosts.git && ln -sf /opt/nmap_all_live_hosts/nmap_all_live_hosts.sh /usr/local/bin/ ${assess_update_errors}"
8
- grok_error