项目作者: MrSentex

项目描述 :
Unofficial API for 0day.today database | Supported languages: Python and PHP
高级语言: PHP
项目地址: git://github.com/MrSentex/0day.today-API.git
创建时间: 2019-01-08T16:37:28Z
项目社区:https://github.com/MrSentex/0day.today-API

开源协议:GNU General Public License v3.0

下载


0day.today unofficial API | 0.2 beta

Banner.png

Unofficial API for 0day.today database.

This API is not affiliated in any way with “0day.today” and its operation may be against the terms and conditions of “0day.today”, therefore the execution of the API will be carried out under the legal responsibility of the user and MrSentex will be uncharged from any illegal use of the API.

Special thanks:

Dependencies

All you need to use the API and start to work with it.

Python

Dependencies needed to use the API with Python

  • Python 2.7 with PyPi (pip)

Python packages needed:

  • requests
  • bs4
  • unidecode

These dependencies are available in PyPi so they can be installed from the command pip install <package> or they can be installed with the following command: pip install -r requeriments.txt (Must be executed from the folder).

Usage

  1. from ApiLib import api_0day_today
  2. search_param = "ssh"
  3. Api = api_0day_today()
  4. print "Searching '{}' in 0day.today database".format(search_param)
  5. results = Api.search(search_param)
  6. if results["status"] != "fail":
  7. for result in results["response"]:
  8. print "====== Exploit ======="
  9. print "Date: {}\nDescription: {}\nPlatform: {}\nPrice: {}\nAuthor: {}\nURL: {}".format(result["date"], result["desc"], result["platform"], result["price"], result["author"], result["url"])
  10. print "======================"
  11. else:
  12. print "[ERROR] {}".format(results["exception"])

PHP

Dependencies needed to use the API with PHP

  • PHP (5/7)

PHP modules needed:

The first two packages are installed through apt, yum or any other linux package installer. In the case of windows php-xml is already included in the php core and for the install of php-curl is necessary to modify the php.init file and possibly download php_curl.dll .

Usage

  1. <?php
  2. include("ApiLib.php");
  3. $api_0day_today = new api_0day_today();
  4. $search_param = "ssh";
  5. $search = $api_0day_today->search($search_param);
  6. if ($search["status"] === "fail") {
  7. printf("[Error] ".$search["exception"]."\n"); die();
  8. }
  9. foreach($search["response"] as $hit) {
  10. printf("====== Exploit ======\n");
  11. printf("Date: %s\n", $hit["date"]);
  12. printf("Description: %s\n", $hit["desc"]);
  13. printf("Platform: %s\n", $hit["platform"]);
  14. printf("Price: %s\n", $hit["price"]);
  15. printf("Author: %s\n", $hit["author"]);
  16. printf("URL : %s\n", $hit["url"]);
  17. printf("======================\n");
  18. }
  19. ?>