checksec.py icon indicating copy to clipboard operation
checksec.py copied to clipboard

Handle ELF binary with no program segments

Open ffontaine opened this issue 9 months ago • 8 comments

Do not return False for NX and No for RELRO when there is no program segments in the ELF binary file (e.g. kernel module).

This is inspired from https://github.com/slimm609/checksec/commit/29aea688e10b5c16d1cf60e3968f170b2147c150

For RELRO, a new NA value is added For NX, True is returned to avoid changing NX type from boolean to string

ffontaine avatar Mar 06 '25 14:03 ffontaine

relro_na will have to be added to tests/binaries/elf to fix tests

ffontaine avatar Mar 06 '25 16:03 ffontaine

Hi @ffontaine and thanks for this PR.

Could you provide a test binary and make a PR into https://github.com/Wenzel/checksec.py-test-binaries ?

Wenzel avatar Mar 21 '25 04:03 Wenzel

Hi, PR created: https://github.com/Wenzel/checksec.py-test-binaries/pull/2

ffontaine avatar Mar 21 '25 08:03 ffontaine

@ffontaine just merged your test binary can you update the submodule here ?

Wenzel avatar Mar 30 '25 23:03 Wenzel

Done

ffontaine avatar Mar 31 '25 06:03 ffontaine

Thanks ! can you make the CI go green ? :green_circle:

Wenzel avatar Mar 31 '25 09:03 Wenzel

I sent a new PR as pytest does not handle link on usb-storage.ko: https://github.com/Wenzel/checksec.py-test-binaries/pull/3

ffontaine avatar Apr 03 '25 16:04 ffontaine

CI is finally green :-)

ffontaine avatar Apr 04 '25 08:04 ffontaine