pwn 0.4.699 → 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: d745dcbcd6c2a339cc95cd95cf520971dd1cb5d382e440222cad856b610899d4
4
- data.tar.gz: 0fbe7d75659820c93ff70d1803fc397d4496a43e9148ee303e0d661cc7e88446
3
+ metadata.gz: f21820a32e67fe03171657ab0c5c382103354ad1465fb2de2a7ecc167ab1f77b
4
+ data.tar.gz: 4ffbee987270f1e6509e4363db92f6ede6c84266c52bdd1032c777f9be3aaa8d
5
5
  SHA512:
6
- metadata.gz: ccb00ebd0473169fef1745f37cdf988344afa39709590ff96d3d304f041a1a8fa664ade80425eb554649872bc891742466975826a3e79c0e34bbb24238bdb438
7
- data.tar.gz: a0c6cbcfe85105ace99b455f38804c75f03a24457a0b9b713e9b87cc66927610a09f2366f147cde39f298d8bf02554eb505f83a2c21b15fc7113102b1bc28b7c
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'
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.699]: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.699]:001 >>> PWN.help
55
+ pwn[v0.4.700]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -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.699'
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.699
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
@@ -1151,7 +1165,6 @@ executables:
1151
1165
  - pwn_defectdojo_importscan
1152
1166
  - pwn_defectdojo_reimportscan
1153
1167
  - pwn_diff_csv_files_w_column_exclude
1154
- - pwn_diff_xml_files
1155
1168
  - pwn_domain_reversewhois
1156
1169
  - pwn_fuzz_net_app_proto
1157
1170
  - pwn_ibm_appscan_enterprise
@@ -1219,7 +1232,6 @@ files:
1219
1232
  - bin/pwn_defectdojo_importscan
1220
1233
  - bin/pwn_defectdojo_reimportscan
1221
1234
  - bin/pwn_diff_csv_files_w_column_exclude
1222
- - bin/pwn_diff_xml_files
1223
1235
  - bin/pwn_domain_reversewhois
1224
1236
  - bin/pwn_fuzz_net_app_proto
1225
1237
  - bin/pwn_ibm_appscan_enterprise
@@ -1849,7 +1861,7 @@ files:
1849
1861
  - packer/provisioners/install_vagrant_ssh_key.sh
1850
1862
  - packer/provisioners/jenkins.sh
1851
1863
  - packer/provisioners/metasploit.rb
1852
- - packer/provisioners/nmap_all_live_hosts.sh
1864
+ - packer/provisioners/nmap.sh
1853
1865
  - packer/provisioners/openvas.sh
1854
1866
  - packer/provisioners/openvas_wrappers.sh
1855
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