Apr 5, 2022

Publish kev-catalog on GitHub

The cisa-alerts.py script has been renamed to kev-catalog.py and been published to GitHub today. Just download, setup and run the script.

$ git clone https://github.com/myseq/kev-catalog

$ cd kev-catalog/

$ pip3 install -r requirements.txt

$ python3 kev-catalog.py -v 


kev-catalog.py

Links:

Apr 4, 2022

Update on cisa-alerts.py

cisa-alerts.py

Update on 'cisa-alerts.py'. 

  • Search CVE within catalog.
  • Search string within catalog.
  • Specify the top N vendors and products.
  • Specify the last N days of CVE added to catalog.

 

cisa-alerts.py -e 2017-0143

cisa-alerts.py -s keep

cisa-alerts.py -l 4 -i 6


Links:

Apr 3, 2022

Display Images on Terminal

This is easy way to display images on a terminal using Python. The module is called climage and has the following features:

  • convert images to NASI Escape codes
  • allow 8/16/256 bit color codings
  • provide ASCII/Unicode support

Installation

$ pip install climage

Usage (in Python)

convert(filename, is_unicode=False, is_truecolor=False, is_256color=True, is_16color=False, is_8color=False, width=80, palette=”default”)

Parameters:
filename : Name of image file.
is_unicode :  If true, conversion is done in unicode format, otherwise ASCII characters will be used.
is_truecolor :  Whether to use RGB colors in generation, if supported by terminal. Defaults False.
is_256color : Whether to use 256 colors encoding. Defaults True.
is_16color : Whether to use 16 colors encoding. Defaults False.
is_8color : Whether to use first 8 System colors. Defaults False.
width : Number of blocks of console to be used. Defaults to 80.
palette : Sets mapping of RGB colors scheme to system colors. Options are : [“default”, “xterm”, “linuxconsole”, “solarized”, “rxvt”, “tango”, “gruvbox”, “gruvboxdark”]. Default is “default”.

 

to_file(infile, outfile, is_unicode=False, is_truecolor=False, is_256color=True, is_16color=False, is_8color=False, width=80, palette=”default”)

Parameters:
infile : The name/path of image file.
outfile :   File in which to store ANSI encoded string. 



Links:

  • https://www.geeksforgeeks.org/display-images-on-terminal-using-python/
  • https://pypi.org/project/climage/

Apr 2, 2022

Create Progress Bar in Terminal

This is easy way to create and show the progress bar in terminal using Python. This is useful for installation or loading a page. The module is called tqdm and it eases your mind with a small progress bar to show an estimation of a process.

Installation

$ pip install tqdm

Usage (in Python)

A simple example for testing

from tqdm import tqdm

 

for i in tqdm(range(int(9e6))):
    pass


Use a parameter to specify the description of progress bar.

from tqdm import tqdm
from time import sleep

for i in tqdm(range(0, 100), desc ="Loading"):
    sleep(.1)


To specify the total number of expected iterations.

from tqdm import tqdm
from time import sleep

for i in tqdm(range(0, 100), total = 500,desc ="Loading"):
    sleep(.1)


To specify the entire width.

from tqdm import tqdm
from time import sleep

for i in tqdm(range(0, 100), ncols = 100,
desc ="Loading"): 

    sleep(.1)


To specify the minimum progress display update (default is 0.1 seconds).

from tqdm import tqdm
from time import sleep

for i in tqdm(range(0, 100), mininterval = 3, desc ="Loading"):
    sleep(.1)


To fill the progress bar with ASCII characters.

from tqdm import tqdm
from time import sleep

for i in tqdm(range(0, 100), ascii ="123456789$"):
    sleep(.1)


Links:

  • https://www.geeksforgeeks.org/python-how-to-make-a-terminal-progress-bar-using-tqdm/
  • https://pypi.org/project/tqdm/

Apr 1, 2022

7 Newly Added Known Exploited Vulnerabilities

cisa-alerts.py
 

With the update of the cisa-alerts script today, it can now show the details of what's new in CISA's Known Exploited vulnerabilites JSON file.

There are 7 newly added Known Exploited vulnerabilities, and 1 of them is for Microsoft Windows User Profile Service Privilege Escalation Vulnerability (cve-2021-34484). 

All the 7 vulnerabilities need to be patched by Apr 21, 2022 (20 days for remediation).


Links: