首页 数据库 mysql教程 Shell分析access

Shell分析access

Jun 07, 2016 pm 03:50 PM
access shell tcp 分析 查看 端口 连接

#查看80端口的tcp连接 #netstat -tan | grep ESTABLISHED | grep :80 | wc -l 1 #当前WEB服务器中联接次数最多的ip地址: #netstat -ntu |awk '{print $5}' |sort | uniq -c| sort -n -r 231 ::ffff:127.0.0.1:8095 23 ::ffff:192.168.50.201:5432 2 ::ffff:1

#查看80端口的tcp连接

#netstat -tan | grep "ESTABLISHED" | grep ":80" | wc -l

1

#当前WEB服务器中联接次数最多的ip地址:

#netstat -ntu |awk '{print $5}' |sort | uniq -c| sort -n -r

231 ::ffff:127.0.0.1:8095

23 ::ffff:192.168.50.201:5432

2 ::ffff:192.168.50.203:80

1 servers)

1 ::ffff:192.168.50.56:43314

1 ::ffff:192.168.50.21:2996

1 ::ffff:192.168.50.21:2989

1 ::ffff:192.168.50.200:8060

1 ::ffff:192.168.50.12:1300

1 ::ffff:192.168.50.12:1299

1 ::ffff:192.168.50.12:1298

1 ::ffff:127.0.0.1:57933

1 Address

1 192.168.50.41:65310

1 192.168.50.41:64949

1 192.168.50.41:49653

#查看日志中访问次数最多的前10个IP

#cat access_log |cut -d ' ' -f 1 |sort |uniq -c | sort -nr | awk '{print $0 }' | head -n 10 |less

14085 121.207.252.122

13753 218.66.36.119

11069 220.162.237.6

1188 59.63.158.118

1025 ::1

728 220.231.141.28

655 114.80.126.139

397 117.25.55.100

374 222.76.112.211

348 120.6.214.70

#查看日志中出现100次以上的IP

#cat access_log |cut -d ' ' -f 1 |sort |uniq -c | awk '{if ($1 > 100) print $0}'|sort -nr |less

14085 121.207.252.122

13753 218.66.36.119

11069 220.162.237.6

1188 59.63.158.118

1025 ::1

728 220.231.141.28

655 114.80.126.139

397 117.25.55.100

374 222.76.112.211

348 120.6.214.70

252 58.211.82.150

252 159.226.126.21

206 121.204.57.94

192 59.61.111.58

186 218.85.73.40

145 221.231.139.30

134 121.14.148.220

123 222.246.128.220

122 61.147.123.46

119 121.204.105.58

107 116.9.75.237

105 118.123.5.173

#查看最近访问量最高的文件

#cat access_log |tail -10000|awk '{print $7}'|sort|uniq -c|sort -nr|less

8729 /server-status?auto

618 /

15 /favicon.ico

12 /manager/html

10 *

9 /top/icons.gif

8 /www.766.com/awstats.www.766.com.html

8 /awstatsicons/other/vv.png

8 /awstatsicons/other/vu.png

8 /awstatsicons/other/vp.png

8 /awstatsicons/other/vk.png

8 /awstatsicons/other/vh.png

8 /awstatsicons/other/hx.png

8 /awstatsicons/other/hp.png

8 /awstatsicons/other/hk.png

8 /awstatsicons/other/hh.png

8 /awstatsicons/other/he.png

8 /awstatsicons/other/awstats_logo6.png

8 /awstatsicons/os/win.png

8 /awstatsicons/os/unknown.png

8 /awstatsicons/os/unix.png

8 /awstatsicons/os/symbian.png

8 /awstatsicons/os/psp.png

#查看最近访问量最高的页面(.png)

#cat access_log |awk '{print $7}'|grep '.png'|sort|uniq -c|sort -nr |head -n 10

241 /awstatsicons/other/awstats_logo6.png

227 /awstatsicons/clock/hr12.png

226 /awstatsicons/other/vv.png

226 /awstatsicons/other/vu.png

226 /awstatsicons/other/vp.png

226 /awstatsicons/other/vk.png

226 /awstatsicons/other/vh.png

226 /awstatsicons/clock/hr9.png

226 /awstatsicons/clock/hr8.png

226 /awstatsicons/clock/hr7.png

#查看日志中访问超过100次的页面

#cat access_log | cut -d ' ' -f 7 | sort |uniq -c | awk '{if ($1 > 100) print $0}' | less

20107 /

1027 *

215 /awstatsicons/browser/chrome.png

215 /awstatsicons/browser/firefox.png

