pwn 0.4.402 → 0.4.405

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d035fc6b4a1f52a40c9e9b1f5a20477bdae1fa051509b4a97254e631b13969e
4
- data.tar.gz: de36dc86c3bc166b9e84bc90c6490a86826feffb29ea86573e3e0a34a178a539
3
+ metadata.gz: aab0b3fa754f1a39c2b4fbd6c88558ebc0e6b4728963298f564dfbda98850273
4
+ data.tar.gz: 117f317acc9cc3296cb8e2f42890dd17046aaab8551c08f20a844e3e93392b35
5
5
  SHA512:
6
- metadata.gz: d9590faf6e192ae76dc6a2cf3c9b92cfd5b42c429688128747081212c5667635e07789a7bd0b092f610539794c10bdb185c307f7689e60d303dd9a6a7568ed9f
7
- data.tar.gz: fcb0361b99db142051a3cbc208af3977be05ec7065e9fa7cfc084c7b7024d84b1d5d874ab767f7e5aadec64eaa386e1863f98e16a399c82a74a1ffdbdc3ce98a
6
+ metadata.gz: f3608d5ee4b161f788e2b3b2a8ae83f82adcd993b81da08018eed13ffb694e4db0dd1976f33e5a056f0f3b19929cf9f4ddad63604638159b6ea3d96d8095d6f3
7
+ data.tar.gz: af0bad2f4d2d3ea3177e6766f873ad782d781e25729e44b709e55c35ce0640c3ed988b28dbc7b5bdbcdb25fd7c78bb671147495e53e564c57d22448f4dd8fcad
data/Gemfile CHANGED
@@ -18,11 +18,11 @@ gem 'aws-sdk', '3.1.0'
18
18
  gem 'bettercap', '1.6.2'
19
19
  gem 'brakeman', '5.2.2'
20
20
  gem 'bson', '4.14.1'
21
- gem 'bundler', '>=2.3.10'
21
+ gem 'bundler', '>=2.3.11'
22
22
  gem 'bundler-audit', '0.9.0.1'
23
23
  gem 'bunny', '2.19.0'
24
24
  gem 'colorize', '0.8.1'
25
- # gem 'credit_card_validations', '4.1.0'
25
+ gem 'credit_card_validations', '5.0.0'
26
26
  gem 'faye-websocket', '0.11.1'
27
27
  gem 'gdb', '1.0.0'
28
28
  gem 'gist', '6.0.0'
@@ -41,7 +41,7 @@ gem 'net-ldap', '0.17.0'
41
41
  gem 'net-openvpn', '0.8.7'
42
42
  gem 'net-smtp', '0.3.1'
43
43
  gem 'nexpose', '7.3.0'
44
- gem 'nokogiri', '1.13.3'
44
+ gem 'nokogiri', '1.13.4'
45
45
  gem 'oily_png', '1.2.1'
46
46
  gem 'os', '1.1.4'
47
47
  gem 'packetfu', '1.1.13'
@@ -58,7 +58,7 @@ gem 'rex', '2.0.13'
58
58
  gem 'rmagick', '4.2.5'
59
59
  gem 'rspec', '3.11.0'
60
60
  gem 'rtesseract', '3.1.2'
61
- gem 'rubocop', '1.26.1'
61
+ gem 'rubocop', '1.27.0'
62
62
  gem 'rubocop-rake', '0.6.0'
63
63
  gem 'rubocop-rspec', '2.9.0'
64
64
  gem 'ruby-audio', '1.6.1'
@@ -79,3 +79,4 @@ gem 'watir', '7.1.0'
79
79
  gem 'waveform', '0.1.2'
80
80
  gem 'webrick', '1.7.0'
81
81
  gem 'wicked_pdf', '2.1.0'
82
+ gem 'yard', '0.9.27'
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.1@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.402]:001 >>> PWN.help
40
+ pwn[v0.4.405]: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.1.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.402]:001 >>> PWN.help
55
+ pwn[v0.4.405]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn CHANGED
@@ -56,6 +56,14 @@ begin
56
56
  end
57
57
 
58
58
  # Define Custom REPL Commands
59
+ Pry::Commands.create_command 'welcome-banner' do
60
+ description 'Display the random welcome banner, including basic usage.'
61
+
62
+ def process
63
+ puts PWN::Banner.welcome
64
+ end
65
+ end
66
+
59
67
  Pry::Commands.create_command 'toggle-pager' do
