Skip to content

Commit b71bd1d

Browse files
authored
Update azure.rb
1 parent 6dffb3a commit b71bd1d

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lib/msf/core/post/azure.rb

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# -*- coding: binary -*-
22

33
module Msf::Post::Azure
4-
def process_tokens_file(file_path, file_data)
4+
def process_tokens_file(content)
55
table_data = []
6-
data = parse_json(file_path, file_data)
7-
if data
8-
dic = {}
9-
data.each do |item|
10-
if dic.key?(item['userId'])
11-
dic[item['userId']] = dic[item['userId']] + 1
12-
else
13-
dic[item['userId']] = 1
14-
end
15-
end
16-
dic.each do |key, value|
17-
table_data << [file_path, key, value]
6+
7+
dic = {}
8+
content.each do |item|
9+
if dic.key?(item['userId'])
10+
dic[item['userId']] = dic[item['userId']] + 1
11+
else
12+
dic[item['userId']] = 1
1813
end
1914
end
15+
dic.each do |key, value|
16+
table_data << [file_path, key, value]
17+
end
18+
2019
table_data
2120
end
2221

@@ -91,7 +90,7 @@ def print_consolehost_history(content)
9190
content.each_line.with_index do |line, index|
9291
commands_of_value.each do |command|
9392
if line.downcase.include? command.downcase
94-
output.append("Line #{index+1} may contain sensitive information. Manual search recommended, keyword hit: #{command}")
93+
output.append("Line #{index + 1} may contain sensitive information. Manual search recommended, keyword hit: #{command}")
9594
end
9695
end
9796
end

0 commit comments

Comments
 (0)