136 /awstatsicons/browser/mozilla.png

216 /awstatsicons/browser/msie.png

201 /awstatsicons/browser/netscape.png

123 /awstatsicons/browser/notavailable.png

214 /awstatsicons/browser/opera.png

215 /awstatsicons/browser/pdaphone.png

214 /awstatsicons/browser/safari.png

215 /awstatsicons/browser/unknown.png

226 /awstatsicons/clock/hr10.png

226 /awstatsicons/clock/hr11.png

227 /awstatsicons/clock/hr12.png

225 /awstatsicons/clock/hr1.png

226 /awstatsicons/clock/hr2.png

226 /awstatsicons/clock/hr3.png

226 /awstatsicons/clock/hr4.png

226 /awstatsicons/clock/hr5.png

226 /awstatsicons/clock/hr6.png

226 /awstatsicons/clock/hr7.png

226 /awstatsicons/clock/hr8.png

#access_log昨天一天的点击量(clicks);

cat access_log|grep '12/Nov/2009'|grep "******.jsp"|wc|awk '{print $1}'|uniq

0

#昨天访问网站的独立IP有多少;

cat access_log|grep '12/Aug/2009'|grep "******"|wc|awk '{print $1}'|uniq

194

#统计某url,一天的访问次数

#cat access_log|grep '12/Aug/2009'|grep '/images/index/e1.gif'|wc|awk '{print $1}'

2

#拉出前五天的访问次数最多的网页前20名清单;进行五天日志对比,找出排名靠前重复的网页,即可得出本周访问量最大的前几个网页;

#cat access_log|awk '{print $7}'|uniq -c |sort -n -r|head -20

10519 /

654 /manager/html

450 /manager/html

397 /

368 /manager/html

304 /

280 /manager/html

279 /

263 /manager/html

252 /manager/html

252 /manager/html

226 /

220 /

193 /

187 /

180 /

167 /

166 /

134 /

129 /

#从日志里查看该ip在干嘛:

#cat access_log | grep 218.66.36.119| awk '{print $1"/t"$7}' | sort | uniq -c | sort -nr | less

243 218.66.36.119 /

210 218.66.36.119 /awstatsicons/other/awstats_logo6.png

198 218.66.36.119 /awstatsicons/clock/hr12.png

197 218.66.36.119 /awstatsicons/other/vv.png

197 218.66.36.119 /awstatsicons/other/vu.png

197 218.66.36.119 /awstatsicons/other/vp.png

197 218.66.36.119 /awstatsicons/other/vk.png

197 218.66.36.119 /awstatsicons/other/vh.png

197 218.66.36.119 /awstatsicons/clock/hr9.png

197 218.66.36.119 /awstatsicons/clock/hr8.png

197 218.66.36.119 /awstatsicons/clock/hr7.png

197 218.66.36.119 /awstatsicons/clock/hr6.png

197 218.66.36.119 /awstatsicons/clock/hr5.png

197 218.66.36.119 /awstatsicons/clock/hr4.png

197 218.66.36.119 /awstatsicons/clock/hr3.png

197 218.66.36.119 /awstatsicons/clock/hr2.png

197 218.66.36.119 /awstatsicons/clock/hr1.png

197 218.66.36.119 /awstatsicons/clock/hr11.png

#列出传输时间超过 30 秒的文件

#cat access_log|awk ‘($NF > 30){print $7}’|sort -n|uniq -c|sort -nr|head -20

14058 /server-status?auto

8966 /

3955 /manager/html

1025 *

214 /www.766.com/awstats.www.766.com.html

211 /awstatsicons/other/awstats_logo6.png

199 /awstatsicons/clock/hr12.png

198 /awstatsicons/other/vv.png

198 /awstatsicons/other/vu.png

198 /awstatsicons/other/vp.png

198 /awstatsicons/other/vk.png

198 /awstatsicons/other/vh.png

198 /awstatsicons/clock/hr9.png

198 /awstatsicons/clock/hr8.png

198 /awstatsicons/clock/hr7.png

198 /awstatsicons/clock/hr6.png

198 /awstatsicons/clock/hr5.png

198 /awstatsicons/clock/hr4.png

198 /awstatsicons/clock/hr3.png

198 /awstatsicons/clock/hr2.png

#列出最最耗时的页面(超过60秒的)的以及对应页面发生次数

#cat access_log |awk ‘($NF > 60 && $7~//.php/){print $7}’|sort -n|uniq -c|sort -nr|head -100

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

Windows11怎么禁用后台应用程序_Windows11禁用后台应用教程 Windows11怎么禁用后台应用程序_Windows11禁用后台应用教程 May 07, 2024 pm 04:20 PM