60
68
  description 'Toggle less on returned objects surpassing the terminal.'
61
69
 
@@ -67,12 +75,7 @@ begin
67
75
 
68
76
  # Define REPL Hooks
69
77
  Pry.config.hooks.add_hook(:before_session, :welcome) do |output, _binding, _pry|
70
- output.puts PWN::Banner.get
71
- output.puts 'Use the #help command & methods for more options.'
72
- output.puts 'e.g help'
73
- output.puts 'e.g PWN.help'
74
- output.puts 'e.g PWN::Plugins.help'
75
- output.puts 'e.g PWN::Plugins::TransparentBrowser.help'
78
+ output.puts PWN::Banner.welcome
76
79
  end
77
80
 
78
81
  # Define PS1 Prompt
data/bin/pwn_sast CHANGED
@@ -76,12 +76,13 @@ begin
76
76
  CmdExecutionRuby
77
77
  CmdExecutionScala
78
78
  CSRF
79
- Emoticon
80
79
  DeserialJava
80
+ Emoticon
81
81
  Eval
82
- InnerHTML
83
- FilePermission
84
82
  Factory
83
+ FilePermission
84
+ HTTPAuthorizationHeader
85
+ InnerHTML
85
86
  LocationHash
86
87
  Log4J
87
88
  Logger
@@ -153,7 +153,10 @@ module PWN
153
153
  '> ',
154
154
  '< ',
155
155
  '. ',
156
- ', '
156
+ ', ',
157
+ 'P',
158
+ 'W',
159
+ 'N'
157
160
  ]
158
161
 
159
162
  last_index = matrix_arr.length - 1
@@ -169,7 +172,6 @@ module PWN
169
172
  matrix = "#{matrix}#{matrix_row}\n"
170
173
  end
171
174
 
172
- matrix = "#{matrix}PWN\n"
173
175
  matrix.green
174
176
  rescue StandardError => e
175
177
  raise e
@@ -23,7 +23,7 @@ module PWN
23
23
  d4 = '%%%%%'.black
24
24
  d5 = '-----'.light_blue
25
25
  d6 = '@@@@@'.black
26
- d7 = ':::::'.white
26
+ d7 = 'PWN::'.red
27
27
  ee1 = '######'.red
28
28
  ee2 = '......'.white
29
29
  ee3 = '******'.blue
@@ -46,7 +46,6 @@ module PWN
46
46
  #{ee1}#{ee2}#{ee3}#{ee4}#{ee5}#{f1}
47
47
  #{ee1}#{ee2}#{ee3}#{ee4}#{ee5}#{f1}
48
48
  #{ee1}#{ee2}#{ee3}#{ee4}#{ee5}#{f1}
49
- PWN
50
49
  "
51
50
  rescue StandardError => e
52
51
  raise e
data/lib/pwn/banner.rb CHANGED
@@ -39,6 +39,20 @@ module PWN
39
39
  banner
40
40
  end
41
41
 
42
+ # Supported Method Parameters::
43
+ # PWN::Banner.get(
44
+ # index: 'optional - defaults to random banner index'
45
+ # )
46
+
47
+ public_class_method def self.welcome
48
+ banner = PWN::Banner.get
49
+ banner = "#{banner}\nUse the #help command & methods for more options.\n"
50
+ banner = "#{banner}e.g help\n"
51
+ banner = "#{banner}e.g PWN.help\n"
52
+ banner = "#{banner}e.g PWN::Plugins.help\n"
53
+ banner = "#{banner}e.g PWN::Plugins::TransparentBrowser.help\n"
54
+ end
55
+
42
56
  # Author(s):: 0day Inc. <request.pentest@0dayinc.com>
43
57
 
44
58
  public_class_method def self.authors
@@ -55,6 +69,8 @@ module PWN
55
69
  index: 'optional - defaults to random banner index'
56
70
  )
57
71
 
72
+ banner = #{self}.welcome
73
+
58
74
  #{self}.authors
59
75
  "
60
76
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # require 'credit_card_validations'
3
+ require 'credit_card_validations'
4
4
 
5
5
  module PWN
6
6
  module Plugins
@@ -12,7 +12,7 @@ module PWN
12
12
  @@logger = PWN::Plugins::PWNLogger.create
13
13
 
14
14
  # Supported Method Parameters::
