slimm609 / checksec

Checksec
https://slimm609.github.io/checksec
Other
2.04k stars 306 forks source link

the json output when using listfile is not valid #208

Closed ysmaoui closed 1 year ago

ysmaoui commented 1 year ago

Issue tracker

If any of these values are not included, the issue will be closed and not worked

Issue

The json output when using listfile is not valid I have added a test in this PR to catch this: https://github.com/slimm609/checksec.sh/pull/207

Debug Report

Output of the test when run locally

starting custom kernel check for file /root/kernel_configs/configs/config-3.10.1 - json
starting custom kernel check for file /root/kernel_configs/configs/config-3.17.1 - json
starting custom kernel check for file /root/kernel_configs/configs/config-5.10.1 - json
starting file check - json
starting listfile check - json
{
 "/bin/bash": { "relro":"full","canary":"yes","nx":"yes","pie":"yes","rpath":"no","runpath":"no","symbols":"no","fortify_source":"yes","fortified":"13","fortify-able":"33" },
 }
listfile json validation failed

Command run to produce the error

I have added a test in the following PR to reproduce and catch the error

OS version and Kernel version

Debug output

Run the same command as above to reproduce the error but include the --debug flag

e.x checksec --debug -f /usr/bin/ls

ysmaoui commented 1 year ago

https://github.com/slimm609/checksec.sh/pull/207 should also fix the trailing comma issue