1、在Windows11中打开设置。您可以使用Win+I快捷方式或任何其他方法。2、转到应用程序部分,然后单击应用程序和功能。3、查找要阻止在后台运行的应用程序。单击三点按钮并选择高级选项。4、找到【后台应用程序权限】部分并选择所需的值。默认情况下,Windows11设置电源优化模式。它允许Windows管理应用程序在后台的工作方式。例如,一旦启用省电模式以保留电池,系统将自动关闭所有应用程序。5、选择【从不】可防止应用程序在后台运行。请注意,如果您注意到程序不向您发送通知、无法更新数据等,您可

deepseek怎么转换pdf deepseek怎么转换pdf Feb 19, 2025 pm 05:24 PM

DeepSeek 无法直接将文件转换为 PDF。根据文件类型,可以使用不同方法:常见文档(Word、Excel、PowerPoint):使用微软 Office、LibreOffice 等软件导出为 PDF。图片:使用图片查看器或图像处理软件保存为 PDF。网页:使用浏览器“打印成 PDF”功能或专用的网页转 PDF 工具。不常见格式:找到合适的转换器,将其转换为 PDF。选择合适的工具并根据实际情况制定方案至关重要。

无法允许访问 iPhone 中的摄像头和麦克风 无法允许访问 iPhone 中的摄像头和麦克风 Apr 23, 2024 am 11:13 AM

您在尝试使用应用程序时是否收到“无法允许访问摄像头和麦克风”?通常,您可以在需要提供的基础上向特定对象授予摄像头和麦克风权限。但是,如果您拒绝权限,摄像头和麦克风将无法工作,而是显示此错误消息。解决这个问题是非常基本的,你可以在一两分钟内完成。修复1–提供相机、麦克风权限您可以直接在设置中提供必要的摄像头和麦克风权限。步骤1–转到“设置”选项卡。步骤2–打开“隐私与安全”面板。步骤3–在那里打开“相机”权限。步骤4–在里面,您将找到已请求手机相机权限的应用程序列表。步骤5–打开指定应用的“相机”

field在java中是什么意思 field在java中是什么意思 Apr 25, 2024 pm 10:18 PM

在Java中,"field"是类或接口中的数据成员,用于存储数据或状态。field的属性包括:类型(可为任何Java数据类型)、访问权限、static(属于类而非实例)、final(不可变)和transient(不序列化)。field用于存储类或接口的状态信息,例如存储对象数据和维护对象状态。

Java反射机制如何修改类的行为? Java反射机制如何修改类的行为? May 03, 2024 pm 06:15 PM

Java反射机制允许程序动态修改类的行为,无需修改源代码。通过Class对象操作类,可以通过newInstance()创建实例,修改私有字段值,调用私有方法等。但应谨慎使用反射,因为它可能会导致意外的行为和安全问题,并有性能开销。

oracle怎么读取dbf文件 oracle怎么读取dbf文件 May 10, 2024 am 01:27 AM

Oracle 可以通过以下步骤读取 dbf 文件:创建外部表,引用 dbf 文件;查询外部表,检索数据;将数据导入 Oracle 表。

内存条长什么样 内存条长什么样 Apr 21, 2024 pm 01:01 PM

电脑内存条长什么样这张是显卡和内存条在电脑里的总览。电脑的独立显卡是插在显卡插槽上的,带个风扇,内存条在电脑主板的内存条卡槽里边,绿色长方体形状。笔记本内存条和台式机内存条是不一样的,而且两者不能通用。外观区别1:台式机内存,细长,长度为13-14厘米。2:笔记本内存,较短,约五厘米左右。内存是电脑中的桥梁,负责处理器与硬盘、主板、显卡等硬件之间的数据交换。途中画红圈的地方是内存条,在CPU风扇旁边,插在内存条上。看,电脑记忆棒长这样。用螺丝刀打开台式电脑的盖子,途中的红圈就是内存条。内存条是什

Java 函数开发中常见的异常类型及其修复措施 Java 函数开发中常见的异常类型及其修复措施 May 03, 2024 pm 02:09 PM

Java函数开发中常见的异常类型及其修复措施在Java函数开发过程中,可能遇到各种异常,影响函数的正确执行。以下是常见的异常类型及其修复措施:1.NullPointerException描述:当访问一个还未初始化的对象时抛出。修复措施:确保在使用对象之前对其进行非空检查。示例代码:try{Stringname=null;System.out.println(name.length());}catch(NullPointerExceptione){

See all articles