pwn 0.5.390 → 0.5.391

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: 29455d0f44118f016d59ba4370e80b883a189d960697d2ad98f1c6d36b6b953d
4
- data.tar.gz: bda5ff363c12e7b054daf8f71936d8d83ccf973c7e927333331e6107ddb9e4df
3
+ metadata.gz: fbd0402cd8475fd231d37a5face9831c7f6e12151e76422201968eebf6f39180
4
+ data.tar.gz: 50f372071410a7a0e741b3e938ef7f8e498f5e609b8074ec35d0d2fc8f5d03d9
5
5
  SHA512:
6
- metadata.gz: 885789f3328900c0e0cfee3c69a868a54851b9b156c61399a32f789daa767e1f33d5a1f4846d197832f76f8916da525cd40e564666691ed2489b495e0e47cc06
7
- data.tar.gz: b25394c00e67546058cc7cc0b8da9cdf2b93a1165f4305ed056c5959907273f4b884607be987550095fd9fcae14bdacfd81a58a7e08c6381742cca2be6c947ee
6
+ metadata.gz: 033d363e5ff734f1f0c404a73d4f777acc529b3631e082be3fe5f6e33b76429199b2deef835d4c5ddc1b24b60a8477ebbdbe66278898ad33db8110ae94c9fc54
7
+ data.tar.gz: b0d3d7c16af3a0d39441c639de42b9c09eeb492962a6289a967f7f8ce489a3bf519dc97e109ba0bb756655a7d88ff539998cc7f0d6dd5b6ce47603efac5bcda0
data/Gemfile CHANGED
@@ -69,7 +69,7 @@ gem 'ostruct', '0.6.3'
69
69
  gem 'packetfu', '2.0.0'
70
70
  gem 'packetgen', '4.1.1'
71
71
  gem 'pdf-reader', '2.15.0'
72
- gem 'pg', '1.6.1'
72
+ gem 'pg', '1.6.2'
73
73
  gem 'pry', '0.15.2'
74
74
  gem 'pry-doc', '1.6.0'
75
75
  gem 'rake', '13.3.0'
@@ -84,7 +84,7 @@ gem 'rspec', '3.13.1'
84
84
  gem 'rtesseract', '3.1.4'
85
85
  gem 'rubocop', '1.80.1'
86
86
  gem 'rubocop-rake', '0.7.1'
87
- gem 'rubocop-rspec', '3.6.0'
87
+ gem 'rubocop-rspec', '3.7.0'
88
88
  gem 'ruby-audio', '1.6.1'
89
89
  gem 'ruby-nmap', '1.0.3'
90
90
  gem 'ruby-saml', '1.18.1'
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
37
37
  $ ./install.sh
38
38
  $ ./install.sh ruby-gem
39
39
  $ pwn
40
- pwn[v0.5.390]:001 >>> PWN.help
40
+ pwn[v0.5.391]: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.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.390]:001 >>> PWN.help
55
+ pwn[v0.5.391]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
  If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.390]:001 >>> PWN.help
