{"id":112,"date":"2010-09-28T21:31:00","date_gmt":"2010-09-28T13:31:00","guid":{"rendered":"http:\/\/31.0.2.219:81\/?p=112"},"modified":"2014-03-11T12:58:10","modified_gmt":"2014-03-11T04:58:10","slug":"wireshark-%e8%bf%87%e6%bb%a4%e8%af%ad%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.huike007.cn\/?p=112","title":{"rendered":"WireShark \u8fc7\u6ee4\u8bed\u6cd5"},"content":{"rendered":"<p>hcorecore \u7684 WireShark \u8fc7\u6ee4\u8bed\u6cd5<br \/>\n\/* WireShark \u8fc7\u6ee4\u8bed\u6cd5 *\/<br \/>\n1.<br \/>\n\u8fc7\u6ee4IP\uff0c\u5982\u6765\u6e90IP\u6216\u8005\u76ee\u6807IP\u7b49\u4e8e\u67d0\u4e2aIP<br \/>\n\u4f8b\u5b50:<br \/>\nip.src eq 192.168.1.107 o&#114; ip.dst eq 192.168.1.107<br \/>\n\u6216\u8005<br \/>\nip.addr eq 192.168.1.107 \/\/ \u90fd\u80fd\u663e\u793a\u6765\u6e90IP\u548c\u76ee\u6807IP<br \/>\n2.<br \/>\n\u8fc7\u6ee4\u7aef\u53e3<br \/>\n\u4f8b\u5b50:<br \/>\ntcp.port eq 80 \/\/ \u4e0d\u7ba1\u7aef\u53e3\u662f\u6765\u6e90\u7684\u8fd8\u662f\u76ee\u6807\u7684\u90fd\u663e\u793a<br \/>\ntcp.port == 80<br \/>\ntcp.port eq 2722<br \/>\ntcp.port eq 80 o&#114; udp.port eq 80<br \/>\ntcp.dstport == 80 \/\/ \u53ea\u663etcp\u534f\u8bae\u7684\u76ee\u6807\u7aef\u53e380<br \/>\ntcp.srcport == 80 \/\/ \u53ea\u663etcp\u534f\u8bae\u7684\u6765\u6e90\u7aef\u53e380<br \/>\nudp.port eq 15000<br \/>\n\u8fc7\u6ee4\u7aef\u53e3\u8303\u56f4<br \/>\ntcp.port &gt;= 1 and tcp.port &lt;= 80<br \/>\n3.<br \/>\n\u8fc7\u6ee4\u534f\u8bae<br \/>\n\u4f8b\u5b50:<br \/>\ntcp<br \/>\nudp<br \/>\narp<br \/>\nicmp<br \/>\nhttp<br \/>\nsmtp<br \/>\nftp<br \/>\ndns<br \/>\nmsnms<br \/>\nip<br \/>\nssl<br \/>\noicq<br \/>\nbootp<br \/>\n\u7b49\u7b49<br \/>\n\u6392\u9664arp\u5305\uff0c\u5982!arp  \u6216\u8005  not arp<br \/>\n4.<br \/>\n\u8fc7\u6ee4MAC<br \/>\n\u592a\u4ee5\u7f51\u5934\u8fc7\u6ee4<br \/>\neth.dst == A0:00:00:04:C5:84 \/\/ \u8fc7\u6ee4\u76ee\u6807mac<br \/>\neth.src eq A0:00:00:04:C5:84 \/\/ \u8fc7\u6ee4\u6765\u6e90mac<br \/>\neth.dst==A0:00:00:04:C5:84<br \/>\neth.dst==A0-00-00-04-C5-84<br \/>\neth.addr eq A0:00:00:04:C5:84 \/\/ \u8fc7\u6ee4\u6765\u6e90MAC\u548c\u76ee\u6807MAC\u90fd\u7b49\u4e8eA0:00:00:04:C5:84\u7684<br \/>\nless than \u5c0f\u4e8e &lt; lt<br \/>\n\u5c0f\u4e8e\u7b49\u4e8e le<br \/>\n\u7b49\u4e8e eq<br \/>\n\u5927\u4e8e gt<br \/>\n\u5927\u4e8e\u7b49\u4e8e ge<br \/>\n\u4e0d\u7b49 ne<br \/>\n5.<br \/>\n\u5305\u957f\u5ea6\u8fc7\u6ee4<br \/>\n\u4f8b\u5b50:<br \/>\nudp.length == 26 \u8fd9\u4e2a\u957f\u5ea6\u662f\u6307udp\u672c\u8eab\u56fa\u5b9a\u957f\u5ea68\u52a0\u4e0audp\u4e0b\u9762\u90a3\u5757\u6570\u636e\u5305\u4e4b\u548c<br \/>\ntcp.len &gt;= 7  \u6307\u7684\u662fip\u6570\u636e\u5305(tcp\u4e0b\u9762\u90a3\u5757\u6570\u636e),\u4e0d\u5305\u62ectcp\u672c\u8eab<br \/>\nip.len == 94 \u9664\u4e86\u4ee5\u592a\u7f51\u5934\u56fa\u5b9a\u957f\u5ea614,\u5176\u5b83\u90fd\u7b97\u662fip.len,\u5373\u4eceip\u672c\u8eab\u5230\u6700\u540e<br \/>\nframe.len == 119 \u6574\u4e2a\u6570\u636e\u5305\u957f\u5ea6,\u4eceeth\u5f00\u59cb\u5230\u6700\u540e<br \/>\neth &#8212;&gt; ip o&#114; arp &#8212;&gt; tcp o&#114; udp &#8212;&gt; data<br \/>\n6.<br \/>\nhttp\u6a21\u5f0f\u8fc7\u6ee4<br \/>\n\u4f8b\u5b50:<br \/>\nhttp.request.method == &#34;GET&#34;<br \/>\nhttp.request.method == &#34;POST&#34;<br \/>\nhttp.request.uri == &#34;\/img\/logo-edu.gif&#34;<br \/>\nhttp contains &#34;GET&#34;<br \/>\nhttp contains &#34;HTTP\/1.&#34;<br \/>\n\/\/ GET\u5305<br \/>\nhttp.request.method == &#34;GET&#34; &amp;&amp; http contains &#34;Host: &#34;<br \/>\nhttp.request.method == &#34;GET&#34; &amp;&amp; http contains &#34;User-Agent: &#34;<br \/>\n\/\/ POST\u5305<br \/>\nhttp.request.method == &#34;POST&#34; &amp;&amp; http contains &#34;Host: &#34;<br \/>\nhttp.request.method == &#34;POST&#34; &amp;&amp; http contains &#34;User-Agent: &#34;<br \/>\n\/\/ \u54cd\u5e94\u5305<br \/>\nhttp contains &#34;HTTP\/1.1 200 OK&#34; &amp;&amp; http contains &#34;Content-Type: &#34;<br \/>\nhttp contains &#34;HTTP\/1.0 200 OK&#34; &amp;&amp; http contains &#34;Content-Type: &#34;<br \/>\n\u4e00\u5b9a\u5305\u542b\u5982\u4e0b<br \/>\nContent-Type:<br \/>\n7.<br \/>\nTCP\u53c2\u6570\u8fc7\u6ee4<br \/>\ntcp.flags \u663e\u793a\u5305\u542bTCP\u6807\u5fd7\u7684\u5c01\u5305\u3002<br \/>\ntcp.flags.syn == 0x02    \u663e\u793a\u5305\u542bTCP SYN\u6807\u5fd7\u7684\u5c01\u5305\u3002<br \/>\ntcp.window_size == 0 &amp;&amp; tcp.flags.reset != 1<br \/>\n8.<br \/>\n\u8fc7\u6ee4\u5185\u5bb9<br \/>\ntcp[20]\u8868\u793a\u4ece20\u5f00\u59cb\uff0c\u53d61\u4e2a\u5b57\u7b26<br \/>\ntcp[20:]\u8868\u793a\u4ece20\u5f00\u59cb\uff0c\u53d61\u4e2a\u5b57\u7b26\u4ee5\u4e0a<br \/>\ntcp[20:8]\u8868\u793a\u4ece20\u5f00\u59cb\uff0c\u53d68\u4e2a\u5b57\u7b26<br \/>\ntcp[offset,n]<br \/>\nudp[8:3]==81:60:03 \/\/ \u504f\u79fb8\u4e2abytes,\u518d\u53d63\u4e2a\u6570\uff0c\u662f\u5426\u4e0e==\u540e\u9762\u7684\u6570\u636e\u76f8\u7b49\uff1f<br \/>\nudp[8:1]==32  \u5982\u679c\u6211\u731c\u7684\u6ca1\u6709\u9519\u7684\u8bdd\uff0c\u5e94\u8be5\u662fudp[offset:\u622a\u53d6\u4e2a\u6570]=nValue<br \/>\neth.addr[0:3]==00:06:5B<br \/>\n\u4f8b\u5b50:<br \/>\n\u5224\u65adupd\u4e0b\u9762\u90a3\u5757\u6570\u636e\u5305\u524d\u4e09\u4e2a\u662f\u5426\u7b49\u4e8e0x20 0x21 0x22<br \/>\n\u6211\u4eec\u90fd\u77e5\u9053udp\u56fa\u5b9a\u957f\u5ea6\u4e3a8<br \/>\nudp[8:3]==20:21:22<br \/>\n\u5224\u65adtcp\u90a3\u5757\u6570\u636e\u5305\u524d\u4e09\u4e2a\u662f\u5426\u7b49\u4e8e0x20 0x21 0x22<br \/>\ntcp\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u957f\u5ea6\u4e3a20,\u4f46\u4e5f\u6709\u4e0d\u662f20\u7684\u65f6\u5019<br \/>\ntcp[8:3]==20:21:22<br \/>\n\u5982\u679c\u60f3\u5f97\u5230\u6700\u51c6\u786e\u7684\uff0c\u5e94\u8be5\u5148\u77e5\u9053tcp\u957f\u5ea6<br \/>\nmatches(\u5339\u914d)\u548ccontains(\u5305\u542b\u67d0\u5b57\u7b26\u4e32)\u8bed\u6cd5<br \/>\nip.src==192.168.1.107 and udp[8:5] matches &#34;\\\\x02\\\\x12\\\\x21\\\\x00\\\\x22&#34;<br \/>\nip.src==192.168.1.107 and udp contains 02:12:21:00:22<br \/>\nip.src==192.168.1.107 and tcp contains &#34;GET&#34;<br \/>\nudp contains 7c:7c:7d:7d \u5339\u914dpayload\u4e2d\u542b\u67090x7c7c7d7d\u7684UDP\u6570\u636e\u5305\uff0c\u4e0d\u4e00\u5b9a\u662f\u4ece\u7b2c\u4e00\u5b57\u8282\u5339\u914d\u3002<br \/>\n\u4f8b\u5b50:<br \/>\n\u5f97\u5230\u672c\u5730qq\u767b\u9646\u6570\u636e\u5305(\u5224\u65ad\u6761\u4ef6\u662f\u7b2c\u4e00\u4e2a\u5305==0x02,\u7b2c\u56db\u548c\u7b2c\u4e94\u4e2a\u5305\u7b49\u4e8e0x00x22,\u6700\u540e\u4e00\u4e2a\u5305\u7b49\u4e8e0x03)<br \/>\n0x02 xx xx 0x00 0x22 &#8230; 0x03<br \/>\n\u6b63\u786e<br \/>\noicq and udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff][\\\\x00-\\\\xff]\\\\x00\\\\x22[\\\\x00-\\\\xff]+\\\\x03$&#34;<br \/>\noicq and udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]{2}\\\\x00\\\\x22[\\\\x00-\\\\xff]+\\\\x03$&#34; \/\/ \u767b\u9646\u5305<br \/>\noicq and (udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]{2}\\\\x03$&#34; o&#114; tcp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]{2}\\\\x03$&#34;)<br \/>\noicq and (udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]{2}\\\\x00\\\\x22[\\\\x00-\\\\xff]+\\\\x03$&#34; o&#114; tcp[20:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]{2}\\\\x00\\\\x22[\\\\x00-\\\\xff]+\\\\x03$&#34;)<br \/>\n\u4e0d\u5355\u5355\u662f00:22\u624d\u6709QQ\u53f7\u7801,\u5176\u5b83\u7684\u5305\u4e5f\u6709,\u8981\u6ee1\u8db3\u4e0b\u9762\u6761\u4ef6(tcp\u4e5f\u6709\uff0c\u4f46\u6ca1\u6709\u505a):<br \/>\noicq and udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]+\\\\x03$&#34; and !(udp[11:2]==00:00) and !(udp[11:2]==00:80)<br \/>\noicq and udp[8:] matches &#34;^\\\\x02[\\\\x00-\\\\xff]+\\\\x03$&#34; and !(udp[11:2]==00:00) and !(udp[15:4]==00:00:00:00)<br \/>\n\u8bf4\u660e:<br \/>\nudp[15:4]==00:00:00:00 \u8868\u793aQQ\u53f7\u7801\u4e3a\u7a7a<br \/>\nudp[11:2]==00:00 \u8868\u793a\u547d\u4ee4\u7f16\u53f7\u4e3a00:00<br \/>\nudp[11:2]==00:80 \u8868\u793a\u547d\u4ee4\u7f16\u53f7\u4e3a00:80<br \/>\n\u5f53\u547d\u4ee4\u7f16\u53f7\u4e3a00:80\u65f6\uff0cQQ\u53f7\u7801\u4e3a00:00:00:00<br \/>\n\u5f97\u5230msn\u767b\u9646\u6210\u529f\u8d26\u53f7(\u5224\u65ad\u6761\u4ef6\u662f&#34;USR 7 OK &#34;,\u5373\u524d\u4e09\u4e2a\u7b49\u4e8eUSR\uff0c\u518d\u901a\u8fc7\u4e24\u4e2a0x20\uff0c\u5c31\u5230OK,OK\u540e\u9762\u662f\u4e00\u4e2a\u5b57\u7b260x20,\u540e\u9762\u5c31\u662fmail\u4e86)<br \/>\nUSR xx OK mail@hotmail.com<br \/>\n\u6b63\u786e<br \/>\nmsnms and tcp and ip.addr==192.168.1.107 and tcp[20:] matches &#34;^USR\\\\x20[\\\\x30-\\\\x39]+\\\\x20OK\\\\x20[\\\\x00-\\\\xff]+&#34;<br \/>\n9.<br \/>\ndns\u6a21\u5f0f\u8fc7\u6ee4<br \/>\n10.<br \/>\nDHCP<br \/>\n\u4ee5\u5bfb\u627e\u4f2a\u9020DHCP\u670d\u52a1\u5668\u4e3a\u4f8b\uff0c\u4ecb\u7ecdWireshark\u7684\u7528\u6cd5\u3002\u5728\u663e\u793a\u8fc7\u6ee4\u5668\u4e2d\u52a0\u5165\u8fc7\u6ee4\u89c4\u5219\uff0c<br \/>\n\u663e\u793a\u6240\u6709\u975e\u6765\u81eaDHCP\u670d\u52a1\u5668\u5e76\u4e14bootp.type==0x02\uff08Offer\/Ack\uff09\u7684\u4fe1\u606f\uff1a<br \/>\nbootp.type==0x02 and not ip.src==192.168.1.1<br \/>\n11.<br \/>\nmsn<br \/>\nmsnms &amp;&amp; tcp[23:1] == 20 \/\/ \u7b2c\u56db\u4e2a\u662f0x20\u7684msn\u6570\u636e\u5305<br \/>\nmsnms &amp;&amp; tcp[20:1] &gt;= 41 &amp;&amp; tcp[20:1] &lt;= 5A &amp;&amp; tcp[21:1] &gt;= 41 &amp;&amp; tcp[21:1] &lt;= 5A &amp;&amp; tcp[22:1] &gt;= 41 &amp;&amp; tcp[22:1] &lt;= 5A<br \/>\nmsnms &amp;&amp; tcp[20:3]==&#34;USR&#34; \/\/ \u627e\u5230\u547d\u4ee4\u7f16\u7801\u662fUSR\u7684\u6570\u636e\u5305<br \/>\nmsnms &amp;&amp; tcp[20:3]==&#34;MSG&#34; \/\/ \u627e\u5230\u547d\u4ee4\u7f16\u7801\u662fMSG\u7684\u6570\u636e\u5305<br \/>\ntcp.port == 1863 || tcp.port == 80<br \/>\n\u5982\u4f55\u5224\u65ad\u6570\u636e\u5305\u662f\u542b\u6709\u547d\u4ee4\u7f16\u7801\u7684MSN\u6570\u636e\u5305?<br \/>\n1)\u7aef\u53e3\u4e3a1863\u6216\u800580,\u5982:tcp.port == 1863 || tcp.port == 80<br \/>\n2)\u6570\u636e\u8fd9\u6bb5\u524d\u4e09\u4e2a\u662f\u5927\u5199\u5b57\u6bcd,\u5982:<br \/>\ntcp[20:1] &gt;= 41 &amp;&amp; tcp[20:1] &lt;= 5A &amp;&amp; tcp[21:1] &gt;= 41 &amp;&amp; tcp[21:1] &lt;= 5A &amp;&amp; tcp[22:1] &gt;= 41 &amp;&amp; tcp[22:1] &lt;= 5A<br \/>\n3)\u7b2c\u56db\u4e2a\u4e3a0x20,\u5982:tcp[23:1] == 20<br \/>\n4)msn\u662f\u5c5e\u4e8eTCP\u534f\u8bae\u7684,\u5982tcp<\/p>\n","protected":false},"excerpt":{"rendered":"<p>hcorecore \u7684 WireShark \u8fc7\u6ee4\u8bed\u6cd5 \/* WireShark \u8fc7\u6ee4\u8bed\u6cd5 *\/ 1. \u8fc7\u6ee4IP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[179],"tags":[208],"_links":{"self":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/112"}],"collection":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":1,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"predecessor-version":[{"id":214,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions\/214"}],"wp:attachment":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}