技巧性极强的strings命令
打印文件中的可打印字符串(print the strings of printable characters in files)。常用来在二进制文件中查找字符串,与grep配合使用。strings命令输出的字符串长度为4个或4个以上的,长度小于4的字符串将不予打印,我们可以通过-n参数调整,strings -n 2 filename
strings命令是在对象文件或者二进制文件中查找可打印的字符串,有很多的用途,例如一个用法就是在编译的so中定义字符串常量作为动态库的版本号,然后就可以使用strings+grep 组合命令查看当前编译的so的版本号了。输入strings -h查看strings命令的用法:
用法:strings [选项] [文件]
打印 [文件] (默认为标准输入) 中可打印的字符串
选项为:
-a - --all Scan the entire file, not just the data section [default]
-d --data Only scan the data sections in the file
-f --print-file-name Print the name of the file before each string
-n --bytes=[number] Locate & print any NUL-terminated sequence of at
-<number> least [number] characters (default ).
-t --radix={o,d,x} Print the location of the string in base , or
-w --include-all-whitespace Include all whitespace as valid string characters
-o An alias for --radix=o
-T --target=<BFDNAME> Specify the binary file format
-e --encoding={s,S,b,l,B,L} Select character size and endianness:
s = -bit, S = -bit, {b,l} = -bit, {B,L} = -bit
-s --output-separator=<string> String used to separate strings in output.
@<file> Read options from <file>
-h --help Display this information
-v -V --version Print the program's version number
strings:支持的目标: elf64-x86- elf32-i386 elf32-iamcu elf32-x86- a.out-i386-linux pei-i386 pei-x86- elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86- pe-bigobj-x86- pe-i386 plugin srec symbolsrec verilog tekhex binary ihex
将 bug 报告到 <http://www.sourceware.org/bugzilla/>
在libc.so.6是c标准库,而这个标准库的制作者为了让库的使用者知道该库兼容哪些版本的标准库,就在这个库中定义了一些字符串常量,比如我的系统是centos6.8-x64,我的c标准库在/lib64/libc.so.6,可以直接运行该标准库文件,或者使用ldd --version查看当前版本,以下显示当前版本为2.12

而使用strings /lib64/libc.so.6 | grep GLIBC,可查看向下兼容的版本:
[root@localhost ~]# strings /lib64/libc.so. | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_2.
GLIBC_PRIVATE
https://blog.csdn.net/stpeace/article/details/46641069
技巧性极强的strings命令的更多相关文章
- 抗干扰性极强非接触式读卡13.56mhz芯片:SI522
由于智能门锁产品不断地火爆,市场上的不断出现破解的方法.对此中科微联合深圳市动能世纪科技有限公司不断满足市场需求,推出一款抗干扰性极强的13.56mhz芯片. 该芯片出了抗干扰性强以外还直接PIN2P ...
- linux中的strings命令简介2
摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 之前我们聊过linux strings的用法和用 ...
- linux中的strings命令简介
摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 在linux下搞软件开发的朋友, 几乎没有不知道 ...
- linux中的strings命令
strings - print the strings of printable characters in files. 意思是, 打印文件中可打印的字符. 我来补充一下吧 ...
- Sort功能极强!
Sort功能极强! 可以排string: sort(a.begin(),a.end()); 普通数组 结合结构体 逆序 而且贼快
- 用strings命令查看kafka-log内容
kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...
- 用strings命令查看kafka-log内容 过滤二进制编码
kafka的log内容格式还不没怎么了解,想快速浏览消息内容的话,除了使用它自带的kafka-console-consumer.sh脚本,还可以直接去看log文件本身,不过内容里有部分二进制字符,通过 ...
- centos Linux系统日常管理2 tcpdump,tshark,selinux,strings命令, iptables ,crontab,TCP,UDP,ICMP,FTP网络知识 第十五节课
centos Linux系统日常管理2 tcpdump,tshark,selinux,strings命令, iptables ,crontab,TCP,UDP,ICMP,FTP网络知识 第十五节课 ...
- strings命令的实现 2014-06-02 00:17 355人阅读 评论(0) 收藏
本程序实现从文件中提取连续4个以上的可打印字符.模仿linux中string命令 #include <stdio.h> #include<stdlib.h> #include ...
随机推荐
- pthread_create()
pthread_create()创建的线程没有执行,试了好几遍.非常郁闷.后来发现主线程没有睡眠,新创建的线程还没来的及执行主线程就退出了,所以没有执行.
- poj 1523"SPF"(无向图求割点)
传送门 题意: 有一张联通网络,求出所有的割点: 对于割点 u ,求将 u 删去后,此图有多少个联通子网络: 对于含有割点的,按升序输出: 题解: DFS求割点入门题,不会的戳这里
- HTTP请求头和响应头的格式
请求头: 请求头肯定带着客户端信息,比如host主机名,User-Agent用户代理信息,Cookie等等 响应头: 响应头带有服务端信息:Server服务器信息,Last-Modified最后修改 ...
- (逆序对 分治法)P1908 逆序对 洛谷
题目描述 猫猫TOM和小老鼠JERRY最近又较量上了,但是毕竟都是成年人,他们已经不喜欢再玩那种你追我赶的游戏,现在他们喜欢玩统计.最近,TOM老猫查阅到一个人类称之为“逆序对”的东西,这东西是这样定 ...
- 16、计算1加到100用两个定义值count=1、sum=0
#!/user/bin/python# -*- coding:utf-8 -*-count = 1sum = 0while count <= 100: sum = sum + count cou ...
- Linux_问题
1.远程连接项目服务器(miit_shi),遇到的问题 问题:Connecting to IP地址:22... Connection established. To escape to local s ...
- Linux虚拟内存(swap)调优篇-“swappiness”,“vm.dirty_background_ratio”和“vm.dirty_ratio”
Linux虚拟内存(swap)调优篇-“swappiness”,“vm.dirty_background_ratio”和“vm.dirty_ratio” 作者:尹正杰 版权声明:原创作品,谢绝转载 ...
- SpringBoot笔记十一:html通过Ajax获取后端数据
我们知道在Java Web中,前端的JSP可以使用EL表达式来获取Servlet传过来的数据Spring Boot中也有Thymeleaf模板可以使用th: text="${XXX}&quo ...
- java io系列08之 File总结
本文对File的API和常用方法进行介绍. 转载请注明出处:http://www.cnblogs.com/skywang12345/p/io_08.html File 介绍 File 是“文件”和“目 ...
- Redis之主从复制
定义:主机数据更新后根据配置策略,自动同步到备的Master/slave机制,Master以写为主,Slave以读为主. Tip:配从(从库)不配主(主库) 1.从库配置: slave of 主库IP ...