# -*- coding: utf-8 -*-
import requests


def attack(URL):
    print(f'[+]开始在exploitalert中搜索 {URL} 存在的历史漏洞。')
    payload = {'name': URL}
    r = requests.get("https://www.exploitalert.com/api/search-exploit", params=payload)
    if r.text == '':
        print('未发现历史漏洞！')
    else:
        for json in r.json():
            print(json)
    print(f'[+]在exploitalert中搜索 {URL} 存在的历史漏洞结束。')


if __name__ == "__main__":
    attack()