15
- # PWN::SAST::Deseria.scan(
15
+ # PWN::SAST::DeserialJava.scan(
16
16
  # :dir_path => 'optional path to dir defaults to .'
17
17
  # :git_repo_root_uri => 'optional http uri of git repo scanned'
18
18
  # )
@@ -0,0 +1,145 @@
1
+ # frozen_string_literal: false
2
+
3
+ require 'socket'
4
+
5
+ module PWN
6
+ module SAST
7
+ # SAST Module used to identify hard-code/plain-text
8
+ # passwords within source code.
9
+ module HTTPAuthorizationHeader
10
+ @@logger = PWN::Plugins::PWNLogger.create
11
+
12
+ # Supported Method Parameters::
13
+ # PWN::SAST::HTTPAuthorizationHeader.scan(
14
+ # :dir_path => 'optional path to dir defaults to .'
15
+ # :git_repo_root_uri => 'optional http uri of git repo scanned'
16
+ # )
17
+
18
+ public_class_method def self.scan(opts = {})
19
+ dir_path = opts[:dir_path]
20
+ git_repo_root_uri = opts[:git_repo_root_uri].to_s.scrub
21
+ result_arr = []
22
+ logger_results = ''
23
+
24
+ PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/
26
+ line_no_and_contents_arr = []
27
+ filename_arr = []
28
+ entry_beautified = false
29
+
30
+ if File.extname(entry) == '.js' && (`wc -l #{entry}`.split.first.to_i < 20 || entry.include?('.min.js') || entry.include?('-all.js'))
31
+ js_beautify = `js-beautify #{entry} > #{entry}.JS-BEAUTIFIED`.to_s.scrub
32
+ entry = "#{entry}.JS-BEAUTIFIED"
33
+ entry_beautified = true
34
+ end
35
+
36
+ test_case_filter = %(
37
+ grep -Ein \
38
+ -e "Authorization:(\\sBasic|Basic)" \
39
+ -e "Authorization:(\\sBearer|Bearer)" \
40
+ -e "Authorization:(\\sDigest|Digest)" \
41
+ -e "Authorization:(\\sHOBA|HOBA)" \
42
+ -e "Authorization:(\\sMutual|Mutual)" \
43
+ -e "Authorization:(\\sNegotiate|Negotiate)" \
44
+ -e "Authorization:(\\sVapid|Vapid)" \
45
+ -e "Authorization:(\\sSCRAM|SCRAM)" \
46
+ -e "Authorization:(\\sAWS|AWS)" \
47
+ -e "authorization(\\s=|=)" #{entry}
48
+ )
49
+
50
+ str = `#{test_case_filter}`.to_s.scrub
51
+
52
+ if str.to_s.empty?
53
+ # If str length is >= 64 KB do not include results. (Due to Mongo Document Size Restrictions)
54
+ logger_results = "#{logger_results}~" # Catching bugs is good :)
55
+ else
56
+ str = "1:Result larger than 64KB -> Size: #{str.to_s.length}. Please click the \"Path\" link for more details." if str.to_s.length >= 64_000
57
+
58
+ hash_line = {
59
+ timestamp: Time.now.strftime('%Y-%m-%d %H:%M:%S.%9N %z').to_s,
60
+ test_case: nist_800_53_requirements,
61
+ filename: filename_arr.push(git_repo_root_uri: git_repo_root_uri, entry: entry),
62
+ line_no_and_contents: '',
63
+ raw_content: str,
64
+ test_case_filter: test_case_filter
65
+ }
66
+
67
+ # COMMMENT: Must be a better way to implement this (regex is kinda funky)
68
+ line_contents_split = str.split(/^(\d{1,}):|\n(\d{1,}):/)[1..-1]
69
+ line_no_count = line_contents_split.length # This should always be an even number
70
+ current_count = 0
71
+ while line_no_count > current_count
72
+ line_no = line_contents_split[current_count]
73
+ contents = line_contents_split[current_count + 1]
74
+ if Dir.exist?("#{dir_path}/.git") ||
75
+ Dir.exist?('.git')
76
+
77
+ repo_root = dir_path
78
+ repo_root = '.' if Dir.exist?('.git')
79
+
80
+ author = PWN::Plugins::Git.get_author(
81
+ repo_root: repo_root,
82
+ from_line: line_no,
83
+ to_line: line_no,
84
+ target_file: entry,
85
+ entry_beautified: entry_beautified
86
+ )
87
+ else
88
+ author = 'N/A'
89
+ end
90
+ hash_line[:line_no_and_contents] = line_no_and_contents_arr.push(line_no: line_no,
91
+ contents: contents,
92
+ author: author)
93
+
94
+ current_count += 2
95
+ end
96
+ result_arr.push(hash_line)
97
+ logger_results = "#{logger_results}x" # Seeing progress is good :)
98
+ end
99
+ end
100
+ end
101
+ logger_banner = "http://#{Socket.gethostname}:8808/doc_root/pwn-#{PWN::VERSION.to_s.scrub}/#{to_s.scrub.gsub('::', '/')}.html"
102
+ if logger_results.empty?
103
+ @@logger.info("#{logger_banner}: No files applicable to this test case.\n")
104
+ else
105
+ @@logger.info("#{logger_banner} => #{logger_results}complete.\n")
106
+ end
107
+ result_arr
108
+ end
109
+
110
+ # Used primarily to map NIST 800-53 Revision 4 Security Controls
111
+ # https://web.nvd.nist.gov/view/800-53/Rev4/impact?impactName=HIGH
112
+ # to PWN Exploit & Static Code Anti-Pattern Matching Modules to
113
+ # Determine the level of Testing Coverage w/ PWN.
114
+
115
+ public_class_method def self.nist_800_53_requirements
116
+ {
117
+ sast_module: self,
118
+ section: 'PROTECTION OF INFORMATION AT REST',
119
+ nist_800_53_uri: 'https://csrc.nist.gov/Projects/risk-management/sp800-53-controls/release-search#!/control/?version=5.1&number=SC-28'
120
+ }
121
+ end
122
+
123
+ # Author(s):: 0day Inc. <request.pentest@0dayinc.com>
124
+
125
+ public_class_method def self.authors
126
+ "AUTHOR(S):
127
+ 0day Inc. <request.pentest@0dayinc.com>
128
+ "
129
+ end
130
+
131
+ # Display Usage for this Module
132
+
133
+ public_class_method def self.help
134
+ puts "USAGE:
135
+ sast_arr = #{self}.scan(
136
+ :dir_path => 'optional path to dir defaults to .',
137
+ :git_repo_root_uri => 'optional http uri of git repo scanned'
138
+ )
139
+
140
+ #{self}.authors
141
+ "
142
+ end
143
+ end
144
+ end
145
+ end
data/lib/pwn/sast.rb CHANGED
@@ -22,6 +22,7 @@ module PWN
22
22
  autoload :Eval, 'pwn/sast/eval'
23
23
  autoload :Factory, 'pwn/sast/factory'
24
24
  autoload :FilePermission, 'pwn/sast/file_permission'
25
+ autoload :HTTPAuthorizationHeader, 'pwn/sast/http_authorization_header'
25
26
  autoload :InnerHTML, 'pwn/sast/inner_html'
26
27
  autoload :Keystore, 'pwn/sast/keystore'
27
28
  autoload :LocationHash, 'pwn/sast/location_hash'
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.402'
4
+ VERSION = '0.4.405'
5
5
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe PWN::SAST::HTTPAuthorizationHeader do
6
+ it 'scan method should exist' do
7
+ scan_response = PWN::SAST::HTTPAuthorizationHeader
8
+ expect(scan_response).to respond_to :scan
9
+ end
10
+
11
+ it 'should display information for nist_800_53_requirements' do
12
+ nist_800_53_requirements_response = PWN::SAST::HTTPAuthorizationHeader
13
+ expect(nist_800_53_requirements_response).to respond_to :nist_800_53_requirements
14
+ end
15
+
16
+ it 'should display information for authors' do
17
+ authors_response = PWN::SAST::HTTPAuthorizationHeader
18
+ expect(authors_response).to respond_to :authors
19
+ end
20
+
21
+ it 'should display information for existing help method' do
22
+ help_response = PWN::SAST::HTTPAuthorizationHeader
23
+ expect(help_response).to respond_to :help
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.402
4
+ version: 0.4.405
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-06 00:00:00.000000000 Z
11
+ date: 2022-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 2.3.10
117
+ version: 2.3.11
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 2.3.10
124
+ version: 2.3.11
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bundler-audit
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.8.1
167
+ - !ruby/object:Gem::Dependency
168
+ name: credit_card_validations
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '='
172
+ - !ruby/object:Gem::Version
173
+ version: 5.0.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '='
179
+ - !ruby/object:Gem::Version
180
+ version: 5.0.0
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: faye-websocket
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -408,14 +422,14 @@ dependencies:
408
422
  requirements:
409
423
  - - '='
410
424
  - !ruby/object:Gem::Version
411
- version: 1.13.3
425
+ version: 1.13.4
412
426
  type: :runtime
413
427
  prerelease: false
414
428
  version_requirements: !ruby/object:Gem::Requirement
415
429
  requirements:
416
430
  - - '='
417
431
  - !ruby/object:Gem::Version
418
- version: 1.13.3
432
+ version: 1.13.4
419
433
  - !ruby/object:Gem::Dependency
420
434
  name: oily_png
421
435
  requirement: !ruby/object:Gem::Requirement
@@ -646,14 +660,14 @@ dependencies:
646
660
  requirements:
647
661
  - - '='
648
662
  - !ruby/object:Gem::Version
649
- version: 1.26.1
663
+ version: 1.27.0
650
664
  type: :runtime
651
665
  prerelease: false
652
666
  version_requirements: !ruby/object:Gem::Requirement
653
667
  requirements:
654
668
  - - '='
655
669
  - !ruby/object:Gem::Version
656
- version: 1.26.1
670
+ version: 1.27.0
657
671
  - !ruby/object:Gem::Dependency
658
672
  name: rubocop-rake
659
673
  requirement: !ruby/object:Gem::Requirement
@@ -934,6 +948,20 @@ dependencies:
934
948
  - - '='
935
949
  - !ruby/object:Gem::Version
936
950
  version: 2.1.0
951
+ - !ruby/object:Gem::Dependency
952
+ name: yard
953
+ requirement: !ruby/object:Gem::Requirement
954
+ requirements:
955
+ - - '='
956
+ - !ruby/object:Gem::Version
957
+ version: 0.9.27
958
+ type: :runtime
959
+ prerelease: false
960
+ version_requirements: !ruby/object:Gem::Requirement
961
+ requirements:
962
+ - - '='
963
+ - !ruby/object:Gem::Version
964
+ version: 0.9.27
937
965
  description: https://github.com/0dayinc/pwn/README.md
938
966
  email:
939
967
  - request.pentest@0dayinc.com
@@ -1532,6 +1560,7 @@ files:
1532
1560
  - lib/pwn/sast/eval.rb
1533
1561
  - lib/pwn/sast/factory.rb
1534
1562
  - lib/pwn/sast/file_permission.rb
1563
+ - lib/pwn/sast/http_authorization_header.rb
1535
1564
  - lib/pwn/sast/inner_html.rb
1536
1565
  - lib/pwn/sast/keystore.rb
1537
1566
  - lib/pwn/sast/location_hash.rb
@@ -1825,6 +1854,7 @@ files:
1825
1854
  - spec/lib/pwn/sast/eval_spec.rb
1826
1855
  - spec/lib/pwn/sast/factory_spec.rb
1827
1856
  - spec/lib/pwn/sast/file_permission_spec.rb
1857
+ - spec/lib/pwn/sast/http_authorization_header_spec.rb
1828
1858
  - spec/lib/pwn/sast/inner_html_spec.rb
1829
1859
  - spec/lib/pwn/sast/keystore_spec.rb
1830
1860
  - spec/lib/pwn/sast/location_hash_spec.rb
@@ -1920,7 +1950,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1920
1950
  - !ruby/object:Gem::Version
1921
1951
  version: '0'
1922
1952
  requirements: []
1923
- rubygems_version: 3.3.10
1953
+ rubygems_version: 3.3.11
1924
1954
  signing_key:
1925
1955
  specification_version: 4
1926
1956
  summary: Automated Security Testing for CI/CD Pipelines & Beyond
@@ -2092,6 +2122,7 @@ test_files:
2092
2122
  - spec/lib/pwn/sast/eval_spec.rb
2093
2123
  - spec/lib/pwn/sast/factory_spec.rb
2094
2124
  - spec/lib/pwn/sast/file_permission_spec.rb
2125
+ - spec/lib/pwn/sast/http_authorization_header_spec.rb
2095
2126
  - spec/lib/pwn/sast/inner_html_spec.rb
2096
2127
  - spec/lib/pwn/sast/keystore_spec.rb
2097
2128
  - spec/lib/pwn/sast/location_hash_spec.rb