65
+ pwn[v0.5.391]:001 >>> PWN.help
66
66
  ```
67
67
 
68
68
  PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
@@ -0,0 +1,181 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+ require 'pwn'
6
+ require 'optparse'
7
+ require 'uri'
8
+
9
+ opts = {}
10
+ OptionParser.new do |options|
11
+ options.banner = "USAGE:
12
+ #{File.basename($PROGRAM_NAME)} [opts]
13
+ "
14
+
15
+ options.on('-tTARGET', '--target_url=TARGET', '<Required - Target URI to Scan>') do |t|
16
+ opts[:target_url] = t
17
+ end
18
+
19
+ options.on('-oPATH', '--report_output_path=PATH', '<Required - Output Path for Active Scan Issues>') do |o|
20
+ opts[:output_path] = o
21
+ end
22
+
23
+ options.on('-dSWAGGER', '--swagger_definitions=SWAGGER', '<Required - Comma-delimited list of Swagger JSON/YAML files to import>') do |s|
24
+ opts[:swagger_definitions] = s
25
+ end
26
+
27
+ options.on('-D', '--[no-]debug', '<Optional - Enable Debug Output and Do Not Delete Temporary OpenAPI Spec>') do |d|
28
+ opts[:debug] = d
29
+ end
30
+
31
+ options.on('-vVERSION', '--openapi_spec_version=VERSION', '<Optional - OpenAPI/Swagger Specification Version (Defaults to 3.0.3)>') do |o|
32
+ opts[:openapi_spec_version] = o
33
+ end
34
+
35
+ options.on('-HJSON', '--additional_http_headers=JSON', '<Optional - JSON string of additional HTTP headers to include in requests (e.g. \'{"Header1":"Value1","Header2":"Value2"}\')>') do |h|
36
+ opts[:additional_http_headers] = h
37
+ end
38
+
39
+ options.on('-cCOLOR', '--highlight-color=COLOR', '<Optional - Highlight Color to use when importing OpenAPI/Swagger definitions NONE||RED||ORANGE||YELLOW||GREEN||CYAN||BLUE||PINK||MAGENTA||GRAY (Defaults to GREEN)>') do |h|
40
+ opts[:highlight_color] = h
41
+ end
42
+
43
+ options.on('-nCOMMENTS', '--notes=COMMENTS', '<Optional - Comments to add when importing OpenAPI/Swagger definitions (Defaults to "Imported via <openapi_spec> on <timestamp>")>') do |n|
44
+ opts[:notes] = n
45
+ end
46
+
47
+ options.on('-eLIST', '--exclude_paths=LIST', '<Optional - Comma-delimited list of paths to exlude from scanning (e.g. "/api/login, /api/logout, /api/etc")>') do |e|
48
+ opts[:exclude_paths] = e
49
+ end
50
+
51
+ options.on('-bBPATH', '--burp_path=BPATH', '<Optional - Path to Burp Suite Pro Jar File (Defaults to /opt/burpsuite/burpsuite-pro.jar)>') do |b|
52
+ opts[:burp_jar_path] = b
53
+ end
54
+
55
+ options.on('-h', '--[no-]headless', '<Optional - Run Burp and Browser Headless>') do |h|
56
+ opts[:headless] = h
57
+ end
58
+
59
+ options.on('-iURL', '--in_scope=URL', '<Optional - URL to add include in scope (Defaults to value of --target_url)>') do |s|
60
+ opts[:in_scope] = s
61
+ end
62
+ end.parse!
63
+
64
+ if opts.empty?
65
+ puts `#{File.basename($PROGRAM_NAME)} --help`
66
+ exit 1
67
+ end
68
+
69
+ begin
70
+ timestamp = Time.now.strftime('%Y-%m-%d_%H-%M-%S%Z')
71
+ logger = PWN::Plugins::PWNLogger.create
72
+
73
+ burp_jar_path = opts[:burp_jar_path]
74
+ headless = opts[:headless] || false
75
+ target_url = opts[:target_url]
76
+ raise 'ERROR: --target_url is required.' if target_url.nil?
77
+
78
+ output_path = opts[:output_path]
79
+ raise 'ERROR: --report_output_path is required.' if output_path.nil?
80
+
81
+ swagger_definitions = opts[:swagger_definitions]
82
+ raise 'ERROR: --swagger_definitions is required.' if swagger_definitions.nil?
83
+
84
+ debug = opts[:debug] || false
85
+
86
+ swagger_defs_arr = swagger_definitions.split(',').map(&:strip)
87
+ scheme = URI.parse(target_url).scheme
88
+ target_host = URI.parse(target_url).host
89
+ base_url = "#{scheme}://#{target_host}"
90
+
91
+ openapi_spec_version = opts[:openapi_spec_version]
92
+ openapi_spec = "/tmp/openapi_spec-#{target_host}-#{timestamp}.json"
93
+
94
+ PWN::Plugins::OpenAPI.generate_spec(
95
+ spec_paths: swagger_defs_arr,
96
+ base_url: base_url,
97
+ output_json_path: openapi_spec,
98
+ target_version: openapi_spec_version,
99
+ debug: debug
100
+ )
101
+
102
+ additional_http_headers = opts[:additional_http_headers]
103
+ additional_http_headers = JSON.parse(additional_http_headers, symbolize_names: true) if additional_http_headers.is_a?(String)
104
+
105
+ highlight_color = opts[:highlight_color] ||= 'GREEN'
106
+ notes = opts[:notes] ||= "Imported via #{openapi_spec} on #{timestamp}"
107
+
108
+ exlude_paths = opts[:exclude_paths]
109
+ exlude_paths = exlude_paths.split(',').map(&:strip) if exlude_paths.is_a?(String)
110
+
111
+ in_scope = opts[:in_scope] ||= target_url
112
+
113
+ # ------
114
+ # Open Burp
115
+ if headless
116
+ burp_obj = PWN::Plugins::BurpSuite.start(
117
+ burp_jar_path: burp_jar_path,
118
+ browser_type: :headless
119
+ )
120
+ else
121
+ burp_obj = PWN::Plugins::BurpSuite.start(
122
+ burp_jar_path: burp_jar_path,
123
+ browser_type: :chrome
124
+ )
125
+ end
126
+
127
+ logger.info(burp_obj)
128
+ # Disable Proxy Intercepting Capabilities for this Driver
129
+ PWN::Plugins::BurpSuite.disable_proxy(burp_obj: burp_obj)
130
+
131
+ # Add URL to Target >> Scope >> Inclue in scope
132
+ PWN::Plugins::BurpSuite.add_to_scope(
133
+ burp_obj: burp_obj,
134
+ target_url: in_scope
135
+ )
136
+
137
+ json_sitemap = PWN::Plugins::BurpSuite.import_openapi_to_sitemap(
138
+ burp_obj: burp_obj,
139
+ openapi_spec: openapi_spec,
140
+ additional_http_headers: additional_http_headers,
141
+ highlight: highlight_color,
142
+ comment: notes,
143
+ debug: debug
144
+ )
145
+
146
+ raise "ERROR: Failed to import OpenAPI/Swagger spec #{openapi_spec} into Burp Suite Pro's Sitemap." if json_sitemap.nil? || json_sitemap.empty?
147
+
148
+ PWN::Plugins::BurpSuite.invoke_active_scan(
149
+ burp_obj: burp_obj,
150
+ target_url: in_scope,
151
+ exclude_paths: exlude_paths
152
+ )
153
+
154
+ # Dump a list of scan issues from Active Scan result
155
+ # scan_issues = PWN::Plugins::BurpSuite.get_scan_issues(burp_obj: burp_obj)
156
+ # puts scan_issues
157
+
158
+ # Once DefectDojo begins to support XML report results
159
+ report_types = %i[html xml]
160
+ report_types.each do |report_type|
161
+ this_output_path = "#{output_path}.html"
162
+ # this_output_path = "#{File.dirname(output_path)}/#{File.basename(output_path, File.extname(output_path))}.html"
163
+
164
+ this_output_path = "#{output_path}.xml" if report_type == :xml
165
+ # this_output_path = "#{File.dirname(output_path)}/#{File.basename(output_path, File.extname(output_path))}.xml" if report_type == :xml
166
+
167
+ PWN::Plugins::BurpSuite.generate_scan_report(
168
+ burp_obj: burp_obj,
169
+ target_url: in_scope,
170
+ report_type: report_type,
171
+ output_path: this_output_path
172
+ )
173
+ end
174
+
175
+ burp_obj = PWN::Plugins::BurpSuite.stop(burp_obj: burp_obj)
176
+ rescue StandardError => e
177
+ raise e
178
+ ensure
179
+ FileUtils.rm_f(openapi_spec) unless debug
180
+ burp_obj = PWN::Plugins::BurpSuite.stop(burp_obj: burp_obj) unless burp_obj.nil?
181
+ end
@@ -72,7 +72,6 @@ begin
72
72
  if headless
