pwn 0.5.443 → 0.5.444
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 +3 -3
- data/bin/pwn_sast +1 -0
- data/lib/pwn/plugins/file_fu.rb +20 -22
- data/lib/pwn/sast/amqp_connect_as_guest.rb +0 -2
- data/lib/pwn/sast/apache_file_system_util_api.rb +0 -2
- data/lib/pwn/sast/aws.rb +0 -2
- data/lib/pwn/sast/banned_function_calls_c.rb +3 -2
- data/lib/pwn/sast/base64.rb +1 -3
- data/lib/pwn/sast/beef_hook.rb +0 -2
- data/lib/pwn/sast/cmd_execution_go_lang.rb +83 -0
- data/lib/pwn/sast/cmd_execution_java.rb +3 -2
- data/lib/pwn/sast/cmd_execution_python.rb +3 -2
- data/lib/pwn/sast/cmd_execution_ruby.rb +3 -2
- data/lib/pwn/sast/cmd_execution_scala.rb +3 -2
- data/lib/pwn/sast/csrf.rb +0 -2
- data/lib/pwn/sast/deserial_java.rb +3 -2
- data/lib/pwn/sast/emoticon.rb +0 -2
- data/lib/pwn/sast/eval.rb +0 -2
- data/lib/pwn/sast/factory.rb +2 -2
- data/lib/pwn/sast/http_authorization_header.rb +0 -2
- data/lib/pwn/sast/inner_html.rb +0 -2
- data/lib/pwn/sast/keystore.rb +0 -2
- data/lib/pwn/sast/local_storage.rb +0 -2
- data/lib/pwn/sast/location_hash.rb +0 -2
- data/lib/pwn/sast/log4j.rb +3 -2
- data/lib/pwn/sast/logger.rb +0 -2
- data/lib/pwn/sast/md5.rb +0 -2
- data/lib/pwn/sast/outer_html.rb +0 -2
- data/lib/pwn/sast/padding_oracle.rb +0 -2
- data/lib/pwn/sast/password.rb +0 -2
- data/lib/pwn/sast/php_input_mechanisms.rb +3 -2
- data/lib/pwn/sast/php_type_juggling.rb +3 -2
- data/lib/pwn/sast/pom_version.rb +0 -2
- data/lib/pwn/sast/port.rb +0 -2
- data/lib/pwn/sast/post_message.rb +0 -2
- data/lib/pwn/sast/private_key.rb +0 -2
- data/lib/pwn/sast/redirect.rb +0 -2
- data/lib/pwn/sast/redos.rb +0 -2
- data/lib/pwn/sast/shell.rb +0 -2
- data/lib/pwn/sast/signature.rb +0 -2
- data/lib/pwn/sast/sql.rb +0 -2
- data/lib/pwn/sast/ssl.rb +0 -2
- data/lib/pwn/sast/sudo.rb +0 -2
- data/lib/pwn/sast/task_tag.rb +0 -2
- data/lib/pwn/sast/test_case_engine.rb +45 -4
- data/lib/pwn/sast/throw_errors.rb +0 -2
- data/lib/pwn/sast/token.rb +0 -2
- data/lib/pwn/sast/type_script_type_juggling.rb +3 -2
- data/lib/pwn/sast/version.rb +0 -2
- data/lib/pwn/sast/window_location_hash.rb +0 -2
- data/lib/pwn/sast.rb +1 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/sast/cmd_execution_go_lang_spec.rb +25 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec6df63c1b99b28c53063a7a55160e3daf1b961fb5c9c65b13e522bb1011f54d
|
4
|
+
data.tar.gz: 384514b0c8e2fe6d11696a55e5e9fc04a3cf5af85218b6643a2009401da50188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 679c8b0262e600ae206e713ceec79d60de9ce91bf39b0eebb420c76316fd0cb7816a9bf96390bf5545e5c6063697809354fb52aa55aad962cd0b2c9c5373d123
|
7
|
+
data.tar.gz: f14604cb417bd26b745a4c311ed8614cc8ec3f13e07f622497efbb4037fda26ed767dc017ff2fa1e92eee4f47a731d4646ea76e05cf05628d4377a23e7cef460
|
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.
|
40
|
+
pwn[v0.5.444]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
55
|
+
pwn[v0.5.444]: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.
|
65
|
+
pwn[v0.5.444]: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:
|
data/bin/pwn_sast
CHANGED
data/lib/pwn/plugins/file_fu.rb
CHANGED
@@ -14,7 +14,9 @@ module PWN
|
|
14
14
|
module FileFu
|
15
15
|
# Supported Method Parameters::
|
16
16
|
# PWN::Plugins::FileFu.recurse_in_dir(
|
17
|
-
# dir_path: 'optional path to dir defaults to .'
|
17
|
+
# dir_path: 'optional path to dir defaults to .',
|
18
|
+
# include_extensions: 'optional - array of file extensions to search for in scan (e.g. ['.js', '.php'])',
|
19
|
+
# exclude_extensions: 'optional - array of file extensions to exclude from scan (e.g. ['.log', '.txt', '.spec'])'
|
18
20
|
# )
|
19
21
|
|
20
22
|
public_class_method def self.recurse_in_dir(opts = {})
|
@@ -22,32 +24,24 @@ module PWN
|
|
22
24
|
dir_path = dir_path.to_s.scrub unless dir_path.is_a?(String)
|
23
25
|
raise "PWN Error: Invalid Directory #{dir_path}" unless Dir.exist?(dir_path)
|
24
26
|
|
27
|
+
include_extensions = opts[:include_extensions] ||= []
|
28
|
+
exclude_extensions = opts[:exclude_extensions] ||= []
|
29
|
+
|
25
30
|
previous_dir = Dir.pwd
|
26
31
|
Dir.chdir(dir_path)
|
27
32
|
# Execute this like this:
|
28
33
|
# recurse_in_dir(:dir_path => 'path to dir') {|entry| puts entry}
|
29
|
-
Dir.glob('./**/*').each
|
30
|
-
|
31
|
-
raise e
|
32
|
-
ensure
|
33
|
-
Dir.chdir(previous_dir) if Dir.exist?(previous_dir)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Supported Method Parameters::
|
37
|
-
# PWN::Plugins::FileFu.recurse_dir(
|
38
|
-
# dir_path: 'optional path to dir defaults to .'
|
39
|
-
# )
|
34
|
+
Dir.glob('./**/*').each do |entry|
|
35
|
+
next if exclude_extensions.include?(File.extname(entry))
|
40
36
|
|
41
|
-
|
42
|
-
dir_path = opts[:dir_path] ||= '.'
|
43
|
-
dir_path = dir_path.to_s.scrub unless dir_path.is_a?(String)
|
44
|
-
raise "PWN Error: Invalid Directory #{dir_path}" unless Dir.exist?(dir_path)
|
37
|
+
next unless include_extensions.empty? || include_extensions.include?(File.extname(entry))
|
45
38
|
|
46
|
-
|
47
|
-
|
48
|
-
Dir.glob("#{dir_path}/**/*").each { |entry| yield Shellwords.escape(entry) }
|
39
|
+
yield Shellwords.escape(entry)
|
40
|
+
end
|
49
41
|
rescue StandardError => e
|
50
42
|
raise e
|
43
|
+
ensure
|
44
|
+
Dir.chdir(previous_dir) if Dir.exist?(previous_dir)
|
51
45
|
end
|
52
46
|
|
53
47
|
# Supported Method Parameters::
|
@@ -78,9 +72,13 @@ module PWN
|
|
78
72
|
|
79
73
|
public_class_method def self.help
|
80
74
|
puts "USAGE:
|
81
|
-
#{self}.recurse_in_dir(
|
82
|
-
|
83
|
-
|
75
|
+
#{self}.recurse_in_dir(
|
76
|
+
dir_path: 'optional path to dir defaults to .',
|
77
|
+
include_extensions: 'optional - array of file extensions to search for in scan (e.g. ['.js', '.php'])',
|
78
|
+
exclude_extensions: 'optional - array of file extensions to exclude from scan (e.g. ['.log', '.txt', '.spec'])'
|
79
|
+
) do |entry|
|
80
|
+
puts entry
|
81
|
+
end
|
84
82
|
|
85
83
|
#{self}.untar_gz_file(
|
86
84
|
tar_gz_file: 'required - path to .tar.gz file',
|
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# within source code to determine if connections to RabbitMQ servers
|
10
10
|
# are using guest accounts.
|
11
11
|
module AMQPConnectAsGuest
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::AMQPConnectAsGuest.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify arbitrary command execution
|
9
9
|
# within Apache Common's API Class, org.apache.commons.io.FileSystemUtils
|
10
10
|
module ApacheFileSystemUtilAPI
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::ApacheFileSystemUtilAPI.scan(
|
15
13
|
# :dir_path => 'optional path to dir defaults to .'
|
data/lib/pwn/sast/aws.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# calls in C & C++ code per:
|
10
10
|
# https://msdn.microsoft.com/en-us/library/bb288454.aspx
|
11
11
|
module BannedFunctionCallsC
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::BannedFunctionCallsC.scan(
|
16
14
|
# :dir_path => 'optional path to dir defaults to .'
|
@@ -154,10 +152,13 @@ module PWN
|
|
154
152
|
-e 'wmemcpy' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
155
153
|
"
|
156
154
|
|
155
|
+
include_extensions = %w[.c .cats .idc .cpp .cc .cxx .c++ .cp .CPP .C .cppm .ixx .h .hpp .hxx .hh .h++ .inc .inl .ipp .tcc .tpp .txx .i .s .asm .o .obj .a .so .lib .dll .exe .pdb .vcxproj .sln .dsp .dsw .cbp .cmake .make .mk]
|
156
|
+
|
157
157
|
PWN::SAST::TestCaseEngine.execute(
|
158
158
|
test_case_filter: test_case_filter,
|
159
159
|
security_references: security_references,
|
160
160
|
dir_path: dir_path,
|
161
|
+
include_extensions: include_extensions,
|
161
162
|
git_repo_root_uri: git_repo_root_uri
|
162
163
|
)
|
163
164
|
rescue StandardError => e
|
data/lib/pwn/sast/base64.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify Base64 encoded strings
|
9
9
|
# that may have sensitive artifacts when decoded.
|
10
10
|
module Base64
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Base64.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -23,7 +21,7 @@ module PWN
|
|
23
21
|
test_case_filter = "
|
24
22
|
grep -Ein \
|
25
23
|
-e 'BASE64' \
|
26
|
-
-e '^[A-Za-z0-9+/]{4}([A-Za-z0-9+/]{4})*
|
24
|
+
-e '^[A-Za-z0-9+/]{12}([A-Za-z0-9+/]{4})*$|^[A-Za-z0-9+/]{8}([A-Za-z0-9+/]{4})*[A-Za-z0-9+/]{2}==$|^[A-Za-z0-9+/]{8}([A-Za-z0-9+/]{4})*[A-Za-z0-9+/]{3}=$' \
|
27
25
|
{PWN_SAST_SRC_TARGET} 2> /dev/null
|
28
26
|
"
|
29
27
|
|
data/lib/pwn/sast/beef_hook.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to detect if the default BeEF
|
9
9
|
# exploitation hooks reside within source code.
|
10
10
|
module BeefHook
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::BeefHook.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'socket'
|
5
|
+
|
6
|
+
module PWN
|
7
|
+
module SAST
|
8
|
+
# SAST Module used to identify command
|
9
|
+
# execution residing within GoLang source code.
|
10
|
+
module CmdExecutionGoLang
|
11
|
+
# Supported Method Parameters::
|
12
|
+
# PWN::SAST::CmdExecutionGoLang.scan(
|
13
|
+
# dir_path: 'optional path to dir defaults to .'
|
14
|
+
# git_repo_root_uri: 'optional http uri of git repo scanned'
|
15
|
+
# )
|
16
|
+
|
17
|
+
public_class_method def self.scan(opts = {})
|
18
|
+
dir_path = opts[:dir_path]
|
19
|
+
git_repo_root_uri = opts[:git_repo_root_uri].to_s.scrub
|
20
|
+
|
21
|
+
test_case_filter = "
|
22
|
+
grep -Fn \
|
23
|
+
-e 'exec.Command(' \
|
24
|
+
-e 'exec.CommandContext(' \
|
25
|
+
-e 'Cmd.CombinedOutput(' \
|
26
|
+
-e 'Cmd.Output(' \
|
27
|
+
-e 'Cmd.Run(' \
|
28
|
+
-e 'Cmd.Start(' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
29
|
+
"
|
30
|
+
|
31
|
+
include_extensions = %w[.go .s .o .a .mod]
|
32
|
+
|
33
|
+
PWN::SAST::TestCaseEngine.execute(
|
34
|
+
test_case_filter: test_case_filter,
|
35
|
+
security_references: security_references,
|
36
|
+
dir_path: dir_path,
|
37
|
+
include_extensions: include_extensions,
|
38
|
+
git_repo_root_uri: git_repo_root_uri
|
39
|
+
)
|
40
|
+
rescue StandardError => e
|
41
|
+
raise e
|
42
|
+
end
|
43
|
+
|
44
|
+
# Used primarily to map NIST 800-53 Revision 4 Security Controls
|
45
|
+
# https://web.nvd.nist.gov/view/800-53/Rev4/impact?impactName=HIGH
|
46
|
+
# to PWN Exploit & Static Code Anti-Pattern Matching Modules to
|
47
|
+
# Determine the level of Testing Coverage w/ PWN.
|
48
|
+
|
49
|
+
public_class_method def self.security_references
|
50
|
+
{
|
51
|
+
sast_module: self,
|
52
|
+
section: 'INFORMATION INPUT VALIDATION',
|
53
|
+
nist_800_53_uri: 'https://csrc.nist.gov/projects/cprt/catalog#/cprt/framework/version/SP_800_53_5_1_1/home?element=SI-10',
|
54
|
+
cwe_id: '78',
|
55
|
+
cwe_uri: 'https://cwe.mitre.org/data/definitions/78.html'
|
56
|
+
}
|
57
|
+
rescue StandardError => e
|
58
|
+
raise e
|
59
|
+
end
|
60
|
+
|
61
|
+
# Author(s):: 0day Inc. <support@0dayinc.com>
|
62
|
+
|
63
|
+
public_class_method def self.authors
|
64
|
+
"AUTHOR(S):
|
65
|
+
0day Inc. <support@0dayinc.com>
|
66
|
+
"
|
67
|
+
end
|
68
|
+
|
69
|
+
# Display Usage for this Module
|
70
|
+
|
71
|
+
public_class_method def self.help
|
72
|
+
puts "USAGE:
|
73
|
+
sast_arr = #{self}.scan(
|
74
|
+
:dir_path => 'optional path to dir defaults to .',
|
75
|
+
:git_repo_root_uri => 'optional http uri of git repo scanned'
|
76
|
+
)
|
77
|
+
|
78
|
+
#{self}.authors
|
79
|
+
"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify command
|
9
9
|
# execution residing within Java source code.
|
10
10
|
module CmdExecutionJava
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::CmdExecutionJava.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -27,10 +25,13 @@ module PWN
|
|
27
25
|
-e '.exec(' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
28
26
|
"
|
29
27
|
|
28
|
+
include_extensions = %w[.java .class .jar .war .ear .nar .properties .aj .jsp .jspx .jstm .jsptml .jnlp .jad .ser .gsp]
|
29
|
+
|
30
30
|
PWN::SAST::TestCaseEngine.execute(
|
31
31
|
test_case_filter: test_case_filter,
|
32
32
|
security_references: security_references,
|
33
33
|
dir_path: dir_path,
|
34
|
+
include_extensions: include_extensions,
|
34
35
|
git_repo_root_uri: git_repo_root_uri
|
35
36
|
)
|
36
37
|
rescue StandardError => e
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify command execution
|
9
9
|
# residing within Python source code.
|
10
10
|
module CmdExecutionPython
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::CmdExecutionPython.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -29,10 +27,13 @@ module PWN
|
|
29
27
|
-e 'subprocess.Popen' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
30
28
|
"
|
31
29
|
|
30
|
+
include_extensions = %w[.py .pyc .pyd .pyo .pyw .pyi .pyx .pxd .ipynb .pyz .whl .egg .pth]
|
31
|
+
|
32
32
|
PWN::SAST::TestCaseEngine.execute(
|
33
33
|
test_case_filter: test_case_filter,
|
34
34
|
security_references: security_references,
|
35
35
|
dir_path: dir_path,
|
36
|
+
include_extensions: include_extensions,
|
36
37
|
git_repo_root_uri: git_repo_root_uri
|
37
38
|
)
|
38
39
|
rescue StandardError => e
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify command
|
9
9
|
# execution residing within Ruby source code.
|
10
10
|
module CmdExecutionRuby
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::CmdExecutionRuby(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -37,10 +35,13 @@ module PWN
|
|
37
35
|
-e '%x' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
38
36
|
"
|
39
37
|
|
38
|
+
include_extensions = %w[.rb .erb .rhtml .rake .gemspec .gem .ru .bundle]
|
39
|
+
|
40
40
|
PWN::SAST::TestCaseEngine.execute(
|
41
41
|
test_case_filter: test_case_filter,
|
42
42
|
security_references: security_references,
|
43
43
|
dir_path: dir_path,
|
44
|
+
include_extensions: include_extensions,
|
44
45
|
git_repo_root_uri: git_repo_root_uri
|
45
46
|
)
|
46
47
|
rescue StandardError => e
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify command
|
9
9
|
# execution residing within scala source code.
|
10
10
|
module CmdExecutionScala
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::CmdExecutionScala.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -27,10 +25,13 @@ module PWN
|
|
27
25
|
-e '.!!' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
28
26
|
"
|
29
27
|
|
28
|
+
include_extensions = %w[.scala .sc .sbt .class .jar .war .tasty .scala.html .scala.js .scala.txt .properties]
|
29
|
+
|
30
30
|
PWN::SAST::TestCaseEngine.execute(
|
31
31
|
test_case_filter: test_case_filter,
|
32
32
|
security_references: security_references,
|
33
33
|
dir_path: dir_path,
|
34
|
+
include_extensions: include_extensions,
|
34
35
|
git_repo_root_uri: git_repo_root_uri
|
35
36
|
)
|
36
37
|
rescue StandardError => e
|
data/lib/pwn/sast/csrf.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# CSRF protection. If nothing appears in the report,
|
10
10
|
# this may be an indicator of NO CSRF protection.
|
11
11
|
module CSRF
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::CSRF.scan(
|
16
14
|
# :dir_path => 'optional path to dir defaults to .'
|
@@ -10,8 +10,6 @@ module PWN
|
|
10
10
|
# For more information see:
|
11
11
|
# https://cheatsheetseries.owasp.org/cheatsheets/Deserialization_Cheat_Sheet.html
|
12
12
|
module DeserialJava
|
13
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
14
|
-
|
15
13
|
# Supported Method Parameters::
|
16
14
|
# PWN::SAST::DeserialJava.scan(
|
17
15
|
# :dir_path => 'optional path to dir defaults to .'
|
@@ -34,10 +32,13 @@ module PWN
|
|
34
32
|
-e Serializable {PWN_SAST_SRC_TARGET} 2> /dev/null
|
35
33
|
"
|
36
34
|
|
35
|
+
include_extensions = %w[.java .class .jar .war .ear .nar .properties .aj .jsp .jspx .jstm .jsptml .jnlp .jad .ser .gsp]
|
36
|
+
|
37
37
|
PWN::SAST::TestCaseEngine.execute(
|
38
38
|
test_case_filter: test_case_filter,
|
39
39
|
security_references: security_references,
|
40
40
|
dir_path: dir_path,
|
41
|
+
include_extensions: include_extensions,
|
41
42
|
git_repo_root_uri: git_repo_root_uri
|
42
43
|
)
|
43
44
|
end
|
data/lib/pwn/sast/emoticon.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify portions of
|
9
9
|
# code marked by developers as interesting for whatever reason.
|
10
10
|
module Emoticon
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Emoticon.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/eval.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if arbitrary command/code execution is possible
|
11
11
|
module Eval
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::Eval.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/factory.rb
CHANGED
@@ -10,8 +10,6 @@ module PWN
|
|
10
10
|
# For more information see:
|
11
11
|
# https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
|
12
12
|
module Factory
|
13
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
14
|
-
|
15
13
|
# Supported Method Parameters::
|
16
14
|
# PWN::SAST::Factory.scan(
|
17
15
|
# :dir_path => 'optional path to dir defaults to .'
|
@@ -28,11 +26,13 @@ module PWN
|
|
28
26
|
-e XMLInputFactory \
|
29
27
|
-e SAXParserFactory {PWN_SAST_SRC_TARGET} 2> /dev/null
|
30
28
|
"
|
29
|
+
include_extensions = %w[.java .class .jar .war .ear .nar .properties .aj .jsp .jspx .jstm .jsptml .jnlp .jad .ser .gsp]
|
31
30
|
|
32
31
|
PWN::SAST::TestCaseEngine.execute(
|
33
32
|
test_case_filter: test_case_filter,
|
34
33
|
security_references: security_references,
|
35
34
|
dir_path: dir_path,
|
35
|
+
include_extensions: include_extensions,
|
36
36
|
git_repo_root_uri: git_repo_root_uri
|
37
37
|
)
|
38
38
|
end
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify hard-code/plain-text
|
9
9
|
# passwords within source code.
|
10
10
|
module HTTPAuthorizationHeader
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::HTTPAuthorizationHeader.scan(
|
15
13
|
# :dir_path => 'optional path to dir defaults to .'
|
data/lib/pwn/sast/inner_html.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if XSS is possible
|
11
11
|
module InnerHTML
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::InnerHTML.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/keystore.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify weak
|
9
9
|
# passwords/configurations around key stores.
|
10
10
|
module Keystore
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Keystore.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if XSS is possible
|
11
11
|
module LocalStorage
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::LocalStorage.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if XSS is possible
|
11
11
|
module LocationHash
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::LocationHash.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/log4j.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify command
|
9
9
|
# execution residing within Java source code.
|
10
10
|
module Log4J
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Log4J.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -25,10 +23,13 @@ module PWN
|
|
25
23
|
-e 'log4j' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
26
24
|
"
|
27
25
|
|
26
|
+
include_extensions = %w[.java .class .jar .war .ear .nar .properties .aj .jsp .jspx .jstm .jsptml .jnlp .jad .ser .gsp]
|
27
|
+
|
28
28
|
PWN::SAST::TestCaseEngine.execute(
|
29
29
|
test_case_filter: test_case_filter,
|
30
30
|
security_references: security_references,
|
31
31
|
dir_path: dir_path,
|
32
|
+
include_extensions: include_extensions,
|
32
33
|
git_repo_root_uri: git_repo_root_uri
|
33
34
|
)
|
34
35
|
rescue StandardError => e
|
data/lib/pwn/sast/logger.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# artifacts such as passwords, pre-auth tokens, etc are persisted
|
10
10
|
# to log files (which may lead to unauthorized access).
|
11
11
|
module Logger
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::Logger.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/md5.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify MD5 hash related objects, methods, classes, etc.
|
9
9
|
# to determine if deprecated hashing is still supported.
|
10
10
|
module MD5
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::MD5.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/outer_html.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if XSS is possible.
|
11
11
|
module OuterHTML
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::OuterHTML.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -7,8 +7,6 @@ module PWN
|
|
7
7
|
module SAST
|
8
8
|
# SAST Module used to identify padding oracle vulnerabilities involving weak CBC block cipher padding.
|
9
9
|
module PaddingOracle
|
10
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
11
|
-
|
12
10
|
# Supported Method Parameters::
|
13
11
|
# PWN::SAST::PaddingOracle.scan(
|
14
12
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/password.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify hard-code/plain-text
|
9
9
|
# passwords within source code.
|
10
10
|
module Password
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Password.scan(
|
15
13
|
# :dir_path => 'optional path to dir defaults to .'
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify HTTP input
|
9
9
|
# mechanisms that exist in PHP code (e.g. $_REQUEST, $_GET, etc.)
|
10
10
|
module PHPInputMechanisms
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::PHPInputMechanisms.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -31,10 +29,13 @@ module PWN
|
|
31
29
|
-e '$_SESSION' {PWN_SAST_SRC_TARGET} 2> /dev/null
|
32
30
|
"
|
33
31
|
|
32
|
+
include_extensions = %w[.phar .pht .phtm .phtml .php .php2 .php3 .php4 .php5 .php7 .php8 .phps .phpt .pgif .inc]
|
33
|
+
|
34
34
|
PWN::SAST::TestCaseEngine.execute(
|
35
35
|
test_case_filter: test_case_filter,
|
36
36
|
security_references: security_references,
|
37
37
|
dir_path: dir_path,
|
38
|
+
include_extensions: include_extensions,
|
38
39
|
git_repo_root_uri: git_repo_root_uri
|
39
40
|
)
|
40
41
|
rescue StandardError => e
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify loose comparisons
|
9
9
|
# (i.e. == instead of ===) within PHP source code.
|
10
10
|
module PHPTypeJuggling
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::PHPTypeJuggling.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -29,10 +27,13 @@ module PWN
|
|
29
27
|
-e '!=='
|
30
28
|
"
|
31
29
|
|
30
|
+
include_extensions = %w[.phar .pht .phtm .phtml .php .php2 .php3 .php4 .php5 .php7 .php8 .phps .phpt .pgif .inc]
|
31
|
+
|
32
32
|
PWN::SAST::TestCaseEngine.execute(
|
33
33
|
test_case_filter: test_case_filter,
|
34
34
|
security_references: security_references,
|
35
35
|
dir_path: dir_path,
|
36
|
+
include_extensions: include_extensions,
|
36
37
|
git_repo_root_uri: git_repo_root_uri
|
37
38
|
)
|
38
39
|
rescue StandardError => e
|
data/lib/pwn/sast/pom_version.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# of dependent software within source repos to ensure patching
|
10
10
|
# requirements for those dependencies can be met.
|
11
11
|
module PomVersion
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::PomVersion.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/port.rb
CHANGED
@@ -10,8 +10,6 @@ module PWN
|
|
10
10
|
# code to get a sense around appropriate secure network
|
11
11
|
# communications in place.
|
12
12
|
module Port
|
13
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
14
|
-
|
15
13
|
# Supported Method Parameters::
|
16
14
|
# PWN::SAST::Port.scan(
|
17
15
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# declarations within source code in an effort to
|
10
10
|
# determine if XSS is possible
|
11
11
|
module PostMessage
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::PostMessage.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/private_key.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify private keys used for authenticating
|
9
9
|
# with remote hosts.
|
10
10
|
module PrivateKey
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::PrivateKey(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/redirect.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify if applications
|
9
9
|
# allow arbritrary redirects to third-party URLs w/o a whitelist
|
10
10
|
module Redirect
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Redirect.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/redos.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# within source code. For more information, see:
|
10
10
|
# https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS
|
11
11
|
module ReDOS
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::ReDOS.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/shell.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify if application is
|
9
9
|
# shelling-out which may lead to arbitrary command execution
|
10
10
|
module Shell
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Shell.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/signature.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify private keys used for authenticating
|
9
9
|
# with remote hosts.
|
10
10
|
module Signature
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Signature(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/sql.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# reference within source code that may contain SQL to
|
10
10
|
# determine if SQL injeciton is possible.
|
11
11
|
module SQL
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::SQL.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/ssl.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify any SSL/TLS
|
9
9
|
# reference within source code.
|
10
10
|
module SSL
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::SSL.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/sudo.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify if cmd execution and/or
|
9
9
|
# privilege escalation is possible.
|
10
10
|
module Sudo
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Sudo.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/task_tag.rb
CHANGED
@@ -9,8 +9,6 @@ module PWN
|
|
9
9
|
# such as TODO, SECURITY, FIXME, etc to ensure developers
|
10
10
|
# aren't introducing security-related bugs into source code.
|
11
11
|
module TaskTag
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
12
|
# Supported Method Parameters::
|
15
13
|
# PWN::SAST::TaskTag.scan(
|
16
14
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -13,7 +13,9 @@ module PWN
|
|
13
13
|
# PWN::SAST::TestCaseEngine.execute(
|
14
14
|
# test_case_filter: 'required - grep command to filter results',
|
15
15
|
# security_references: 'required - Hash with keys :sast_module, :section, :nist_800_53_uri, :cwe_id, :cwe_uri',
|
16
|
-
# dir_path: 'optional - path to dir defaults to .'
|
16
|
+
# dir_path: 'optional - path to dir defaults to .',
|
17
|
+
# include_extensions: 'optional - array of file extensions to search for in scan (Defaults to all file types / i.e. [])',
|
18
|
+
# exclude_extensions: 'optional - array of file extensions to exclude from scan (Defaults to [.bin, .dat, .JS-BEAUTIFIED, .o, .test, .png, .jpg, .jpeg, .gif, .svg, .ico, .so, .spec, .zip, .tar, .gz, .tgz, .7z, .mp3, .mp4, .mov, .avi, .wmv, .flv, .mkv])',
|
17
19
|
# git_repo_root_uri: 'optional - http uri of git repo scanned'
|
18
20
|
# )
|
19
21
|
|
@@ -25,14 +27,51 @@ module PWN
|
|
25
27
|
raise 'ERROR: security_references must be a Hash' unless security_references.is_a?(Hash)
|
26
28
|
|
27
29
|
dir_path = opts[:dir_path] ||= '.'
|
30
|
+
include_extensions = opts[:include_extensions] ||= []
|
31
|
+
exclude_extensions = opts[:exclude_extentions] ||= %w[
|
32
|
+
.7z
|
33
|
+
.avi
|
34
|
+
.bin
|
35
|
+
.dat
|
36
|
+
.dll
|
37
|
+
.flv
|
38
|
+
.gif
|
39
|
+
.gz
|
40
|
+
.ico
|
41
|
+
.jpg
|
42
|
+
.jpeg
|
43
|
+
.JS-BEAUTIFIED
|
44
|
+
.markdown
|
45
|
+
.md
|
46
|
+
.mkv
|
47
|
+
.mov
|
48
|
+
.mp3
|
49
|
+
.mp4
|
50
|
+
.o
|
51
|
+
.png
|
52
|
+
.svg
|
53
|
+
.test
|
54
|
+
.so
|
55
|
+
.spec
|
56
|
+
.tar
|
57
|
+
.tgz
|
58
|
+
.webm
|
59
|
+
.wmv
|
60
|
+
.zip
|
61
|
+
]
|
62
|
+
|
28
63
|
git_repo_root_uri = opts[:git_repo_root_uri].to_s.scrub
|
29
64
|
|
30
65
|
result_arr = []
|
31
66
|
ai_introspection = PWN::Env[:ai][:introspection]
|
32
67
|
logger_results = "AI Introspection => #{ai_introspection} => "
|
33
68
|
|
34
|
-
PWN::Plugins::FileFu.recurse_in_dir(
|
35
|
-
|
69
|
+
PWN::Plugins::FileFu.recurse_in_dir(
|
70
|
+
dir_path: dir_path,
|
71
|
+
include_extensions: include_extensions,
|
72
|
+
exclude_extensions: exclude_extensions
|
73
|
+
) do |entry|
|
74
|
+
if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && entry !~ /test/i
|
36
75
|
line_no_and_contents_arr = []
|
37
76
|
entry_beautified = false
|
38
77
|
|
@@ -58,7 +97,7 @@ module PWN
|
|
58
97
|
filename: { git_repo_root_uri: git_repo_root_uri, entry: entry },
|
59
98
|
line_no_and_contents: '',
|
60
99
|
raw_content: str,
|
61
|
-
test_case_filter:
|
100
|
+
test_case_filter: this_test_case_filter
|
62
101
|
}
|
63
102
|
|
64
103
|
# COMMMENT: Must be a better way to implement this (regex is kinda funky)
|
@@ -136,6 +175,8 @@ module PWN
|
|
136
175
|
test_case_filter: 'required grep command to filter results',
|
137
176
|
security_references: 'required Hash with keys :sast_module, :section, :nist_800_53_uri, :cwe_id, :cwe_uri',
|
138
177
|
dir_path: 'optional path to dir defaults to .',
|
178
|
+
include_extensions: 'optional array of file extensions to search for in scan (Defaults to all file types / i.e. [])',
|
179
|
+
exclude_extensions: 'optional array of file extensions to exclude from scan (Defaults to [.bin, .dat, .JS-BEAUTIFIED, .o, .test, .png, .jpg, .jpeg, .gif, .svg, .ico, .so, .spec, .zip, .tar, .gz, .tgz, .7z, .mp3, .mp4, .mov, .avi, .wmv, .flv, .mkv])',
|
139
180
|
git_repo_root_uri: 'optional http uri of git repo scanned'
|
140
181
|
)
|
141
182
|
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify whether
|
9
9
|
# error messages are sanitized properly.
|
10
10
|
module ThrowErrors
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::ThrowErrors.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast/token.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify any
|
9
9
|
# reference within source code of authorization tokens.
|
10
10
|
module Token
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Token.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify loose comparisons
|
9
9
|
# (i.e. == instead of ===) within TypeScript source code.
|
10
10
|
module TypeScriptTypeJuggling
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::TypeScriptTypeJuggling.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -29,10 +27,13 @@ module PWN
|
|
29
27
|
-e '!=='
|
30
28
|
"
|
31
29
|
|
30
|
+
include_extensions = %w[.ts .tsx .mts .cts .d.ts .d.mts .d.cts .js .mjs .cjs .map .tsbuildinfo]
|
31
|
+
|
32
32
|
PWN::SAST::TestCaseEngine.execute(
|
33
33
|
test_case_filter: test_case_filter,
|
34
34
|
security_references: security_references,
|
35
35
|
dir_path: dir_path,
|
36
|
+
include_extensions: include_extensions,
|
36
37
|
git_repo_root_uri: git_repo_root_uri
|
37
38
|
)
|
38
39
|
rescue StandardError => e
|
data/lib/pwn/sast/version.rb
CHANGED
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to detect version
|
9
9
|
# information within all files in a source repo
|
10
10
|
module Version
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::Version.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
@@ -8,8 +8,6 @@ module PWN
|
|
8
8
|
# SAST Module used to identify the potential
|
9
9
|
# for DOM-based XSS in the application.
|
10
10
|
module WindowLocationHash
|
11
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
12
|
-
|
13
11
|
# Supported Method Parameters::
|
14
12
|
# PWN::SAST::WindowLocationHash.scan(
|
15
13
|
# dir_path: 'optional path to dir defaults to .'
|
data/lib/pwn/sast.rb
CHANGED
@@ -12,6 +12,7 @@ module PWN
|
|
12
12
|
autoload :BannedFunctionCallsC, 'pwn/sast/banned_function_calls_c'
|
13
13
|
autoload :Base64, 'pwn/sast/base64'
|
14
14
|
autoload :BeefHook, 'pwn/sast/beef_hook'
|
15
|
+
autoload :CmdExecutionGoLang, 'pwn/sast/cmd_execution_go_lang'
|
15
16
|
autoload :CmdExecutionJava, 'pwn/sast/cmd_execution_java'
|
16
17
|
autoload :CmdExecutionPython, 'pwn/sast/cmd_execution_python'
|
17
18
|
autoload :CmdExecutionRuby, 'pwn/sast/cmd_execution_ruby'
|
data/lib/pwn/version.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe PWN::SAST::CmdExecutionGoLang do
|
6
|
+
it 'scan method should exist' do
|
7
|
+
scan_response = PWN::SAST::CmdExecutionGoLang
|
8
|
+
expect(scan_response).to respond_to :scan
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should display information for security_references' do
|
12
|
+
security_references_response = PWN::SAST::CmdExecutionGoLang
|
13
|
+
expect(security_references_response).to respond_to :security_references
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should display information for authors' do
|
17
|
+
authors_response = PWN::SAST::CmdExecutionGoLang
|
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::CmdExecutionGoLang
|
23
|
+
expect(help_response).to respond_to :help
|
24
|
+
end
|
25
|
+
end
|
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.
|
4
|
+
version: 0.5.444
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1921,6 +1921,7 @@ files:
|
|
1921
1921
|
- lib/pwn/sast/banned_function_calls_c.rb
|
1922
1922
|
- lib/pwn/sast/base64.rb
|
1923
1923
|
- lib/pwn/sast/beef_hook.rb
|
1924
|
+
- lib/pwn/sast/cmd_execution_go_lang.rb
|
1924
1925
|
- lib/pwn/sast/cmd_execution_java.rb
|
1925
1926
|
- lib/pwn/sast/cmd_execution_python.rb
|
1926
1927
|
- lib/pwn/sast/cmd_execution_ruby.rb
|
@@ -2271,6 +2272,7 @@ files:
|
|
2271
2272
|
- spec/lib/pwn/sast/banned_function_calls_c_spec.rb
|
2272
2273
|
- spec/lib/pwn/sast/base64_spec.rb
|
2273
2274
|
- spec/lib/pwn/sast/beef_hook_spec.rb
|
2275
|
+
- spec/lib/pwn/sast/cmd_execution_go_lang_spec.rb
|
2274
2276
|
- spec/lib/pwn/sast/cmd_execution_java_spec.rb
|
2275
2277
|
- spec/lib/pwn/sast/cmd_execution_python_spec.rb
|
2276
2278
|
- spec/lib/pwn/sast/cmd_execution_ruby_spec.rb
|