diff options
Diffstat (limited to 'kernel-check.py')
-rwxr-xr-x | kernel-check.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel-check.py b/kernel-check.py index 0936c6c..9c7e563 100755 --- a/kernel-check.py +++ b/kernel-check.py @@ -55,7 +55,7 @@ def main(argv): kernel = lib.extract_version(uname[2]) if kernel is None: error('No kernel information found!') - sys.exit() + return info('Kernel version : %s' % (color('GOOD', '%s-%s' % (kernel.version, kernel.revision)))) @@ -90,6 +90,9 @@ def main(argv): supported.append(i) kernel_eval = lib.eval_cve_files(lib.DIR['out'], kernel, arch) + if not kernel_eval: + error('No kernel vulnerability files found!') + return info('%s vulnerabilities read.' % color('GOOD', str(kernel_eval.read))) @@ -102,7 +105,7 @@ def main(argv): info('Your kernel is not affected by any known vulnerabilites!') return - error('%s affect you kernel: ' % + error('%s affect this kernel: ' % color('BAD', str(len(kernel_eval.affected)))) print_summary(kernel_eval.affected) @@ -118,9 +121,10 @@ def main(argv): choice = 1 for item in supported: supported_eval = lib.eval_cve_files(lib.DIR['out'], item, arch) - if kernel == item: - pass - #TODO + + if not supported_eval or kernel == item: + continue + else: comparison = lib.compare_evaluation(kernel_eval, supported_eval) @@ -245,6 +249,7 @@ def print_beta(): error('Please note that this tool might not operate as expected.') error('Moreover the given information are most likely incorrect.') + def print_information(): 'Prints an information message' |