73
73
  burp_obj = PWN::Plugins::BurpSuite.start(
74
74
  burp_jar_path: burp_jar_path,
75
- headless: true,
76
75
  browser_type: :headless
77
76
  )
78
77
  else
@@ -119,7 +118,11 @@ begin
119
118
  sleep duration # Sleep for now so everything loads the way we expect - blech.
120
119
  print "\n"
121
120
 
122
- PWN::Plugins::BurpSuite.invoke_active_scan(burp_obj: burp_obj, target_url: in_scope, exclude_paths: exlude_paths)
121
+ PWN::Plugins::BurpSuite.invoke_active_scan(
122
+ burp_obj: burp_obj,
123
+ target_url: in_scope,
124
+ exclude_paths: exlude_paths
125
+ )
123
126
 
124
127
  # Dump a list of scan issues from Active Scan result
125
128
  # scan_issues = PWN::Plugins::BurpSuite.get_scan_issues(burp_obj: burp_obj)
@@ -27,7 +27,7 @@ module PWN
27
27
  base_url = opts[:base_url]
28
28
  raise ArgumentError, 'base_url is required' if base_url.nil? || base_url.empty?
29
29
 
30
- target_version = opts[:target_version] || '3.0.3'
30
+ target_version = opts[:target_version] ||= '3.0.3'
31
31
  raise ArgumentError, "Unsupported OpenAPI version: #{target_version}" unless %w[3.0.0 3.0.1 3.0.2 3.0.3 3.1.0].include?(target_version)
