Rapid7 Vulnerability & Exploit Database

Klog Server authenticate.php user Unauthenticated Command Injection

Back to Search

Klog Server authenticate.php user Unauthenticated Command Injection

Disclosed
12/27/2020
Created
02/13/2021

Description

This module exploits an unauthenticated command injection vulnerability in Klog Server versions 2.4.1 and prior. The `authenticate.php` file uses the `user` HTTP POST parameter in a call to the `shell_exec()` PHP function without appropriate input validation, allowing arbitrary command execution as the apache user. The sudo configuration permits the apache user to execute any command as root without providing a password, resulting in privileged command execution as root. This module has been successfully tested on Klog Server version 2.4.1 virtual appliance.

Author(s)

  • b3kc4t
  • Metin Yunus Kandemir
  • bcoles <bcoles@gmail.com>

Platform

Linux,Unix

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/http/klog_server_authenticate_user_unauth_command_injection
msf exploit(klog_server_authenticate_user_unauth_command_injection) > show targets
    ...targets...
msf exploit(klog_server_authenticate_user_unauth_command_injection) > set TARGET < target-id >
msf exploit(klog_server_authenticate_user_unauth_command_injection) > show options
    ...show and set options...
msf exploit(klog_server_authenticate_user_unauth_command_injection) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;