if=FILE read from FILE instead of stdin
of=FILE write to FILE instead of stdout
skip=N skip N ibs-sized blocks at start of input
bs=BYTES read and write up to BYTES bytes at a time
dmesg 命令用于显示 Linux 内核环形缓冲区(ring buffer)的信息。开机信息和各种错误信息都会放到里面。在调试和故障诊断中非常有用。
-c, --read-clear
Clear the ring buffer after first printing its contents.
-s, --buffer-size size
Use a buffer of size to query the kernel ring buffer. This is 16392 by default.
-n, --console-level level
Set the level at which printing of messages is done to the console.
-d, --disassemble Display assembler contents of executable sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-R, --dynamic-reloc Display the dynamic relocation entries in the file
-l, --line-numbers Include line numbers and filenames in output
-M intel Display instruction in Intel ISA
$ objdump -d [executable] | grep -A 30 [function_name]
查找 GOT 表地址:
$ objdump -R [binary] | grep [function_name]
从可执行文件中提取 shellcode (注意,在objdump中可能会删除空字节):
$ for i in `objdump -d print_flag | tr '\t' ' ' | tr ' ' '\n' | egrep '^[0-9a-f]{2}$' ` ; do echo -n "\x$i" ; done
od
od 命令用于输出文件的八进制、十六进制或其它格式编码的字节,通常用于显示或查看文件中不能直接显示在终端的字符。
-A, --address-radix=RADIX output format for file offsets; RADIX is one
of [doxn], for Decimal, Octal, Hex or None
-t, --format=TYPE select output format or formats
-v, --output-duplicates do not use * to mark line suppression
-i print instruction pointer at time of syscall
-o file send trace output to FILE instead of stderr
-c count time, calls, and errors for each syscall and report summary
-e expr a qualifying expression: option=[!]all or option=[!]val1[,val2]...
options: trace, abbrev, verbose, raw, signal, read, write, fault
-p pid trace process with process id PID, may be repeated
-f follow forks
strip
strip 命令用于删除可执行文件中的符号和段。
-g -S -d --strip-debug Remove all debugging symbols & sections
-R --remove-section=<name> Also remove section <name> from the output
-a --all Scan the entire file, not just the data section [default]
-t --radix={o,d,x} Print the location of the string in base 8, 10 or 16
-e --encoding={s,S,b,l,B,L} Select character size and endianess:
s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
--leak-check=no|summary|full search for memory leaks at exit? [summary]
--show-reachable=yes same as --show-leak-kinds=all
--trace-children=no|yes Valgrind-ise child processes (follow execve)? [no]
--vgdb=no|yes|full activate gdbserver? [yes]
full is slower but provides precise watchpoint/step
xxd
xxd 的作用就是将一个文件以十六进制的形式显示出来。
-g number of octets per group in normal output. Default 2 (-e: 4).
-i output in C include file style.
-l len stop after <len> octets.
-r reverse operation: convert (or patch) hexdump into binary.
-u use upper case hex letters.