bittwistの使い方

コマンドプロンプトから使います。
基本的には、送信するpcapファイル(wiresharkのキャプチャファイル)と送信インタフェースを指定するだけ。pcapファイルは、スペースで区切って複数書くことができるようで、1つ目が送信し終わったら次のファイルを送信するようです。

以下のように、bittwistを動かしてみました。

C:\bittwist>bittwist -i 4 icmp.pcap
sending packets through \Device\NPF_{CE53EEB8-2CA7-41F7-8AE6-F9A2F12DFC26}
trace file: icmp.pcap

17 packets (1096 bytes) sent
Elapsed time = 8.624000 seconds

C:\bittwist
C 直下にbittwistという名前の作業用フォルダを作りました。
icmp.pcap
あらかじめwiresharkでキャプチャしておいたキャプチャファイル。bittwistでこのファイルの内容をジェネレートします。icmp.pcapはC:\bittwistの中に置きました。
-i 4
ジェネレートする際に使用するインタフェース。bittwist -dでどのインタフェースと番号の関係を調査可能です。私の環境でのbittwist -dは、以下のとおりです。

C:\>bittwist -d
1. \Device\NPF_GenericDialupAdapter (Adapter for generic dialup and VPN capture)
2. \Device\NPF_{6BA966AC-2889-44F1-9162-B4CE57FFDE6F} (VMware Virtual Ethernet Adapter)
3. \Device\NPF_{8C55A32F-392C-40D4-A3ED-3BF84158C0CB} (VMware Virtual Ethernet Adapter)
4. \Device\NPF_{CE53EEB8-2CA7-41F7-8AE6-F9A2F12DFC26} (ORINOCO PC Card (Microsoft's Packet Scheduler) )
5. \Device\NPF_{DD071C3E-0216-42C0-833F-F57EE11F57BE} (Intel 8255x-based Integrated Fast Ethernet (Microsoft's Packet Scheduler) )

参考(ヘルプ)
C:\temp>bittwist -h
bittwist version 1.0
WinPcap version 4.0.2 (packet.dll version 4.0.0.1040), based on libpcap version 0.9.5
Usage: bittwist [-d] [-v] [-i interface] [-s length] [-l loop] [-c count]
                [-m speed] [-r rate] [-p sleep] [-h] pcap-file(s)

Options:
 -d             Print a list of network interfaces available.
 -v             Print timestamp for each packet.
 -vv            Print timestamp and hex data for each packet.
 -i interface   Send 'pcap-file(s)' out onto the network through 'interface'.
 -s length      Packet length to send. Set 'length' to:
                     0 to send the actual packet length. This is the default.
                    -1 to send the captured length.
                or any other value from 14 to 1514.
 -l loop        Send 'pcap-file(s)' out onto the network for 'loop' times.
                Set 'loop' to 0 to send 'pcap-file(s)' until stopped.
                To stop, type Control-C.
 -c count       Send up to 'count' packets.
                Default is to send all packets from 'pcap-file(s)'.
 -m speed       Set interval multiplier to 'speed'.
                Set 'speed' to 0 or less to send the next packet immediately.
                Minimum positive value for 'speed' is 0.000001.
 -r rate        Limit the sending to 'rate' Mbps.
                Value for 'rate' must be between 1 to 10000.
                This option is meant to limit the maximum packet throughput.
                If you want to send packets at line rate of 100Mbps,
                try -m 0 -r 100
 -p sleep       Set interval to 'sleep' (in seconds), ignoring the actual
                interval.
                Value for 'sleep' must be between 1 to 2146.
 -h             Print version information and usage.



最終更新:2008年01月26日 00:48