Social Eng. extension: massmailer -> calling IO.popen in a secure way
This commit is contained in:
@@ -222,9 +222,10 @@ EOF
|
||||
end
|
||||
|
||||
def get_mime(file_path)
|
||||
mime = "file --mime -b #{file_path}"
|
||||
result = ""
|
||||
IO.popen(mime.to_s) { |f| result = f.gets.split(";").first }
|
||||
IO.popen(["file", "--mime","-b", "#{file_path}"], 'r+') do |io|
|
||||
result = io.readlines.first.split(";").first
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user