你这里的 Strings 一般是指 strings 工具(用来从二进制/文件中提取可打印字符串),常用于逆向、取证、分析程序或日志文件。下面按常见场景给你一个实用入门指南。
strings 用来从非文本文件(如 ELF、exe、so、dump、日志、内存镜像)中,提取可打印的字符串,比如:
strings 文件名
示例:
strings test.bin
默认一般是 4 个字符,可以改成更长,减少噪音:
strings -n 8 文件名
✅ 实战中常用 -n 6 ~ 10
strings -t x 文件名
x:十六进制d:十进制o:八进制示例:
strings -t x test.bin
输出类似:
0x1a3c /etc/passwd
0x2b44 http://example.com
strings -o 0x1000 -n 6 test.bin
或配合 dd:
dd if=test.bin bs=1 skip=4096 count=1024 | strings
strings test.bin | grep -E "http://|https://"
strings test.bin | grep "/"
strings test.bin | grep -E "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"
strings test.bin | grep -i password
下载:
https://learn.microsoft.com/sysinternals/downloads/strings
使用:
strings.exe test.exe
指定最小长度:
strings.exe -n 8 test.exe
✅ 分析二进制程序
strings app | grep -i error
strings app | grep -i config
✅ 分析恶意样本
strings sample | grep -E "cmd|powershell|http|/bin/sh"
✅ 分析 core dump / 内存文件
strings core | grep -i password
✅ 分析日志或未知格式文件
strings unknown_file | less
可能原因:
解决:
strings -e l test.exe # UTF-16 LE
strings -e b test.exe # UTF-16 BE
binwalk:分析固件xxd / hexdump:查看原始数据radare2 / IDA:逆向分析floss(FireEye):自动解密字符串strings = 从“非文本文件”里快速找人类可读信息,配合 grep 是分析神器。
如果你愿意,可以告诉我:
我可以直接给你针对性的命令组合。