diff options
| author | 2019-10-15 15:27:44 +0100 | |
|---|---|---|
| committer | 2019-10-15 15:27:44 +0100 | |
| commit | 41f5c5d6075e29ccd310155faeb3f27a8909f52e (patch) | |
| tree | 486eccf1670c65c53f623ade17ca83f49c62e300 /modules | |
| parent | show ,fedi latest-tweet also if it's a self-reply (diff) | |
| signature | ||
move cve.py to bitbot-modules repo
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/cve.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/modules/cve.py b/modules/cve.py deleted file mode 100644 index 7504f2a5..00000000 --- a/modules/cve.py +++ /dev/null @@ -1,37 +0,0 @@ -#--depends-on commands - -import datetime, json -from src import ModuleManager, utils - -URL_CVE = "https://cve.circl.lu/api/cve/%s" - -class Module(ModuleManager.BaseModule): - _name = "CVE" - - @utils.hook("received.command.cve", min_args=1) - def cve(self, event): - """ - :help: Get information for a CVE number - :usage: <CVE> - """ - cve_id = event["args_split"][0].upper() - if not cve_id.startswith("CVE-"): - cve_id = "CVE-%s" % cve_id - - page = utils.http.request(URL_CVE % cve_id, json=True) - - if page and page.data: - cve_id = page.data["id"] - - published = "%sZ" % page.data["Published"].rsplit(".", 1)[0] - published = datetime.datetime.strptime(published, - utils.ISO8601_PARSE) - published = datetime.datetime.strftime(published, "%Y-%m-%d") - - rank = page.data["cvss"] - summary = page.data["summary"] - - event["stdout"].write("%s, %s (%s): %s" % - (cve_id, published, rank, summary)) - else: - raise utils.EventsResultsError() |
