保存 strings 命令的输出结果,常见有以下几种方法,按使用场景给你说明(以 Linux/macOS 为例):
strings 文件名 > output.txt
>:覆盖写入>>:追加写入示例:
strings test.bin > strings_result.txt
strings 文件名 | tee output.txt
output.txt追加模式:
strings 文件名 | tee -a output.txt
strings -n 6 文件名 > output.txt
只保存长度 ≥ 6 的字符串
strings 文件名 > /home/user/results/strings.txt
⚠️ 目录必须存在,否则会报错
strings file1 file2 file3 > all_strings.txt
或:
for f in *.bin; do
strings "$f" >> all_strings.txt
done
strings 文件名 | grep "password" > result.txt
strings.exe file.exe > output.txt
(需先安装 Sysinternals 的 strings.exe)
strings -n 6 target.bin > strings_output.txt
如果你是在 CTF / 逆向 / 取证 / 恶意分析 场景使用,可以告诉我具体用途,我可以帮你设计更合适的保存和分析方式。