{"id":1047,"date":"2013-11-22T13:22:58","date_gmt":"2013-11-22T05:22:58","guid":{"rendered":"http:\/\/www.dogeye.net\/?p=1047"},"modified":"2013-11-22T13:22:58","modified_gmt":"2013-11-22T05:22:58","slug":"packet-captured%e5%92%8cpacket-received-by-filter%e5%88%b0%e5%ba%95%e6%9c%89%e4%bb%80%e4%b9%88%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/ykyi.net\/?p=1047","title":{"rendered":"packet captured\u548cpacket received by filter\u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b"},"content":{"rendered":"<div>\n<p>\u6211\u7528\u7684\u662flinux.&nbsp;\u7ed3\u8bba\u662f packet received by filter\u662ftcpdump\u4ece\u5185\u6838\u4e2d\u62ff\u5230\u7684\u4e14\u5339\u914d\u547d\u4ee4\u4e0a\u884c\u6307\u5b9a\u7684\u8fc7\u6ee4\u6761\u4ef6\u7684\u5305\uff0c packet captured\u662f\u7ecf\u7531pcap_loop, \u6216&nbsp;<span style=\"font-size: 13px;\">pcap_dispatch \u6216 pcap_next\uff0c\u628a\u5305\u4ea4\u7ed9\u56de\u8c03\u5904\u7406\u8fc7\u7684\u5305\u7684\u6570\u91cf\u3002\u8fd9\u4e24\u4e2a\u6570\u5b57\u7684\u5dee\u503c\u662ftcpdump\u6293\u5230\u7684\uff0c\u8fd8\u6765\u4e0d\u53ca\u5904\u7406\u7684\u5305\u3002<\/span><\/p>\n<p><span style=\"font-size: 13px;\">\u4e0b\u9762\u662f\u8ba8\u8bba\u7684\u4e00\u4e9b\u7ec6\u8282:<\/span><\/p>\n<p>\/\/\/\/\/\/\/\/\/\/\/\/\/<\/p>\n<p>tcpdump\u7684\u6700\u540e\u8f93\u51fa.&nbsp;592\u4e2a\u5305captured,&nbsp;&nbsp;1184\u4e2a\u5305received&nbsp;by&nbsp;filter\u3002\u3002\u8fd9\u4e2a\u5dee\u503c\u662f\u4e0d\u662f\u8868\u793a\u6709\u591a\u5c11\u5305tcpdump\u6ca1\u6765\u5f97\u53ca\u5904\u7406.<\/p>\n<p>man&nbsp;tcpdump\u4e0a\u5199\u5f97\u597d\u590d\u6742\uff0creceived&nbsp;by&nbsp;filter\u7684\u6570\u5b57\u53d6\u51b3\u4e8eOS&#8230;&nbsp;1.&nbsp;\u5305\u5339\u914d\u4e0d\u5339\u914d\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u7684filter\u90fd\u7b97\uff0c\u5982\u679c\u5339\u914d\uff0c\u6709\u6ca1\u6709\u88abtcpdump\u8bfb\u51fa\u90fd\u7b97..&nbsp;&nbsp;&nbsp;2.&nbsp;\u53ea\u6709\u5339\u914d\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u7684filter\u7684\u5305\u624d\u7b97\uff0c\u6709\u6ca1\u6709\u88abtcpdump\u8bfb\u51fa\u90fd\u7b97.&nbsp;&nbsp;&nbsp;3.&nbsp;\u53ea\u6709\u5339\u914dfilter\u624d\u7b97\uff0c\u53ea\u6709\u88abtcpdump\u8bfb\u51fa\u624d\u7b97.<\/p>\n<p>\u6211\u7684\u7406\u89e3\u662f\uff1a\u5982\u679c\u662f\u7b2c3\u79cd\uff0c\u90a3captured\u7684\u6570\u5b57\u548creceived&nbsp;by&nbsp;filter\u7684\u6570\u5b57\u5c31\u662f\u4e00\u6837\u7684\u3002&nbsp;\u7b2c2\u79cd\u7684\u5dee\u503c\u8868\u793atcpdump\u6765\u4e0d\u53ca\u5904\u7406\u7684\u5305\u6570\u91cf\uff0c\u7406\u60f3\u72b6\u6001\u4e0a\u5dee\u503c\u80fd\u4e3a0.&nbsp;&nbsp;&nbsp;\u7b2c1\u79cd\u60c5\u51b5\uff0c\u57fa\u672c\u4e0a\u603b\u662f\u6709\u5dee\u503c\u3002<\/p>\n<p>\u6211\u731c\u6d4b\u6211\u7528\u7684linux\u4e0a\u5e94\u8be5\u662f\u7b2c2\u79cd\u60c5\u51b5.&nbsp;<\/p>\n<p>wangbin579()&nbsp;10:18:54&nbsp;<br \/>\n\t\t\u5e94\u8be5\u662f\u5339\u914d\u7684\u624d\u7b97received&nbsp;by&nbsp;filter\uff0c\u4f46\u5947\u602a\u7684\u662f\uff0c\u4e3a\u5565\u4f60\u7684\u7cfb\u7edf\uff0ccaptured\u600e\u4e48\u5c11\uff1f<br \/>\n\t\twangbin579()&nbsp;10:19:30&nbsp;<br \/>\n\t\t[root@hz0-12-157&nbsp;~]#&nbsp;tcpdump&nbsp;-i&nbsp;any&nbsp;tcp&nbsp;and&nbsp;port&nbsp;36524&nbsp;or&nbsp;3306&nbsp;-w&nbsp;all.pcap<br \/>\n\t\ttcpdump:&nbsp;listening&nbsp;on&nbsp;any,&nbsp;link-type&nbsp;LINUX_SLL&nbsp;(Linux&nbsp;cooked),&nbsp;capture&nbsp;size&nbsp;65535&nbsp;bytes<br \/>\n\t\t10757&nbsp;packets&nbsp;captured<br \/>\n\t\t11171&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter<br \/>\n\t\t334&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<br \/>\n\t\twangbin579()&nbsp;10:20:07&nbsp;<br \/>\n\t\t\u6211\u4eec\u8fd9\u8fb9\u7cfb\u7edf\uff0c\u57fa\u672c\u53ef\u4ee5\u8ba4\u4e3apackets&nbsp;received&nbsp;by&nbsp;filter=packets&nbsp;captured&nbsp;+&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<\/p>\n<p>siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:23:38&nbsp;<br \/>\n\t\t\/home<img loading=\"lazy\" decoding=\"async\" height=\"25\" src=\"file:\/\/\/C:\\Users\\KAMUSZ~1\\AppData\\Local\\Temp\\ksohtml\\wps_clip_image-14656.png\" width=\"25\" \/>mus\/tmp&nbsp;#&nbsp;time&nbsp;time&nbsp;tcpdump&nbsp;-i&nbsp;tunl0:1&nbsp;&nbsp;-w&nbsp;tmp<br \/>\n\t\ttcpdump:&nbsp;listening&nbsp;on&nbsp;tunl0:1,&nbsp;link-type&nbsp;RAW&nbsp;(Raw&nbsp;IP),&nbsp;capture&nbsp;size&nbsp;96&nbsp;bytes<br \/>\n\t\t19508&nbsp;packets&nbsp;captured<br \/>\n\t\t39021&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter<br \/>\n\t\t0&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<br \/>\n\t\t0.01user&nbsp;0.02system&nbsp;0:17.04elapsed&nbsp;0%CPU&nbsp;(0avgtext+0avgdata&nbsp;0maxresident)k<br \/>\n\t\t0inputs+0outputs&nbsp;(0major+506minor)pagefaults&nbsp;0swaps<\/p>\n<p>real&nbsp;&nbsp;&nbsp;&nbsp;0m17.139s<br \/>\n\t\tuser&nbsp;&nbsp;&nbsp;&nbsp;0m0.012s<br \/>\n\t\tsys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0m0.028s<br \/>\n\t\twangbin579()&nbsp;10:26:03&nbsp;<br \/>\n\t\t\u5982\u679c\u662f\u5dee\u662f\u4e22\u5305\uff0c\u90a3\u4e48\u901a\u8fc7\u67e5\u770b\u6293\u5305\u6587\u4ef6\uff0c\u5e94\u8be5\u80fd\u770b\u51fa\u5f88\u591a\u4e0d\u5b8c\u6574\u7684session<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:28:46&nbsp;<br \/>\n\t\t\u6211\u89c9\u5f97\u5dee\u503c\u662f\u6765\u4e0d\u53ca\u5199\u5165\u78c1\u76d8\u7684\u5305.<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:29:04&nbsp;<br \/>\n\t\t\u518d\u7814\u7a76\u770b\u770b\u4e86\u3002\u3002\u8c22\u8c22\u5566\/..<br \/>\n\t\twangbin579()&nbsp;10:30:03&nbsp;<br \/>\n\t\tpackets&nbsp;captured\u662fpcap_loop\u6240\u8bbe\u7f6e\u7684\u56de\u8c03\u51fd\u6570\u6240\u8c03\u7528\u7684\uff0c\u4e00\u65e6\u8c03\u7528\u56de\u8c03\u51fd\u6570\uff0c\u5c31\u7528\u7edf\u8ba1<br \/>\n\t\twangbin579()&nbsp;10:30:37&nbsp;<br \/>\n\t\t\u6709\u53ef\u80fd\u5185\u6838\u6001\u90e8\u5206\u548c\u7528\u6237\u6001\u90e8\u5206\uff0c\u901f\u5ea6\u4e0a\u4e0d\u5339\u914d\uff0c\u6709\u5ef6\u8fdf\u5bfc\u81f4\u7684\uff1f<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:32:33&nbsp;<br \/>\n\t\t\u6211\u73b0\u5728\u7406\u89e3,&nbsp;received&nbsp;by&nbsp;filter\u662fpcap\u5e93\u4ece\u5185\u6838\u4e2d\u62ff\u5230\u7684\u53c8\u5339\u914d\u547d\u4ee4\u884c\u4e0afilter\u7684\u5305\u7684\u6570\u91cf\uff0c&nbsp;packets&nbsp;captured\u662f\u7ecf\u7531pcap_loop,&nbsp;pcap_dispatch\u4e4b\u7c7b\u901a\u8fc7callback\u4ea4\u4ed8\u51fa\u53bb\u7684\u5305\u6570\u91cf.&nbsp;\u5dee\u503c\u5c31\u662f\u8fd8\u6ca1\u6765\u5f97\u53ca\u5904\u7406\u7684.<br \/>\n\t\twangbin579()&nbsp;10:32:48&nbsp;<br \/>\n\t\t17s\uff0c\u6bcf\u79d2\u4e5f\u5c312000\u591a\u4e2a\uff0c\u4e0d\u7b97\u591a\uff0c\u7528\u6237\u6001\u7a0b\u5e8f\u5e94\u8be5\u6765\u5f97\u53ca\u5904\u7406<\/p>\n<p>wangbin579()&nbsp;10:33:58&nbsp;<br \/>\n\t\t\u6211\u8fd9\u8fb9\u7cfb\u7edf\u5f88\u7834\uff0c\u5904\u7406\u901f\u5ea6\u4e5f\u6bd4\u8fd9\u4e2a\u5feb\uff0c\u4e5f\u6ca1\u6709\u6765\u4e0d\u53ca\u5904\u7406<br \/>\n\t\twangbin579()&nbsp;10:34:45&nbsp;<br \/>\n\t\t\u770b\u770b\u6211\u7684\uff1a<br \/>\n\t\twangbin579()&nbsp;10:34:47&nbsp;<br \/>\n\t\t[root@hz0-12-157&nbsp;~]#&nbsp;time&nbsp;tcpdump&nbsp;-i&nbsp;any&nbsp;tcp&nbsp;and&nbsp;port&nbsp;36524&nbsp;or&nbsp;3306&nbsp;-w&nbsp;3306.pcap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/>\n\t\ttcpdump:&nbsp;listening&nbsp;on&nbsp;any,&nbsp;link-type&nbsp;LINUX_SLL&nbsp;(Linux&nbsp;cooked),&nbsp;capture&nbsp;size&nbsp;65535&nbsp;bytes<br \/>\n\t\t294663&nbsp;packets&nbsp;captured<br \/>\n\t\t295432&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter<br \/>\n\t\t693&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<\/p>\n<p>real&nbsp;&nbsp;&nbsp;&nbsp;0m17.676s<br \/>\n\t\tuser&nbsp;&nbsp;&nbsp;&nbsp;0m0.897s<br \/>\n\t\tsys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0m3.502s<br \/>\n\t\twangbin579()&nbsp;10:35:52&nbsp;<br \/>\n\t\t\u91cf\u6bd4\u4f60\u59277\u500d\u591a\uff0c\u4e5f\u6ca1\u6709\u51fa\u73b0\u6765\u4e0d\u53ca\u5904\u7406\u554a\uff0c\u5f53\u7136\u6211\u7684\u662f\u7269\u7406\u673a\uff0c3G\u5185\u5b58\uff0c<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:36:59&nbsp;<br \/>\n\t\t\u5443<img loading=\"lazy\" decoding=\"async\" height=\"25\" src=\"file:\/\/\/C:\\Users\\KAMUSZ~1\\AppData\\Local\\Temp\\ksohtml\\wps_clip_image-30198.png\" width=\"25\" \/>&nbsp;\u90a3\u4f60\u89c9\u5f97\u8fd9\u4e2a\u5dee\u503c\u4e0d\u662f\u6765\u4e0d\u53ca\u5904\u7406\u7684\u5305\u4e48\uff1f\u3002\u6211\u89c9\u5f97\u5e94\u8be5\u8fd8\u662f\u6765\u4e0d\u53ca\u5904\u7406\u7684\u3002\u6211\u5728\u60f3\uff0c\u53ef\u80fd\u662f\u5199\u5230\u7684\u78c1\u76d8\u6587\u4ef6\u7cfb\u7edf\u662fNFS\u4e4b\u7c7b\u7684&nbsp;&#8230;.\u6211\u7ee7\u7eed\u6392\u67e5\u4e00\u4e0b\u3002<br \/>\n\t\twangbin579()&nbsp;10:37:43&nbsp;<br \/>\n\t\t\u6709\u53ef\u80fd\uff0c\u6211\u7684\u662f\u5199\u5165\u672c\u5730\u78c1\u76d8\u3002<br \/>\n\t\twangbin579()&nbsp;10:37:58&nbsp;<br \/>\n\t\t\u4f60\u8fd9\u79cd\u60c5\u51b5\uff0c\u6211\u8fd8\u662f\u7b2c\u4e00\u6b21\u78b0\u5230<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:39:05&nbsp;<br \/>\n\t\t\u6211\u5148\u53bb\u8fd0\u7ef4\u90a3\u8fb9\u4e86\u89e3\u4e0b\u60c5\u51b5&#8230;\u591a\u8c22\u5566&nbsp;<img loading=\"lazy\" decoding=\"async\" height=\"25\" src=\"file:\/\/\/C:\\Users\\KAMUSZ~1\\AppData\\Local\\Temp\\ksohtml\\wps_clip_image-16870.png\" width=\"25\" \/><br \/>\n\t\twangbin579()&nbsp;10:39:18&nbsp;<br \/>\n\t\t\u7b97\u6da8\u89c1\u8bc6\u4e86\uff0c\u8fd8\u4ee5\u4e3a\u4e00\u822cdropped&nbsp;by&nbsp;kernel\u4e3a0\u5c31\u4ee3\u8868\u4e0d\u4e22\u5305\u5462\uff0c\u5c45\u7136\u8fd8\u6709\u4f60\u8fd9\u79cd\u60c5\u51b5\u3002<br \/>\n\t\t\u4f60\u53ef\u4ee5\u770b\u770b\u6293\u5305\u6587\u4ef6\uff0csession\u662f\u4e0d\u662f\u5f88\u591a\u4e0d\u5b8c\u6574\uff0c\u5982\u679c\u4e0d\u5b8c\u6574\uff0c\u4f60\u7684\u63a8\u6d4b\u662f\u5bf9\u7684<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:39:58&nbsp;<br \/>\n\t\t\u55ef\u3002\u5475\u5475~~&nbsp;\u505aIT\uff0c\u6bcf\u5929\u90fd\u4f1a\u78b0\u5230\u6311\u6218\u5b87\u5b99\u89c4\u5f8b\u7684\u73b0\u8c61\u3002<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:40:07&nbsp;<br \/>\n\t\t<img loading=\"lazy\" decoding=\"async\" height=\"25\" src=\"file:\/\/\/C:\\Users\\KAMUSZ~1\\AppData\\Local\\Temp\\ksohtml\\wps_clip_image-6803.png\" width=\"25\" \/><br \/>\n\t\t\u043ce(\uff5e&nbsp;o&nbsp;\u043ce(632813052)&nbsp;10:41:09&nbsp;<br \/>\n\t\t\u5475\u5475<br \/>\n\t\twangbin579()&nbsp;10:41:24&nbsp;<br \/>\n\t\t\u5176\u5b9e\uff0c\u7f51\u7edc\u65b9\u9762\u7684\u95ee\u9898\uff0c\u6700\u590d\u6742\u4e86\u3002<br \/>\n\t\t\u6211\u73b0\u5728\u5df2\u7ecf\u9677\u5165\u5230\u7f51\u7edc\u7684\u6c6a\u6d0b\u5927\u6d77\u4e4b\u4e2d\u4e86\uff0c\u5404\u79cd\u5404\u6837\u7684\u95ee\u9898\u90fd\u4f1a\u6709\uff0c\u800c\u4e14\u6ca1\u6709\u5c3d\u5934\u3002<br \/>\n\t\t\u65e9\u77e5\u9053\u5982\u6b64\uff0c3\u5e74\u524d\u6211\u5c31\u4e0d\u641e\u8fd9\u4e00\u5757\u4e86<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:42:30&nbsp;<br \/>\n\t\t\u540c\u611f\u3002\u5199\u4e00\u70b9\u70b9\u4ee3\u7801\uff0c\u90fd\u975e\u5e38\u96be\u4ee5\u8c03\u8bd5\u3002\u5404\u79cd\u8ba4\u4e3a\u7406\u6240\u5f53\u7136\u7684\u5047\u8bbe\uff0c\u901a\u901a\u662fbug\u7684\u6e29\u5e8a<\/p>\n<p>@wangbin579&nbsp;&nbsp;\u9ebb\u70e6\u4f60\u5728tcpdump\u524d\u52a0\u4e2atime\uff0c\u3002\u3002\u628a\u8f93\u51fa\u8d34\u51fa\u6765\u3002\u6211\u597d\u50cf\u770b\u51fa\u95ee\u9898\u6765\u4e86\u3002<\/p>\n<p>[root@hz0-12-157&nbsp;~]#&nbsp;time&nbsp;tcpdump&nbsp;-i&nbsp;any&nbsp;tcp&nbsp;and&nbsp;port&nbsp;36524&nbsp;or&nbsp;3306&nbsp;-w&nbsp;3306.pcap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/>\n\t\ttcpdump:&nbsp;listening&nbsp;on&nbsp;any,&nbsp;link-type&nbsp;LINUX_SLL&nbsp;(Linux&nbsp;cooked),&nbsp;capture&nbsp;size&nbsp;65535&nbsp;bytes<br \/>\n\t\t294663&nbsp;packets&nbsp;captured<br \/>\n\t\t295432&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter<br \/>\n\t\t693&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<\/p>\n<p>real&nbsp;&nbsp;&nbsp;&nbsp;0m17.676s<br \/>\n\t\tuser&nbsp;&nbsp;&nbsp;&nbsp;0m0.897s<br \/>\n\t\tsys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0m3.502s<br \/>\n\t\twangbin579()&nbsp;10:56:03&nbsp;<br \/>\n\t\t\u4e0d\u662f\u52a0\u4e86time\u4e86\u5417\uff1f<br \/>\n\t\twangbin579()&nbsp;10:57:15&nbsp;<br \/>\n\t\t[root@hz0-12-157&nbsp;~]#&nbsp;time&nbsp;time&nbsp;tcpdump&nbsp;-i&nbsp;any&nbsp;tcp&nbsp;and&nbsp;port&nbsp;36524&nbsp;or&nbsp;3306&nbsp;-w&nbsp;3306.pcap<br \/>\n\t\ttcpdump:&nbsp;listening&nbsp;on&nbsp;any,&nbsp;link-type&nbsp;LINUX_SLL&nbsp;(Linux&nbsp;cooked),&nbsp;capture&nbsp;size&nbsp;65535&nbsp;bytes<br \/>\n\t\t^C202061&nbsp;packets&nbsp;captured<br \/>\n\t\t202523&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter<br \/>\n\t\t369&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel<br \/>\n\t\t0.66user&nbsp;2.50system&nbsp;0:11.99elapsed&nbsp;26%CPU&nbsp;(0avgtext+0avgdata&nbsp;24208maxresident)k<br \/>\n\t\t0inputs+105656outputs&nbsp;(0major+660minor)pagefaults&nbsp;0swaps<\/p>\n<p>real&nbsp;&nbsp;&nbsp;&nbsp;0m11.999s<br \/>\n\t\tuser&nbsp;&nbsp;&nbsp;&nbsp;0m0.661s<br \/>\n\t\tsys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0m2.506s<br \/>\n\t\twangbin579()&nbsp;10:57:26&nbsp;<br \/>\n\t\t\u52a0\u4e24\u4e2a\uff0c\u7ed3\u679c\u5982\u4e0a<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:59:29&nbsp;<br \/>\n\t\t\u95ee\u9898\u627e\u5230\u7684\u3002\u6211\u8fd9\u8fb9\u8fd0\u884c\u7684tcpdump\uff0c\u6839\u672c\u5c31\u6ca1\u6709\u62a2\u5230cpu\u65f6\u95f4\u6765\u5904\u7406.<br \/>\n\t\twangbin579()&nbsp;11:00:05&nbsp;<br \/>\n\t\t<img loading=\"lazy\" decoding=\"async\" height=\"25\" src=\"file:\/\/\/C:\\Users\\KAMUSZ~1\\AppData\\Local\\Temp\\ksohtml\\wps_clip_image-21252.png\" width=\"25\" \/><br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;11:00:06&nbsp;<\/p>\n<p>Real&nbsp;&nbsp;0m3.914s<\/p>\n<p>User&nbsp;&nbsp;0m0.008s<\/p>\n<p>Sys&nbsp;&nbsp;&nbsp;0m0.000s<\/p>\n<p>\u8dd1\u4e864\u79d2\u949f\uff0c\u7528\u6237\u7a7a\u95f4\u624d\u62a2\u52300.008\u79d2\uff0c\u5185\u6838\u6001\u51e0\u4e4e\u662f0&nbsp;&#8230;.<br \/>\n\t\tsiu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;11:00:25&nbsp;<br \/>\n\t\t\u90a3\u4e2a\u5dee\u503c\u786e\u5b9e\u662f\u6ca1\u6709\u6765\u5f97\u53ca\u5904\u7406\u7684\u5305\u7684\u6570\u91cf\u3002<br \/>\n\t\twangbin579()&nbsp;11:00:41&nbsp;<br \/>\n\t\t\u5965\uff0c\u90a3\u4f60\u7cfb\u7edf\u8fd9\u4e48\u7e41\u5fd9\u554a<\/p>\n<p>siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;11:02:22&nbsp;<br \/>\n\t\t\u6240\u4ee5\uff0c\u89e3\u51b3\u4e86\u4e00\u4e2a\u95ee\u9898\u53c8\u4f1a\u6709\u65b0\u7684\u98a0\u8986\u5b87\u5b99\u89c4\u5f8b\u7684\u95ee\u9898&#8230;\u7cfb\u7edf\u8d1f\u8f7d\u5f88\u9ad8\uff0c\u4f46cpu\u4f7f\u7528\u7387\u5f88\u4f4e\u3002\u3002<\/p>\n<p><span style=\"color: rgb(0, 0, 0); font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22px;\">copyright ykyi.net<\/span><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u7528\u7684\u662flinux.&nbsp;\u7ed3\u8bba\u662f packet received by filter\u662ftcpdump\u4ece\u5185\u6838\u4e2d\u62ff\u5230\u7684\u4e14\u5339\u914d\u547d\u4ee4\u4e0a\u884c\u6307\u5b9a\u7684\u8fc7\u6ee4\u6761\u4ef6\u7684\u5305\uff0c packet captured\u662f\u7ecf\u7531pcap_loop, \u6216&nbsp;pcap_dispatch \u6216 pcap_next\uff0c\u628a\u5305\u4ea4\u7ed9\u56de\u8c03\u5904\u7406\u8fc7\u7684\u5305\u7684\u6570\u91cf\u3002\u8fd9\u4e24\u4e2a\u6570\u5b57\u7684\u5dee\u503c\u662ftcpdump\u6293\u5230\u7684\uff0c\u8fd8\u6765\u4e0d\u53ca\u5904\u7406\u7684\u5305\u3002 \u4e0b\u9762\u662f\u8ba8\u8bba\u7684\u4e00\u4e9b\u7ec6\u8282: \/\/\/\/\/\/\/\/\/\/\/\/\/ tcpdump\u7684\u6700\u540e\u8f93\u51fa.&nbsp;592\u4e2a\u5305captured,&nbsp;&nbsp;1184\u4e2a\u5305received&nbsp;by&nbsp;filter\u3002\u3002\u8fd9\u4e2a\u5dee\u503c\u662f\u4e0d\u662f\u8868\u793a\u6709\u591a\u5c11\u5305tcpdump\u6ca1\u6765\u5f97\u53ca\u5904\u7406. man&nbsp;tcpdump\u4e0a\u5199\u5f97\u597d\u590d\u6742\uff0creceived&nbsp;by&nbsp;filter\u7684\u6570\u5b57\u53d6\u51b3\u4e8eOS&#8230;&nbsp;1.&nbsp;\u5305\u5339\u914d\u4e0d\u5339\u914d\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u7684filter\u90fd\u7b97\uff0c\u5982\u679c\u5339\u914d\uff0c\u6709\u6ca1\u6709\u88abtcpdump\u8bfb\u51fa\u90fd\u7b97..&nbsp;&nbsp;&nbsp;2.&nbsp;\u53ea\u6709\u5339\u914d\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u7684filter\u7684\u5305\u624d\u7b97\uff0c\u6709\u6ca1\u6709\u88abtcpdump\u8bfb\u51fa\u90fd\u7b97.&nbsp;&nbsp;&nbsp;3.&nbsp;\u53ea\u6709\u5339\u914dfilter\u624d\u7b97\uff0c\u53ea\u6709\u88abtcpdump\u8bfb\u51fa\u624d\u7b97. \u6211\u7684\u7406\u89e3\u662f\uff1a\u5982\u679c\u662f\u7b2c3\u79cd\uff0c\u90a3captured\u7684\u6570\u5b57\u548creceived&nbsp;by&nbsp;filter\u7684\u6570\u5b57\u5c31\u662f\u4e00\u6837\u7684\u3002&nbsp;\u7b2c2\u79cd\u7684\u5dee\u503c\u8868\u793atcpdump\u6765\u4e0d\u53ca\u5904\u7406\u7684\u5305\u6570\u91cf\uff0c\u7406\u60f3\u72b6\u6001\u4e0a\u5dee\u503c\u80fd\u4e3a0.&nbsp;&nbsp;&nbsp;\u7b2c1\u79cd\u60c5\u51b5\uff0c\u57fa\u672c\u4e0a\u603b\u662f\u6709\u5dee\u503c\u3002 \u6211\u731c\u6d4b\u6211\u7528\u7684linux\u4e0a\u5e94\u8be5\u662f\u7b2c2\u79cd\u60c5\u51b5.&nbsp; wangbin579()&nbsp;10:18:54&nbsp; \u5e94\u8be5\u662f\u5339\u914d\u7684\u624d\u7b97received&nbsp;by&nbsp;filter\uff0c\u4f46\u5947\u602a\u7684\u662f\uff0c\u4e3a\u5565\u4f60\u7684\u7cfb\u7edf\uff0ccaptured\u600e\u4e48\u5c11\uff1f wangbin579()&nbsp;10:19:30&nbsp; [root@hz0-12-157&nbsp;~]#&nbsp;tcpdump&nbsp;-i&nbsp;any&nbsp;tcp&nbsp;and&nbsp;port&nbsp;36524&nbsp;or&nbsp;3306&nbsp;-w&nbsp;all.pcap tcpdump:&nbsp;listening&nbsp;on&nbsp;any,&nbsp;link-type&nbsp;LINUX_SLL&nbsp;(Linux&nbsp;cooked),&nbsp;capture&nbsp;size&nbsp;65535&nbsp;bytes 10757&nbsp;packets&nbsp;captured 11171&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter 334&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel wangbin579()&nbsp;10:20:07&nbsp; \u6211\u4eec\u8fd9\u8fb9\u7cfb\u7edf\uff0c\u57fa\u672c\u53ef\u4ee5\u8ba4\u4e3apackets&nbsp;received&nbsp;by&nbsp;filter=packets&nbsp;captured&nbsp;+&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:23:38&nbsp; \/homemus\/tmp&nbsp;#&nbsp;time&nbsp;time&nbsp;tcpdump&nbsp;-i&nbsp;tunl0:1&nbsp;&nbsp;-w&nbsp;tmp tcpdump:&nbsp;listening&nbsp;on&nbsp;tunl0:1,&nbsp;link-type&nbsp;RAW&nbsp;(Raw&nbsp;IP),&nbsp;capture&nbsp;size&nbsp;96&nbsp;bytes 19508&nbsp;packets&nbsp;captured 39021&nbsp;packets&nbsp;received&nbsp;by&nbsp;filter 0&nbsp;packets&nbsp;dropped&nbsp;by&nbsp;kernel 0.01user&nbsp;0.02system&nbsp;0:17.04elapsed&nbsp;0%CPU&nbsp;(0avgtext+0avgdata&nbsp;0maxresident)k 0inputs+0outputs&nbsp;(0major+506minor)pagefaults&nbsp;0swaps real&nbsp;&nbsp;&nbsp;&nbsp;0m17.139s user&nbsp;&nbsp;&nbsp;&nbsp;0m0.012s sys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0m0.028s wangbin579()&nbsp;10:26:03&nbsp; \u5982\u679c\u662f\u5dee\u662f\u4e22\u5305\uff0c\u90a3\u4e48\u901a\u8fc7\u67e5\u770b\u6293\u5305\u6587\u4ef6\uff0c\u5e94\u8be5\u80fd\u770b\u51fa\u5f88\u591a\u4e0d\u5b8c\u6574\u7684session siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:28:46&nbsp; \u6211\u89c9\u5f97\u5dee\u503c\u662f\u6765\u4e0d\u53ca\u5199\u5165\u78c1\u76d8\u7684\u5305. siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:29:04&nbsp; \u518d\u7814\u7a76\u770b\u770b\u4e86\u3002\u3002\u8c22\u8c22\u5566\/.. wangbin579()&nbsp;10:30:03&nbsp; packets&nbsp;captured\u662fpcap_loop\u6240\u8bbe\u7f6e\u7684\u56de\u8c03\u51fd\u6570\u6240\u8c03\u7528\u7684\uff0c\u4e00\u65e6\u8c03\u7528\u56de\u8c03\u51fd\u6570\uff0c\u5c31\u7528\u7edf\u8ba1 wangbin579()&nbsp;10:30:37&nbsp; \u6709\u53ef\u80fd\u5185\u6838\u6001\u90e8\u5206\u548c\u7528\u6237\u6001\u90e8\u5206\uff0c\u901f\u5ea6\u4e0a\u4e0d\u5339\u914d\uff0c\u6709\u5ef6\u8fdf\u5bfc\u81f4\u7684\uff1f siu&sup1;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;&ordm;()&nbsp;10:32:33&nbsp; \u6211\u73b0\u5728\u7406\u89e3,&nbsp;received&nbsp;by&nbsp;filter\u662fpcap\u5e93\u4ece\u5185\u6838\u4e2d\u62ff\u5230\u7684\u53c8\u5339\u914d\u547d\u4ee4\u884c\u4e0afilter\u7684\u5305\u7684\u6570\u91cf\uff0c&nbsp;packets&nbsp;captured\u662f\u7ecf\u7531pcap_loop,&nbsp;pcap_dispatch\u4e4b\u7c7b\u901a\u8fc7callback\u4ea4\u4ed8\u51fa\u53bb\u7684\u5305\u6570\u91cf.&nbsp;\u5dee\u503c\u5c31\u662f\u8fd8\u6ca1\u6765\u5f97\u53ca\u5904\u7406\u7684. wangbin579()&nbsp;10:32:48&nbsp; 17s\uff0c\u6bcf\u79d2\u4e5f\u5c312000\u591a\u4e2a\uff0c\u4e0d\u7b97\u591a\uff0c\u7528\u6237\u6001\u7a0b\u5e8f\u5e94\u8be5\u6765\u5f97\u53ca\u5904\u7406 wangbin579()&nbsp;10:33:58&nbsp; \u6211\u8fd9\u8fb9\u7cfb\u7edf\u5f88\u7834\uff0c\u5904\u7406\u901f\u5ea6\u4e5f\u6bd4\u8fd9\u4e2a\u5feb\uff0c\u4e5f\u6ca1\u6709\u6765\u4e0d\u53ca\u5904\u7406 wangbin579()&nbsp;10:34:45&nbsp; \u770b\u770b\u6211\u7684\uff1a &hellip; <a href=\"https:\/\/ykyi.net\/?p=1047\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;packet captured\u548cpacket received by filter\u5230\u5e95\u6709\u4ec0\u4e48\u533a\u522b&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[78],"class_list":["post-1047","post","type-post","status-publish","format-standard","hentry","category-unix_linux","tag-tcpdump"],"_links":{"self":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/1047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1047"}],"version-history":[{"count":0,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/1047\/revisions"}],"wp:attachment":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}