{"id":2741,"date":"2010-08-17T15:29:35","date_gmt":"2010-08-17T19:29:35","guid":{"rendered":"http:\/\/nuxx.net\/blog\/?p=2741"},"modified":"2011-06-07T14:27:24","modified_gmt":"2011-06-07T18:27:24","slug":"network-capture-during-boot-on-windows-7-and-server-2008-r","status":"publish","type":"post","link":"https:\/\/nuxx.net\/blog\/2010\/08\/17\/network-capture-during-boot-on-windows-7-and-server-2008-r\/","title":{"rendered":"Network Capture During Boot on Windows 7 (and Server 2008 R2)"},"content":{"rendered":"<p><center><\/p>\n<table cellpadding=1>\n<tr>\n<td bgcolor=\"black\"><a href=\"https:\/\/nuxx.net\/gallery\/v\/computers\/screenshots\/netsh_boot_capture_and_netmon.png.html?g2_imageViewsIndex=2\"><img decoding=\"async\" src=\"https:\/\/nuxx.net\/gallery\/d\/94776-2\/netsh_boot_capture_and_netmon.png\" height=400 width=640 border=0 title=\"Using netsh to capture a network ETL file at boot of a Windows 7 client and analyzing it for ARP traffic in Network Monitor v3.4.\"><\/a><\/td>\n<\/tr>\n<\/table>\n<p><\/center><\/p>\n<p>When working on network issues it&#8217;s often useful to have a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Packet_capture\">network capture<\/a> (or trace) illustrating the startup of the computer. As <a href=\"https:\/\/nuxx.net\/blog\/2009\/04\/20\/netoptics-passive-10100-ethernet-port-aggregator-tap-disassembly\/\">a tap<\/a>, a switch with spanning ports, or wireless capture equipment is rarely available it&#8217;s nice to do this right in the OS. Thanks to some improvements in both Windows 7 and Windows Server 2008 R2&#8217;s <tt><a href=\"http:\/\/en.wikipedia.org\/wiki\/Netsh\">netsh<\/a><\/tt> it&#8217;s now possible to do just this. Most of the information in this post is gleaned from <a href=\"http:\/\/blogs.technet.com\/b\/netmon\/archive\/2009\/05\/13\/event-tracing-for-windows-and-network-monitor.aspx\">this article at TechNet Blogs <cite>Event Tracing for Windows and Network Monitor<\/cite><\/a>, but here I wish to present a simplified version of how to get and save a capture. <\/p>\n<p>While there are more advanced methods available by running <a href=\"http:\/\/blogs.technet.com\/b\/netmon\/\">Microsoft Network Monitor<\/a> (eg: capture filtering, remote shutdown via specially crafted packets, etc), this method will accomplish the majority of boot time network capture needs. This is also often much more useful than performing a capture via an external tap as it includes the ID and name of the process responsible for sending or receiving the given traffic.<\/p>\n<p>To start a basic promiscuous mode capture listening on all interfaces with a 250 MB ring buffer (the defaults) and writing the trace file to the default location, use the following command, run as Administrator:<\/p>\n<blockquote><p><tt>netsh trace start capture=yes persistent=yes<\/tt><\/p><\/blockquote>\n<p>The capture will then run until stopped, even through reboots. To stop the capture and write the capture file out to disk, use the following command:<\/p>\n<blockquote><p><tt>netsh trace stop<\/tt><\/p><\/blockquote>\n<p>Consult the output from <tt>netsh trace start help<\/tt> to determine the other options you may want to set. Here are what I find to be the most-useful options:<\/p>\n<blockquote><p><tt>maxSize=250 MB<\/tt>: Maximum capture size.<br \/>\n<tt>overwrite=yes<\/tt>: If there&#8217;s an existing trace of the same name, should it be overwritten?<br \/>\n<tt>traceFile=%LOCALAPPDATA%\\Temp\\NetTraces\\NetTrace.etl<\/tt>: The output network Event Trace Log (ETL) file.<\/p><\/blockquote>\n<p>After an <tt>.ETL<\/tt> is obtained it needs to be opened and filtered with Microsoft Network Monitor to remove the extra headers. To do this ensure that you&#8217;re using the Windows set of parsers (<em>Parser Profiles<\/em> \u2192 <em>NetworkMonitor Parsers<\/em> \u2192 <em>Windows<\/em>), use the display filter:<\/p>\n<blockquote><p><tt>NDISPacCap_MicrosoftWindowsNDISPacketCapture<\/tt><\/p><\/blockquote>\n<p>From here additional filters can be used, such as the example screenshot above which uses the following filter to display all captured ARP traffic:<\/p>\n<blockquote><p><tt>NDISPacCap_MicrosoftWindowsNDISPacketCapture<\/tt><br \/>\n<tt>and<\/tt><br \/>\n<tt>arp<\/tt><\/p><\/blockquote>\n<p>While I normally prefer <a href=\"http:\/\/www.wireshark.org\">Wireshark<\/a> for capture analysis, I&#8217;ve found a number of cases where Network Monitor is more useful. The PID and Process Name capture, the <a href=\"http:\/\/en.wikipedia.org\/wiki\/IntelliSense\">IntelliSense<\/a>-like autocompletion in the Display Filter, and the seemingly better decoding of a few protocols (SMB in particular) are great, even if the default layout is a bit crap and there aren&#8217;t as many built-in analysis tools. While obtuse to many It&#8217;s also quite a bit easier to get apprehensive customers to install a single Microsoft-provided tool on their devices than something they view as simply &#8220;a freeware tool from online&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working on network issues it&#8217;s often useful to have a network capture (or trace) illustrating the startup of the computer. As a tap, a&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/nuxx.net\/blog\/2010\/08\/17\/network-capture-during-boot-on-windows-7-and-server-2008-r\/\">Continue reading<span class=\"screen-reader-text\">Network Capture During Boot on Windows 7 (and Server 2008 R2)<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-2741","post","type-post","status-publish","format-standard","hentry","category-computers","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/2741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/comments?post=2741"}],"version-history":[{"count":14,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/2741\/revisions"}],"predecessor-version":[{"id":3487,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/posts\/2741\/revisions\/3487"}],"wp:attachment":[{"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/media?parent=2741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/categories?post=2741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuxx.net\/blog\/wp-json\/wp\/v2\/tags?post=2741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}