etke / checksec.rs

Fast multi-platform (ELF/PE/MachO) binary checksec written in Rust.
Apache License 2.0
97 stars 12 forks source link

Linux/ELF: Add option to scan loaded shared libraries #24

Closed cgzones closed 1 year ago

cgzones commented 2 years ago

Dynamic linking is the standard on Linux. Thus the hardening of dynamic loaded shared libraries can affect programs as well.

Add a an option to scan all dynamic libraries for a binary/process. For binaries the list of libraries is taken from the ELF information and for processes all executable mapped memory regions backed up by a file are scanned.

Remarks I renamed the structs Binary to Blob and Binaries to Binary and dropped the formatting inside of Blob (previously Binary) to get the formatting in print_binary_results() and print_process_results() working.

The main.rs file now has several parsing related functions which might be subject of refactoring into a new file.

To speed the scanning of libraries up (especially for scanning directories or all running processes) rayon's parallel iterators are used.