Skip to content

Darazaki/sldd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sldd - Static ldd

A secure, static-analysis-only alternative to ldd(1) for Linux that never loads or executes the target binary

Why sldd?

On some Linux systems, ldd will try to load the binary through the linker to check what libraries are being loaded. That means the library's constructor/destructor may be invoked which could be an issue for untrusted binaries (see "Security" section of man ldd.1)

The goal of sldd is to develop an alternative implementation of ldd which is known to always be safe to use on unknown binaries and which can also work across different CPU architectures

Note: Right now, sldd is beta quality software. If you find a Linux binary which sldd doesn't work properly on please open an issue

Install

cargo install --git https://github.com/Darazaki/sldd

After that, sldd should be in your $PATH

Usage

You can get this output by running sldd --help:

Usage: sldd [OPTIONS] <BINARY>

Arguments:
  <BINARY>  ELF binary or shared library to analyse

Options:
  -v, --verbose               Print raw ELF metadata (PT_INTERP, DT_RPATH, DT_RUNPATH, DT_NEEDED list) before the resolved dependency tree
  -d, --direct-only           Show only direct (depth-0) dependencies; skip transitive resolution
  -L, --search-dir <DIR>      Add a directory to the library search path (may be repeated)
      --no-cache              Do not consult /etc/ld.so.cache during resolution
      --no-ld-path            Do not honour LD_LIBRARY_PATH from the current environment
      --porcelain             Machine-readable output: one "name => /path" (or "NOT FOUND") per line
      --limit-interp <SIZE>   Maximum size of the PT_INTERP segment (default: 4K). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "4.0 KiB"]
      --limit-dynamic <SIZE>  Maximum size of the PT_DYNAMIC segment (default: 1M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "1.0 MiB"]
      --limit-strtab <SIZE>   Maximum size of the dynamic string table (default: 32M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "32.0 MiB"]
      --limit-shdrs <SIZE>    Maximum size of the section header table (default: 8M). Accepts unit suffixes: 512, 4K, 1M, 2G, etc [default: "8.0 MiB"]
      --limit-needed <COUNT>  Maximum number of DT_NEEDED entries (default: 1024) [default: 1024]
  -h, --help                  Print help (see more with '--help')
  -V, --version               Print version

Exit codes: 0 => all resolved; 1 => missing libraries; 2 = parse error

About

A safe static-analysis-only alternative to Linux's ldd tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages