slimm609 / checksec

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

Improve libc search #213

Closed petervas closed 1 year ago

petervas commented 1 year ago

Use ldd to locate the systems libc if "--libcfile" was not specified. This is a lot faster and more precise than the previous search in the root folder. If searching is necessary the default path is now "/lib/" instead of "/". Searching for libc has been optimized by removing the for loop and stopping the search after the first match.

petervas commented 1 year ago

This PR addresses some of the still valid points raised in Issue #204. By using ldd as suggested in #204 the default behavior is improved a lot when running checksec without "--libcfile".

petervas commented 1 year ago

The last commit speeds up the search even more by reducing the necessary find executions and reintroduces the search in the root folder as a last resort, but additionally adds /lib/ and /lib64/ to speed it up.