mirror of
https://github.com/cve-search/cpe-guesser.git
synced 2024-11-14 02:48:28 +00:00
27 lines
686 B
Python
27 lines
686 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import argparse
|
|
import os
|
|
import sys
|
|
import json
|
|
|
|
runPath = os.path.dirname(os.path.realpath(__file__))
|
|
sys.path.append(os.path.join(runPath, ".."))
|
|
from lib.cpeguesser import CPEGuesser
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(
|
|
description="Find potential CPE names from a list of keyword(s) and return a JSON of the results"
|
|
)
|
|
parser.add_argument(
|
|
"word",
|
|
metavar="WORD",
|
|
type=str,
|
|
nargs="+",
|
|
help="One or more keyword(s) to lookup",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
cpeGuesser = CPEGuesser()
|
|
print(json.dumps(cpeGuesser.guessCpe(args.word)))
|