from bs4 import BeautifulSoup
from pprint import pprint
import json
import re
import time
import sys

# reads in cves, nvdJSON file, then tri

def find_those_dates(cvefile, jsonFile):
    listofcves = [line.rstrip('\n') for line in open(cvefile)]
    with open(jsonFile, 'r') as jfile:
        nvd_database = json.load(jfile)
    index = 0
    totalCVEList = (int(nvd_database["CVE_data_numberOfCVEs"]))
    totalCVEList -=1
    #print(listofcves)  
    #print(" TOTAL CVE COUNT: " + str(totalCVEList))
    for target in listofcves:
        while index < (totalCVEList - 1):
            lineitem = nvd_database["CVE_Items"][index]["cve"]["CVE_data_meta"]["ID"]
            #print(lineitem)
            #print(target + "target")
            if lineitem == target:
                cvedate = nvd_database["CVE_Items"][index]["publishedDate"]
                print(target + ", " + cvedate)
                #print(str(index) + " COUNTER")
                index = 0 # reset index counter
                break
            else:
                index+=1
                #print(index)

    # supply the function with --> (cvelist | json date file)
def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


if __name__ == "__main__":
   main() 

81db6d28a106d6094f53446ce814dacb1fd5b735
<mask token>


def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


<mask token>

<mask token>


def find_those_dates(cvefile, jsonFile):
    listofcves = [line.rstrip('\n') for line in open(cvefile)]
    with open(jsonFile, 'r') as jfile:
        nvd_database = json.load(jfile)
    index = 0
    totalCVEList = int(nvd_database['CVE_data_numberOfCVEs'])
    totalCVEList -= 1
    for target in listofcves:
        while index < totalCVEList - 1:
            lineitem = nvd_database['CVE_Items'][index]['cve']['CVE_data_meta'
                ]['ID']
            if lineitem == target:
                cvedate = nvd_database['CVE_Items'][index]['publishedDate']
                print(target + ', ' + cvedate)
                index = 0
                break
            else:
                index += 1


def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


<mask token>

<mask token>


def find_those_dates(cvefile, jsonFile):
    listofcves = [line.rstrip('\n') for line in open(cvefile)]
    with open(jsonFile, 'r') as jfile:
        nvd_database = json.load(jfile)
    index = 0
    totalCVEList = int(nvd_database['CVE_data_numberOfCVEs'])
    totalCVEList -= 1
    for target in listofcves:
        while index < totalCVEList - 1:
            lineitem = nvd_database['CVE_Items'][index]['cve']['CVE_data_meta'
                ]['ID']
            if lineitem == target:
                cvedate = nvd_database['CVE_Items'][index]['publishedDate']
                print(target + ', ' + cvedate)
                index = 0
                break
            else:
                index += 1


def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


if __name__ == '__main__':
    main()

from bs4 import BeautifulSoup
from pprint import pprint
import json
import re
import time
import sys


def find_those_dates(cvefile, jsonFile):
    listofcves = [line.rstrip('\n') for line in open(cvefile)]
    with open(jsonFile, 'r') as jfile:
        nvd_database = json.load(jfile)
    index = 0
    totalCVEList = int(nvd_database['CVE_data_numberOfCVEs'])
    totalCVEList -= 1
    for target in listofcves:
        while index < totalCVEList - 1:
            lineitem = nvd_database['CVE_Items'][index]['cve']['CVE_data_meta'
                ]['ID']
            if lineitem == target:
                cvedate = nvd_database['CVE_Items'][index]['publishedDate']
                print(target + ', ' + cvedate)
                index = 0
                break
            else:
                index += 1


def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


if __name__ == '__main__':
    main()

from bs4 import BeautifulSoup
from pprint import pprint
import json
import re
import time
import sys

# reads in cves, nvdJSON file, then tri

def find_those_dates(cvefile, jsonFile):
    listofcves = [line.rstrip('\n') for line in open(cvefile)]
    with open(jsonFile, 'r') as jfile:
        nvd_database = json.load(jfile)
    index = 0
    totalCVEList = (int(nvd_database["CVE_data_numberOfCVEs"]))
    totalCVEList -=1
    #print(listofcves)  
    #print(" TOTAL CVE COUNT: " + str(totalCVEList))
    for target in listofcves:
        while index < (totalCVEList - 1):
            lineitem = nvd_database["CVE_Items"][index]["cve"]["CVE_data_meta"]["ID"]
            #print(lineitem)
            #print(target + "target")
            if lineitem == target:
                cvedate = nvd_database["CVE_Items"][index]["publishedDate"]
                print(target + ", " + cvedate)
                #print(str(index) + " COUNTER")
                index = 0 # reset index counter
                break
            else:
                index+=1
                #print(index)

    # supply the function with --> (cvelist | json date file)
def main():
    find_those_dates(str(sys.argv[1]), str(sys.argv[2]))


if __name__ == "__main__":
   main() 
