pwn 0.5.378 → 0.5.380

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/bin/pwn_sast +11 -10
  4. data/lib/pwn/plugins/file_fu.rb +27 -6
  5. data/lib/pwn/plugins/git.rb +2 -5
  6. data/lib/pwn/reports/sast.rb +2 -2
  7. data/lib/pwn/sast/amqp_connect_as_guest.rb +5 -8
  8. data/lib/pwn/sast/apache_file_system_util_api.rb +5 -8
  9. data/lib/pwn/sast/aws.rb +5 -8
  10. data/lib/pwn/sast/banned_function_calls_c.rb +5 -8
  11. data/lib/pwn/sast/base64.rb +5 -8
  12. data/lib/pwn/sast/beef_hook.rb +3 -6
  13. data/lib/pwn/sast/cmd_execution_java.rb +3 -6
  14. data/lib/pwn/sast/cmd_execution_python.rb +3 -6
  15. data/lib/pwn/sast/cmd_execution_ruby.rb +3 -6
  16. data/lib/pwn/sast/cmd_execution_scala.rb +3 -6
  17. data/lib/pwn/sast/csrf.rb +3 -6
  18. data/lib/pwn/sast/deserial_java.rb +3 -6
  19. data/lib/pwn/sast/emoticon.rb +3 -6
  20. data/lib/pwn/sast/eval.rb +3 -6
  21. data/lib/pwn/sast/factory.rb +3 -6
  22. data/lib/pwn/sast/http_authorization_header.rb +3 -6
  23. data/lib/pwn/sast/inner_html.rb +3 -6
  24. data/lib/pwn/sast/keystore.rb +3 -6
  25. data/lib/pwn/sast/local_storage.rb +3 -6
  26. data/lib/pwn/sast/location_hash.rb +3 -6
  27. data/lib/pwn/sast/log4j.rb +3 -6
  28. data/lib/pwn/sast/logger.rb +3 -6
  29. data/lib/pwn/sast/md5.rb +3 -6
  30. data/lib/pwn/sast/outer_html.rb +3 -6
  31. data/lib/pwn/sast/padding_oracle.rb +3 -6
  32. data/lib/pwn/sast/password.rb +3 -6
  33. data/lib/pwn/sast/php_input_mechanisms.rb +3 -6
  34. data/lib/pwn/sast/php_type_juggling.rb +3 -6
  35. data/lib/pwn/sast/pom_version.rb +3 -6
  36. data/lib/pwn/sast/port.rb +3 -6
  37. data/lib/pwn/sast/post_message.rb +3 -6
  38. data/lib/pwn/sast/private_key.rb +3 -6
  39. data/lib/pwn/sast/redirect.rb +3 -6
  40. data/lib/pwn/sast/redos.rb +3 -6
  41. data/lib/pwn/sast/shell.rb +3 -6
  42. data/lib/pwn/sast/signature.rb +3 -6
  43. data/lib/pwn/sast/sql.rb +3 -6
  44. data/lib/pwn/sast/ssl.rb +3 -6
  45. data/lib/pwn/sast/sudo.rb +3 -6
  46. data/lib/pwn/sast/task_tag.rb +3 -6
  47. data/lib/pwn/sast/throw_errors.rb +3 -6
  48. data/lib/pwn/sast/token.rb +3 -6
  49. data/lib/pwn/sast/type_script_type_juggling.rb +3 -6
  50. data/lib/pwn/sast/version.rb +3 -6
  51. data/lib/pwn/sast/window_location_hash.rb +3 -6
  52. data/lib/pwn/version.rb +1 -1
  53. metadata +1 -1
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -62,11 +62,8 @@ module PWN
62
62
  while line_no_count > current_count
63
63
  line_no = line_contents_split[current_count]
64
64
  contents = line_contents_split[current_count + 1]
65
- if Dir.exist?("#{dir_path}/.git") ||
66
- Dir.exist?('.git')
67
-
68
- repo_root = dir_path
69
- repo_root = '.' if Dir.exist?('.git')
65
+ if Dir.exist?('.git')
66
+ repo_root = '.'
70
67
 
71
68
  author = PWN::Plugins::Git.get_author(
72
69
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -63,11 +63,8 @@ module PWN
63
63
  while line_no_count > current_count
64
64
  line_no = line_contents_split[current_count]
65
65
  contents = line_contents_split[current_count + 1]
66
- if Dir.exist?("#{dir_path}/.git") ||
67
- Dir.exist?('.git')
68
-
69
- repo_root = dir_path
70
- repo_root = '.' if Dir.exist?('.git')
66
+ if Dir.exist?('.git')
67
+ repo_root = '.'
71
68
 
72
69
  author = PWN::Plugins::Git.get_author(
73
70
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -62,11 +62,8 @@ module PWN
62
62
  while line_no_count > current_count
63
63
  line_no = line_contents_split[current_count]
64
64
  contents = line_contents_split[current_count + 1]
65
- if Dir.exist?("#{dir_path}/.git") ||
66
- Dir.exist?('.git')
67
-
68
- repo_root = dir_path
69
- repo_root = '.' if Dir.exist?('.git')
65
+ if Dir.exist?('.git')
66
+ repo_root = '.'
70
67
 
71
68
  author = PWN::Plugins::Git.get_author(
72
69
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && File.extname(entry) == '.java' && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && (File.extname(entry) == '.scala' || File.extname(entry) == '.java') && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -76,11 +76,8 @@ module PWN
76
76
  while line_no_count > current_count
77
77
  line_no = line_contents_split[current_count]
78
78
  contents = line_contents_split[current_count + 1]
79
- if Dir.exist?("#{dir_path}/.git") ||
80
- Dir.exist?('.git')
81
-
82
- repo_root = dir_path
83
- repo_root = '.' if Dir.exist?('.git')
79
+ if Dir.exist?('.git')
80
+ repo_root = '.'
84
81
 
85
82
  author = PWN::Plugins::Git.get_author(
86
83
  repo_root: repo_root,
data/lib/pwn/sast/md5.rb CHANGED
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -62,11 +62,8 @@ module PWN
62
62
  while line_no_count > current_count
63
63
  line_no = line_contents_split[current_count]
64
64
  contents = line_contents_split[current_count + 1]
65
- if Dir.exist?("#{dir_path}/.git") ||
66
- Dir.exist?('.git')
67
-
68
- repo_root = dir_path
69
- repo_root = '.' if Dir.exist?('.git')
65
+ if Dir.exist?('.git')
66
+ repo_root = '.'
70
67
 
71
68
  author = PWN::Plugins::Git.get_author(
72
69
  repo_root: repo_root,
@@ -20,7 +20,7 @@ module PWN
20
20
  result_arr = []
21
21
  logger_results = ''
22
22
 
23
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
23
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
24
24
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
25
25
  line_no_and_contents_arr = []
26
26
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -65,11 +65,8 @@ module PWN
65
65
  while line_no_count > current_count
66
66
  line_no = line_contents_split[current_count]
67
67
  contents = line_contents_split[current_count + 1]
68
- if Dir.exist?("#{dir_path}/.git") ||
69
- Dir.exist?('.git')
70
-
71
- repo_root = dir_path
72
- repo_root = '.' if Dir.exist?('.git')
68
+ if Dir.exist?('.git')
69
+ repo_root = '.'
73
70
 
74
71
  author = PWN::Plugins::Git.get_author(
75
72
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && File.extname(entry).include?('.php') && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -67,11 +67,8 @@ module PWN
67
67
  while line_no_count > current_count
68
68
  line_no = line_contents_split[current_count]
69
69
  contents = line_contents_split[current_count + 1]
70
- if Dir.exist?("#{dir_path}/.git") ||
71
- Dir.exist?('.git')
72
-
73
- repo_root = dir_path
74
- repo_root = '.' if Dir.exist?('.git')
70
+ if Dir.exist?('.git')
71
+ repo_root = '.'
75
72
 
76
73
  author = PWN::Plugins::Git.get_author(
77
74
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && File.extname(entry).include?('.php') && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -65,11 +65,8 @@ module PWN
65
65
  while line_no_count > current_count
66
66
  line_no = line_contents_split[current_count]
67
67
  contents = line_contents_split[current_count + 1]
68
- if Dir.exist?("#{dir_path}/.git") ||
69
- Dir.exist?('.git')
70
-
71
- repo_root = dir_path
72
- repo_root = '.' if Dir.exist?('.git')
68
+ if Dir.exist?('.git')
69
+ repo_root = '.'
73
70
 
74
71
  author = PWN::Plugins::Git.get_author(
75
72
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) == 'pom.xml' && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -64,11 +64,8 @@ module PWN
64
64
  while line_no_count > current_count
65
65
  line_no = line_contents_split[current_count]
66
66
  contents = line_contents_split[current_count + 1]
67
- if Dir.exist?("#{dir_path}/.git") ||
68
- Dir.exist?('.git')
69
-
70
- repo_root = dir_path
71
- repo_root = '.' if Dir.exist?('.git')
67
+ if Dir.exist?('.git')
68
+ repo_root = '.'
72
69
 
73
70
  author = PWN::Plugins::Git.get_author(
74
71
  repo_root: repo_root,
data/lib/pwn/sast/port.rb CHANGED
@@ -23,7 +23,7 @@ module PWN
23
23
  result_arr = []
24
24
  logger_results = ''
25
25
 
26
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
26
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
27
27
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
28
28
  line_no_and_contents_arr = []
29
29
  entry_beautified = false
@@ -68,11 +68,8 @@ module PWN
68
68
  while line_no_count > current_count
69
69
  line_no = line_contents_split[current_count]
70
70
  contents = line_contents_split[current_count + 1]
71
- if Dir.exist?("#{dir_path}/.git") ||
72
- Dir.exist?('.git')
73
-
74
- repo_root = dir_path
75
- repo_root = '.' if Dir.exist?('.git')
71
+ if Dir.exist?('.git')
72
+ repo_root = '.'
76
73
 
77
74
  author = PWN::Plugins::Git.get_author(
78
75
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -62,11 +62,8 @@ module PWN
62
62
  while line_no_count > current_count
63
63
  line_no = line_contents_split[current_count]
64
64
  contents = line_contents_split[current_count + 1]
65
- if Dir.exist?("#{dir_path}/.git") ||
66
- Dir.exist?('.git')
67
-
68
- repo_root = dir_path
69
- repo_root = '.' if Dir.exist?('.git')
65
+ if Dir.exist?('.git')
66
+ repo_root = '.'
70
67
 
71
68
  author = PWN::Plugins::Git.get_author(
72
69
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -63,11 +63,8 @@ module PWN
63
63
  while line_no_count > current_count
64
64
  line_no = line_contents_split[current_count]
65
65
  contents = line_contents_split[current_count + 1]
66
- if Dir.exist?("#{dir_path}/.git") ||
67
- Dir.exist?('.git')
68
-
69
- repo_root = dir_path
70
- repo_root = '.' if Dir.exist?('.git')
66
+ if Dir.exist?('.git')
67
+ repo_root = '.'
71
68
 
72
69
  author = PWN::Plugins::Git.get_author(
73
70
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -68,11 +68,8 @@ module PWN
68
68
  while line_no_count > current_count
69
69
  line_no = line_contents_split[current_count]
70
70
  contents = line_contents_split[current_count + 1]
71
- if Dir.exist?("#{dir_path}/.git") ||
72
- Dir.exist?('.git')
73
-
74
- repo_root = dir_path
75
- repo_root = '.' if Dir.exist?('.git')
71
+ if Dir.exist?('.git')
72
+ repo_root = '.'
76
73
 
77
74
  author = PWN::Plugins::Git.get_author(
78
75
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -69,11 +69,8 @@ module PWN
69
69
  while line_no_count > current_count
70
70
  line_no = line_contents_split[current_count]
71
71
  contents = line_contents_split[current_count + 1]
72
- if Dir.exist?("#{dir_path}/.git") ||
73
- Dir.exist?('.git')
74
-
75
- repo_root = dir_path
76
- repo_root = '.' if Dir.exist?('.git')
72
+ if Dir.exist?('.git')
73
+ repo_root = '.'
77
74
 
78
75
  author = PWN::Plugins::Git.get_author(
79
76
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
data/lib/pwn/sast/sql.rb CHANGED
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -65,11 +65,8 @@ module PWN
65
65
  while line_no_count > current_count
66
66
  line_no = line_contents_split[current_count]
67
67
  contents = line_contents_split[current_count + 1]
68
- if Dir.exist?("#{dir_path}/.git") ||
69
- Dir.exist?('.git')
70
-
71
- repo_root = dir_path
72
- repo_root = '.' if Dir.exist?('.git')
68
+ if Dir.exist?('.git')
69
+ repo_root = '.'
73
70
 
74
71
  author = PWN::Plugins::Git.get_author(
75
72
  repo_root: repo_root,
data/lib/pwn/sast/ssl.rb CHANGED
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -65,11 +65,8 @@ module PWN
65
65
  while line_no_count > current_count
66
66
  line_no = line_contents_split[current_count]
67
67
  contents = line_contents_split[current_count + 1]
68
- if Dir.exist?("#{dir_path}/.git") ||
69
- Dir.exist?('.git')
70
-
71
- repo_root = dir_path
72
- repo_root = '.' if Dir.exist?('.git')
68
+ if Dir.exist?('.git')
69
+ repo_root = '.'
73
70
 
74
71
  author = PWN::Plugins::Git.get_author(
75
72
  repo_root: repo_root,
data/lib/pwn/sast/sudo.rb CHANGED
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -61,11 +61,8 @@ module PWN
61
61
  while line_no_count > current_count
62
62
  line_no = line_contents_split[current_count]
63
63
  contents = line_contents_split[current_count + 1]
64
- if Dir.exist?("#{dir_path}/.git") ||
65
- Dir.exist?('.git')
66
-
67
- repo_root = dir_path
68
- repo_root = '.' if Dir.exist?('.git')
64
+ if Dir.exist?('.git')
65
+ repo_root = '.'
69
66
 
70
67
  author = PWN::Plugins::Git.get_author(
71
68
  repo_root: repo_root,
@@ -22,7 +22,7 @@ module PWN
22
22
  result_arr = []
23
23
  logger_results = ''
24
24
 
25
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
25
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
26
26
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
27
27
  line_no_and_contents_arr = []
28
28
  entry_beautified = false
@@ -75,11 +75,8 @@ module PWN
75
75
  while line_no_count > current_count
76
76
  line_no = line_contents_split[current_count]
77
77
  contents = line_contents_split[current_count + 1]
78
- if Dir.exist?("#{dir_path}/.git") ||
79
- Dir.exist?('.git')
80
-
81
- repo_root = dir_path
82
- repo_root = '.' if Dir.exist?('.git')
78
+ if Dir.exist?('.git')
79
+ repo_root = '.'
83
80
 
84
81
  author = PWN::Plugins::Git.get_author(
85
82
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && (File.extname(entry) == '.scala' || File.extname(entry) == '.java') && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -62,11 +62,8 @@ module PWN
62
62
  while line_no_count > current_count
63
63
  line_no = line_contents_split[current_count]
64
64
  contents = line_contents_split[current_count + 1]
65
- if Dir.exist?("#{dir_path}/.git") ||
66
- Dir.exist?('.git')
67
-
68
- repo_root = dir_path
69
- repo_root = '.' if Dir.exist?('.git')
65
+ if Dir.exist?('.git')
66
+ repo_root = '.'
70
67
 
71
68
  author = PWN::Plugins::Git.get_author(
72
69
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/ && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -63,11 +63,8 @@ module PWN
63
63
  while line_no_count > current_count
64
64
  line_no = line_contents_split[current_count]
65
65
  contents = line_contents_split[current_count + 1]
66
- if Dir.exist?("#{dir_path}/.git") ||
67
- Dir.exist?('.git')
68
-
69
- repo_root = dir_path
70
- repo_root = '.' if Dir.exist?('.git')
66
+ if Dir.exist?('.git')
67
+ repo_root = '.'
71
68
 
72
69
  author = PWN::Plugins::Git.get_author(
73
70
  repo_root: repo_root,
@@ -21,7 +21,7 @@ module PWN
21
21
  result_arr = []
22
22
  logger_results = ''
23
23
 
24
- PWN::Plugins::FileFu.recurse_dir(dir_path: dir_path) do |entry|
24
+ PWN::Plugins::FileFu.recurse_in_dir(dir_path: dir_path) do |entry|
25
25
  if (File.file?(entry) && File.basename(entry) !~ /^pwn.+(html|json|db)$/ && File.basename(entry) !~ /\.JS-BEAUTIFIED$/) && File.extname(entry).include?('.ts') && entry !~ /test/i
26
26
  line_no_and_contents_arr = []
27
27
  entry_beautified = false
@@ -65,11 +65,8 @@ module PWN
65
65
  while line_no_count > current_count
66
66
  line_no = line_contents_split[current_count]
67
67
  contents = line_contents_split[current_count + 1]
68
- if Dir.exist?("#{dir_path}/.git") ||
69
- Dir.exist?('.git')
70
-
71
- repo_root = dir_path
72
- repo_root = '.' if Dir.exist?('.git')
68
+ if Dir.exist?('.git')
69
+ repo_root = '.'
73
70
 
74
71
  author = PWN::Plugins::Git.get_author(
75
72
  repo_root: repo_root,