




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux系统管理常用管理命令linux操作系统 电脑资料 本文章来各位linux管理者提供一些常用的Linux系统管理常用管理命令,有需要用的朋友可收藏本文章 1.循环遍历当前目录所有的文件名包含 html.php 的文件 org/tag/rootrootyu1u/# find . | grep html.php 2.循环遍历当前目录所有的文件名包含 html.php 的文件并删除 rootyu1u/# find . | grep html.php | xargs rm -rf 3.循环遍历找出当前目录中所有后缀名为 .htm 的文件中 包含 hacker 字符的文件 rootyu1u/# grep hacker find . | grep .htm 4.循环遍历找出当前目录中所有后缀名为 .htm 的文件并文件内容包含 hacker 字符的文件将里面的 the_old_string 用 the_new_string 进行批量替换 rootyu1u/# sed -i s/the_old_string/the_new_string/g grep hacker -rl . 5.找出 /webroot/ 目录中文件类型为 html 的文件,并进行批量压缩 rootyu1u/# find /webroot/ -name *.html -type f -exec gzip ; 6.找出网站根目录 /var/webroot 中所有截至到现在被修改过的 php 文件, -name*.php为查找所有php文件 -time -10为截止到现在10天 rootyu1u/# find /var/webroot -name *.php -mtime -10 7.查找php木马有可能出现的关键字eval ,shell_exec , passthru , popen,system rootyu1u/# find /var/webroot -name *.php | xargs grep eval|more 8.查找当前tcp/ip链接状态中,状态为 EST (一些攻击的特征,当EST状态数很多的时候,服务器的负载会特别大),并降序排列,显示前 100 个链接 rootyu1u/# stat -an | grep -i :80 |grep EST| awk print $5 |cut -d : -f 1 | sort | uniq -c | sort -nr | awk if($1 100) print $2 9.关闭不需要的服务 rootyu1u/# for SERVICES in abrtd acpid auditd avahi-daemon cpuspeed haldaemon mdmonitor messagebus udev-post; do chkconfig $SERVICES off; done 10.用tcpdump嗅探80端口的访问看看谁最高 rootyu1u/# tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -F. print $1.$2.$3.$4 sort | uniq -c | sort -nr |head -20 11.察看哪个进程占用内存最大 rootyu1u/# ps -aux|sort -k5nr|awk BEGINprint PID VSZprint $2,$5|awk NR3 12.查看80端口总共有多少个链接 rootyu1u/# stat -nat | grep -i 80 | wc -l 13.查看80端口连接数最多的20个IP rootyu1u/# stat -anlp|grep 80|grep tcp|awk print $5|awk -F: print $1 |sort|uniq -c|sort -nr|head -n20 14.用tcpdump嗅探80端口的访问看看谁最高 rootyu1u/# tcpdump -i eth0 -tnn dst port 80 -c 1000 | awk -F. print $1.$2.$3.$4 sort | uniq -c | sort -nr |head -20 15.查找较多time_wait连接 rootyu1u/# stat -n|grep TIME_WAIT|awk print $5|sort|uniq -c|sort -rn|head -n20 16.查找较多的SYN连接 rootyu1u/# stat -an | grep SYN | awk print $5 | awk -F: print $1 | sort | uniq -c | sort -nr | more 17.对连接的IP按连接数量进行排序 rootyu1u/# stat -ntu | awk print $5 | cut -d: -f1 | sort | uniq -c | sort -n 18.查看TCP连接状态 rootyu1u/# stat -nat |awk print $6|sort|uniq -c|sort -rn rootyu1u/# stat -n | awk /tcp/ +S$NF;END for(a in S) print a, Sa rootyu1u/# stat -n | awk /tcp/ +state$NF; END for(key in state) print key,t,statekey rootyu1u/# stat -n | awk /tcp/ +arr$NF;END for(k in arr) print k,t,arrk rootyu1u/#
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论