Home > Windows Security Tips > > WinDump: The tcpdump tool for Windows
Windows Security Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


WinDump: The tcpdump tool for Windows


Serdar Yegulalp
11.23.2005
Rating: -4.67- (out of 5)


Advice for securing Windows
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Windows ports of the most powerful and widely used Unix command-line tools actually are fairly common. I've used various Windows versions of the search tool grep, for instance. Among the most useful is tcpdump, a tool for capturing and reporting packet headers in network traffic for further analysis. The folks at Cace Technologies have compiled a Windows port of the program named WinDump, with just about the entire feature set of its Unix-based brethren. The full source code for the program is also included, in the event that you want to compile a custom version.

Dumping network traffic has many possible applications. I've used it to determine if malware was installed in a given machine by seeing if packets were being broadcast from the computer when there should not have been anything else running (it could also divine their header information and destination). Aside from logging all available traffic, the program can capture and report only the packets that have certain matching information in their headers -- useful if you already know what you're looking for and just want to cut to the chase.

Installation and basic use

WinDump comes in two parts. The first is a set of network capture drivers called WinPcap, which WinDump uses to obtain packet-level access to network interfaces in the computer. The second part is the program itself, windump, which is invoked from the command line after you've installed the WinPcap library.

The first option you'll want to use when you run windump is -D, which lists all available network interfaces in the current system. By default, the program listens on the first available interface, but in Windows, it is typically the software dial-up adapter, not a physical network adapter. The results from -D usually look something like this:

1.\Device\NPF_GenericDialupAdapter (Generic dialup adapter)
2.\Device\NPF_{707E0236-BEE4-4097-93B1-56DEC35564AA} (Intel DC21140 PCI Fast Ethernet Adapter (Microsoft's Packet Scheduler) )

To use a specific adapter, run the program with the -i switch in conjunction with an adapter number. For instance, if you wanted to use the Ethernet adapter listed above, use windump -i 2. This is a lot easier than referring to the adapter by its GUID, but bear in mind the adapter number may not remain consistent if new hardware or software adapters are added.

Windump has the ability to filter captured input by specific criteria -- specific protocols, hosts or ports -- usually specified on the command line. The syntax for this is fairly complicated. It is explained in the program's documentation in detail, but here are some examples:

windump -i 2 port 80

Captures all traffic from interface #2 via port 80.

windump -i 2 host im-chat.com

Captures all traffic from interface #2 to or from the host im-chat.com.

windump -i 1 net 127

Captures all traffic from interface #1 to or from the subnet 127.x.x.x.

These parameters can be combined freely, too.

Output

By default, the program's output is logged to the console. Unless you're using the program simply to observe network traffic casually, you'll want to capture the results to a file using the -w <filename> switch. By default, the program overwrites any existing file with that name, so be careful you don't erase already-captured data this way!

For more information:
  • Analyzing security logs
  • Detecting rootkits
  • If you plan to look at the output file while the program is running, use the -U option. It forces the program to write each packet to the output file as it's received. By default, the program maintains a 1 MB buffer for data, which is flushed as it's filled.

    By default, windump captures only the header for each packet, not the full payload. The -s 0 option forces the program to dump out the entire raw payload for each packet. If you use this in conjunction with the -A option, you can write the results in ASCII format. Web pages captured in this manner, for instance, will be human-readable provided the server hasn't sent them in gzip/deflate format.

    Another useful option, -C <filesize>, writes out the data to multiple files, each no more than <filesize> in length. Each successive file is numbered incrementally. <filesize> is calibrated in millions of bytes; if you use -C 5, each file will be 5,000,000 bytes in length.

    When you quit the program (usually by hitting Ctrl-Break), the program writes out a report to the console that lists how many packets were captured, intercepted and dropped (due to lack of buffer space). If the program appears to be dropping packets, you can increase the amount of space allocated to the capture buffer with the command -B <size>, where <size> is allocated in kilobytes. The default buffer size is 1 MB.

    Advanced features

    One of the more powerful uses of WinDump is its ability to decipher encrypted network traffic sent via IPsec. It is not a trivial operation, however. It requires that you have the ESP secret key for the IPsec encryption in use and that you compile the tcpdump application with the cryptography option enabled (something that's way outside the scope of this article).

    If you want to specify an external file that has filter parameters, you can use the switch -F <filename>. Note that this will cause the program to ignore any filter parameters supplied on the command line.

    Finally, if you want the program to read and filter previously captured data rather than live data from a network adapter, use the -r <filename> switch.

    About the author: Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


    Rate this Tip
    To rate tips, you must be a member of SearchWindowsSecurity.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


    RELATED CONTENT
    Third Party and Shareware
    Free security testing tools for Windows handheld devices
    Metasploit 3.1 updates improve Windows penetration testing
    Security tools that limit user logon in Windows
    How can I use Process Explorer as a Web security tool?
    New Windows security tool protects users from keyloggers: XecureCK
    Top Windows security testing tips of 2007
    Sniffing out security problems in Windows networks
    How can I discover a hacker's IP address?
    Run third-party malware detection tools in Windows
    Find Windows vulnerabilities with a hex editor

    Configuration and Deployment
    How to use a GPO to improve Windows folder security
    Remote management for Windows system upgrades
    How to secure BitLocker configurations
    What's new and improved in IPsec in Windows Server 2008
    Have my Windows patches actually been installed?
    What's hot in Windows security: Ins and outs of Windows Server 2008
    Rights management in Windows: Security expert roundup
    Set write permissions in Windows network folders
    Windows network rights, password policy and network security testing
    Network security assessment for network infrastructure
    Configuration and Deployment Research

    Protocols and Services
    Vista SP1 vs. XP SP3 -- upgrade or business as usual?
    How to solve Windows security log mysteries
    How to generate actions from events in Microsoft Vista
    Blocking peer-to-peer applications
    Step 1: Blocking peer-to-peer applications
    Multiple Connections - Management
    Step-by-step guide: Elevating privileges for an administrator
    Checklist: Protecting users from themselves
    Client hardening
    Employee gadgets pose security risk to companies

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsWebcastsWhite PapersIT DownloadsBlogs
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts