strings 是 Ubuntu / Linux 下一个常用的命令行工具,用来从一个文件(尤其是二进制文件)中提取可打印的字符串。
下面从基本用法 → 常用参数 → 实际示例给你讲清楚。
strings 文件名
例如:
strings a.out
这会输出 a.out 中所有长度 ≥ 4 的可打印字符串。
strings a.out | grep password
strings malware.bin
strings /bin/ls
-n 指定最小字符串长度strings -n 6 file
只显示长度 ≥ 6 的字符串。
-e 指定字符编码常见:
s:7-bit ASCII(默认)S:16-bitb:32-bitl:64-bit示例(UTF-16 / Windows 程序常用):
strings -e S file.exe
-t 显示字符串偏移地址strings -t x file
x:十六进制d:十进制o:八进制-f 显示文件名strings -f *.bin
输出示例:
a.bin: hello world
b.bin: test string
cat file | strings
strings app | grep http
strings core | less
strings libtest.so | grep GLIBC
如果没有:
sudo apt update
sudo apt install binutils
strings 不能解密,只能看明文如果你有具体文件类型(比如 ELF、APK、固件、core dump),我可以给你更针对性的用法。