This page collects tools for the Linux Executable and Linking Format (ELF) with some basic commands.
checksec.sh
Shows which exploits mitigations a program has. (Source)
./checksec.sh --file file.elf
GDB
See the gdb post.
Objdump
Objdump shows information about a binary (object) file.
Show the assemble code from a ELF file.
objdump -d bin.elf
Show all symbols (e.g. used libs)
objdump -tT bin.elf
Objcopy
Objcopy copies parts of a binary to another file. Usefull to extracts parts of a binary to analyzes them more easily. The following copies the data section of a binary in a new file:
objcopy --only-section=.data bin.elf /tmp/data.bin
strace
strace (system call trace) uses the ptrace system call to show information about the used system calls in a binary file or in a running process. To obtain all system calls from a binary file, use
strace bin.elf [-o /tmp/bin.strace]
To obtain all system calls from a running process, use
strace -p $pid [-o /tmp/bin.strace]
To show all files the binary wants to access, use
strace --trace=file bin.elf
Or show only files the binary wants to access which are currently not on the filesystem:
strace --trace=file --failed-only bin.elf
Show all network related system calls:
strace --trace=network bin.elf
ltrace
ltrace runs a given command and outputs all library call during the program’s execution. Execute it with
ltrace bin.elf [-o /tmp/bin.ltrace]
ftrace
ftrace shows the function calls of a binary or process.
readelf
readelf shows various information about an ELF file.
- General information:
readelf -h bin.elf - Section header table:
readelf -S bin.elf - Program header table:
readelf -l bin.elf - Symbol table:
readelf -s bin.elf - ELF file headers:
readelf -e bin.elf - Show the segments:
readelf --segments bin.elf
Leave a Reply
You must be logged in to post a comment.