This program pulls down a list of Common Vulnerabilities and Exposures (CVEs) from https://cve.mitre.org/data/downloads/, formats the file to remove unneeded data, and then allows the user to search it. Returns the results in a separate CSV file for easier reading.
List of pre-requisites for running the program:
- Have Python installed. Preferably 3.8.3+.
- A terminal like the one in VS Code, Git Bash, or the MacOSX terminal.
- If running this within VS Code, you will want to:
- Select the newest Python interpreter possible.
- Install the Python extension authored by Microsoft.
- Install any modules that need to be manually installed:
python -m pip install upgrade pip
- Updates the
pip
module management to the newest version. - Not necessarily required.
- Updates the
python -m pip install requests
- Installs the
requests
module for Python if it is not already installed. - Definitely required.
- Installs the
- Navigate to the root folder of the project in a terminal, if not already there.
- You should see the main.py file if you use the
ls
command.
- You should see the main.py file if you use the
- Run the following command:
py main.py install
- If that doesn't work, you may need to try one of the following variants:
python main.py install
C:\Python##\python.exe main.py install
- The
##
needs to be replaced with the numbers matching the Python folder in your C drive. - For example, on my C drive, that folder is
Python38
so the path isC:\Python38\python.exe
.
- The
- If that doesn't work, you may need to try one of the following variants:
- The application should start and run.
- After running it with install once, subsequent runs should be able to be done without
install
.- In that case, the command would be:
py main.py
- Or, as before, if that does not work, you can try:
python main.py
C:\Python##\python.exe main.py
- Or, as before, if that does not work, you can try:
- In that case, the command would be:
The primary purpose of this section is to list optional requirements that were met when I used this for my Code Louisville project submission during the May 2020 Python course.
- Create a dictionary or list, populate it with several values, retrieve at least one value, and use it in your program
- A list is used by the csvReader in the searchByInput function in vulnSearch.py to read through the rows to find results.
- A list is used by the rowCountInt function in extras.py to return the number of rows, which is used by multiple other parts of the program.
- Read data from an external file, such as text, JSON, CSV, etc and use that data in your application
- This occurs in dataRefresh.py, fileEdit.py, and vulnSearch.py.
- dataRefresh.py is where the new list is downloaded.
- fileEdit.py is where the file format is completed.
- vulnSearch.py is where data from the downloaded csv is read and searched through.
- May eventually add a part to make it go back through the loop in the event that no results are found.
- The steps the process follows are:
- Downloads the CVE data file in CSV format.
- Edits it to get rid of some comment lines to avoid reading issues.
- Removes unnecessary rejected or reserved vuln labels.
- Reserved labels are ones that don't actually have a vuln attached to them yet.
- Rejected are ones that are not counted as vulns anymore. Could be in future, but this is part of why the file refreshes each time the program is run.
- This occurs in dataRefresh.py, fileEdit.py, and vulnSearch.py.
- Create and call at least 3 functions, at least one of which must return a value that is used
- SOOOOO many functions everywhere.
- Multiple ones return values used to display:
- Percentage search complete
- Relies on the functions in extras.py to get some of the numbers.
- These percentages are then read back within the searchByInput function in vulnSearch.py.
- Number of records obtained from download after format
- Uses extras.py and fileEdit.py.
- Number of search results returned from search
- Relies on the functions in extras.py to get some of the numbers.
- Updated file paths
- Basically just about every function does this at some point.
- Percentage search complete
- Analyze text and display information about it (ex: how many words in a paragraph)
- I analyze the search data downloaded, once I have formatted it, to display how many search records are available to be searched.
- Once the results have been returned I display how many results were found, and let the user no if no results were found.
This was tested on Windows OS only. It should also run on Mac OSX, but commands may differ slightly.