32
32
 
33
33
  output_json_path = opts[:output_json_path]
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.5.390'
4
+ VERSION = '0.5.391'
5
5
  end
@@ -1050,10 +1050,15 @@
1050
1050
  {"messages":[{"role":"user","content":"PWN::Reports::Fuzz.authors Usage"},{"role":"assistant","content":"`PWN::Reports::Fuzz.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
1051
1051
  {"messages":[{"role":"user","content":"PWN::Reports::Fuzz.generate Usage"},{"role":"assistant","content":"`PWN::Reports::Fuzz.generate`: Supported Method Parameters\n\nPWN::Reports::Fuzz.generate(\n\ndir_path: dir_path,\nresults_hash: results_hash,\nchar_encoding: 'optional - character encoding returned by PWN::Plugins::Char.list_encoders (defaults to UTF-8)'\n\n)\n"}]}
1052
1052
  {"messages":[{"role":"user","content":"PWN::Reports::Fuzz.help Usage"},{"role":"assistant","content":"`PWN::Reports::Fuzz.help`: "}]}
1053
+ {"messages":[{"role":"user","content":"PWN::Reports::HTMLHeader.authors Usage"},{"role":"assistant","content":"`PWN::Reports::HTMLHeader.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
1054
+ {"messages":[{"role":"user","content":"PWN::Reports::HTMLHeader.generate Usage"},{"role":"assistant","content":"`PWN::Reports::HTMLHeader.generate`: Supported Method Parameters\n\nPWN::Reports::HTMLHeader.generate(\n\ncolumn_names: 'required - array of column names to use in the report table',\ndriver_src_uri: 'required - pwn driver source code uri',\n\n)\n"}]}
1055
+ {"messages":[{"role":"user","content":"PWN::Reports::HTMLHeader.help Usage"},{"role":"assistant","content":"`PWN::Reports::HTMLHeader.help`: "}]}
1053
1056
  {"messages":[{"role":"user","content":"PWN::Reports::Phone.authors Usage"},{"role":"assistant","content":"`PWN::Reports::Phone.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
1054
1057
  {"messages":[{"role":"user","content":"PWN::Reports::Phone.generate Usage"},{"role":"assistant","content":"`PWN::Reports::Phone.generate`: Supported Method Parameters\n\nPWN::Reports::Phone.generate(\n\ndir_path: dir_path,\nresults_hash: results_hash\n\n)\n"}]}
1055
1058
  {"messages":[{"role":"user","content":"PWN::Reports::Phone.help Usage"},{"role":"assistant","content":"`PWN::Reports::Phone.help`: "}]}
1059
+ {"messages":[{"role":"user","content":"PWN::Reports::SAST.authors Usage"},{"role":"assistant","content":"`PWN::Reports::SAST.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
1056
1060
  {"messages":[{"role":"user","content":"PWN::Reports::SAST.generate Usage"},{"role":"assistant","content":"`PWN::Reports::SAST.generate`: Supported Method Parameters\n\nPWN::Reports::SAST.generate(\n\ndir_path: 'optional - Directory path to save the report (defaults to .)',\nresults_hash: 'optional - Hash containing the results of the SAST analysis (defaults to empty hash structure)',\nreport_name: 'optional - Name of the report file (defaults to current directory name)',\nai_engine: 'optional - AI engine to use for analysis (:grok, :ollama, or :openai)',\nai_model: 'optionnal - AI Model to Use for Respective AI Engine (e.g., grok-4i-0709, chargpt-4o-latest, llama-3.1, etc.)',\nai_key: 'optional - AI Key/Token for Respective AI Engine',\nai_fqdn: 'optional - AI FQDN (Only Required for \"ollama\" AI Engine)',\nai_system_role_content: 'optional - AI System Role Content (Defaults to \"Is this code vulnerable or a false positive? Valid responses are only: \"VULNERABLE\" or \"FALSE+\". DO NOT PROVIDE ANY OTHER TEXT OR EXPLANATIONS.\")',\nai_temp: 'optional - AI Temperature (Defaults to 0.9)'\n\n)\n"}]}
1061
+ {"messages":[{"role":"user","content":"PWN::Reports::SAST.help Usage"},{"role":"assistant","content":"`PWN::Reports::SAST.help`: "}]}
1057
1062
  {"messages":[{"role":"user","content":"PWN::Reports::URIBuster.authors Usage"},{"role":"assistant","content":"`PWN::Reports::URIBuster.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
1058
1063
  {"messages":[{"role":"user","content":"PWN::Reports::URIBuster.generate Usage"},{"role":"assistant","content":"`PWN::Reports::URIBuster.generate`: Supported Method Parameters\n\nPWN::Reports::URIBuster.generate(\n\ndir_path: dir_path,\nresults_hash: results_hash\n\n)\n"}]}
1059
1064
  {"messages":[{"role":"user","content":"PWN::Reports::URIBuster.help Usage"},{"role":"assistant","content":"`PWN::Reports::URIBuster.help`: "}]}
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.5.390
4
+ version: 0.5.391
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -757,14 +757,14 @@ dependencies:
757
757
  requirements:
758
758
  - - '='
759
759
  - !ruby/object:Gem::Version
760
- version: 1.6.1
760
+ version: 1.6.2
761
761
  type: :runtime
762
762
  prerelease: false
763
763
  version_requirements: !ruby/object:Gem::Requirement
764
764
  requirements:
765
765
  - - '='
766
766
  - !ruby/object:Gem::Version
767
- version: 1.6.1
767
+ version: 1.6.2
768
768
  - !ruby/object:Gem::Dependency
769
769
  name: pry
770
770
  requirement: !ruby/object:Gem::Requirement
@@ -967,14 +967,14 @@ dependencies:
967
967
  requirements:
968
968
  - - '='
969
969
  - !ruby/object:Gem::Version
970
- version: 3.6.0
970
+ version: 3.7.0
971
971
  type: :runtime
972
972
  prerelease: false
973
973
  version_requirements: !ruby/object:Gem::Requirement
974
974
  requirements:
975
975
  - - '='
976
976
  - !ruby/object:Gem::Version
977
- version: 3.6.0
977
+ version: 3.7.0
978
978
  - !ruby/object:Gem::Dependency
979
979
  name: ruby-audio
980
980
  requirement: !ruby/object:Gem::Requirement
@@ -1279,6 +1279,7 @@ executables:
1279
1279
  - pwn_aws_describe_resources
1280
1280
  - pwn_bdba_groups
1281
1281
  - pwn_bdba_scan
1282
+ - pwn_burp_suite_pro_active_rest_api_scan
1282
1283
  - pwn_burp_suite_pro_active_scan
1283
1284
  - pwn_char_base64_encoding
1284
1285
  - pwn_char_dec_encoding
@@ -1348,6 +1349,7 @@ files:
1348
1349
  - bin/pwn_aws_describe_resources
1349
1350
  - bin/pwn_bdba_groups
1350
1351
  - bin/pwn_bdba_scan
1352
+ - bin/pwn_burp_suite_pro_active_rest_api_scan
1351
1353
  - bin/pwn_burp_suite_pro_active_scan
1352
1354
  - bin/pwn_char_base64_encoding
1353
1355
  - bin/pwn_char_dec_encoding