****** Wbox TUTORIAL - taken from http://www.hping.org/wbox/ ****** ***** HTTP client mode ***** The following is a short tutorial. Wbox is trivial to use but you may want to read this in order to understand better what wbox is and how to use it. **** Basic usage **** The simplest way to use wbox is to call it with just one argument, an url: % wbox www.google.it WBOX www.google.it (64.233.183.99) port 80 0. 200 OK 3774 bytes 407 ms 1. 200 OK (3767) bytes 273 ms 2. 200 OK 3767 bytes 304 ms 3. 200 OK 3767 bytes 260 ms user terminated As you can see wbox in this mode of operation resembles the ping_utility. For every performed HTTP request it shows the sequence number of the request (0.), the HTTP reply code and reason string (200 OK), the number of bytes received from the server (3774 bytes), and the time the request took to complete in milliseconds (407 ms). There are two details to note. * The number of received bytes includes the HTTP reply header, so it is not equal to the document length. * Every time it changes compared to the previous HTTP reply, the number of received bytes is put between parens, like in (3767) **** Limiting the number of requests **** By default wbox will continue to perform requests forever, until you don't press Ctrl+C. After the url argument you can pass a number of options to wbox to alter its behaviour, one of this is an integer number specifying how many requests to perform. % wbox www.google.it/notexistingpage.html 1 WBOX www.google.it (64.233.183.103) port 80 0. 404 Not Found 1495 bytes 310 ms This time wbox terminated after the first request was received. **** Obtaining splitted timing information **** Usually web applications don't spend the same time in the generation of every part of the page. With wbox it's possible to obtain time information for different parts of the document using the timesplit option. % wbox digg.com timesplit 1 WBOX digg.com (64.191.203.30) port 80 0. 200 OK 44134 bytes 1326 ms [0] 0-4095 -> 728 ms [1] 4096-8191 -> 254 ms [2] 8192-12287 -> 16 ms [3] 12288-16383 -> 17 ms [4] 16384-20479 -> 225 ms [5] 20480-24575 -> 12 ms [6] 24576-28671 -> 16 ms [7] 28672-32767 -> 18 ms [8] 32768-36863 -> 16 ms [9] 36864-40959 -> 16 ms [10] 40960-44133 -> 8 ms **** Dumping data **** We may like to see what kind of HTTP reply google is emitting on 404 errors, the option showhdr tells wbox to dump the HTTP reply header. % wbox www.google.it/notexistingpage.html 1 showhdr WBOX www.google.it (64.233.183.103) port 80 HTTP/1.1 404 Not Found Content-Type: text/html Server: GWS/2.1 Content-Length: 1368 Date: Tue, 05 Jun 2007 16:49:58 GMT 0. 404 Not Found 1495 bytes 540 ms We may like to use wbox inside a shell script in order to collect different headers, so the option silent tells wbox to don't show status lines. % wbox www.google.it/notexistingpage.html 1 showhdr silent HTTP/1.1 404 Not Found Content-Type: text/html Server: GWS/2.1 Content-Length: 1368 Date: Tue, 05 Jun 2007 16:51:52 GMT It's also possible to dump the whole reply using the dump option. % wbox www.google.it/notexistingpage.html 1 dump silent HTTP/1.1 404 Not Found Content-Type: text/html Server: GWS/2.1 Content-Length: 1368 Date: Tue, 05 Jun 2007 16:53:44 GMT