Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to the current month #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions patch_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from datetime import datetime
import argparse
import requests
import re
Expand Down Expand Up @@ -102,15 +103,13 @@ def print_header(title):


if __name__ == "__main__":
today = datetime.now().strftime('%Y-%b')
parser = argparse.ArgumentParser(description='Read vulnerability stats for a patch tuesday release.')
parser.add_argument('security_update', help="Date string for the report query in format YYYY-mmm")
parser.add_argument('security_update', nargs='?', default=today,
help="Date string for the report query in format YYYY-mmm")

args = parser.parse_args()

if not check_data_format(args.security_update):
print("[!] Invalid date format please use 'yyyy-mmm'")
exit()

# Get the list of all vulns
get_sec_release = requests.get(f'{base_url}cvrf/{args.security_update}', headers=headers)

Expand Down Expand Up @@ -154,4 +153,4 @@ def print_header(title):
exploitation = exploitation_likely(all_vulns)
print(f'[+] Found {exploitation["counter"]} vulnerabilites more likely to be exploited')
for cve in exploitation['cves']:
print(f' [-] {cve} - https://www.cve.org/CVERecord?id={cve.split()[0]}')
print(f' [-] {cve} - https://www.cve.org/CVERecord?id={cve.split()[0]}')