Re: Check_http bug ?

Stanley Hopcroft <[email protected]> Thu, 19 Dec 2002 10:17:54 +1100
Newsgroups gmane.network.netsaint.user
Message-ID <[email protected]>
Dear Sir,

While there are problems with check_http, this may not be one of them.

I have to access your site via a proxy but here is what I see (from the 
CLI)

tsitc> ./check_http securenet-web -V
check_http (netsaint-plugins 1.2.9-4) 1.32.2.6
The netsaint plugins come with ABSOLUTELY NO WARRANTY. You may 
redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
tsitc> ./check_http securenet-web -u http://www.LiveTechnology.com -v | 
head -30
Page is 55560 characters
STATUS: HTTP/1.0 200 OK
**** HEADER ****
Content-Length: 54979
Date: Wed, 18 Dec 2002 23:08:12 GMT
Content-Type: text/html
X-LSRequestID: 20021218230812992_4552:1
Server: LiveServer/5.1
X-LSServer: JMMWEB1
X-LSRequestID: 20021218165842412_2264
Expires: Fri, 20 Dec 2002 21:58:42 GMT
Last-Modified: Wed, 18 Dec 2002 21:58:42 GMT
Cache-Control: max-age=172800,public
X-Cache: MISS from platt.securenet.com.au
X-Cache-Lookup: MISS from platt.securenet.com.au:8080
Age: 64
X-Cache: HIT from packer.securenet.com.au
X-Cache-Lookup: HIT from packer.securenet.com.au:80
Proxy-Connection: close
**** CONTENT ****
<HTML>
 <HEAD>
  <TITLE>LiveTechnology Holdings</TITLE>
  <META NAME="KEYWORDS" CONTENT="LiveServer, LiveStat, Live, Technology, 
LiveBuilder, LiveDeveloper, Internet, LiveSender, LiveFind, LiveCrawler 
,LiveOODB">
  <META NAME="DESCRIPTION" CONTENT="LiveTechnology, Business solutions 
and internet technology">
<META NAME="Server" CONTENT="LiveServer 5.1" />
<META NAME="ContentManagementSystem" CONTENT="LiveManager 2.5; 
URL=http://www.LiveManager.com" />
<META NAME="Generator" CONTENT="LiveManager 2.5; 
URL=http://www.LiveManager.com" />
<META NAME="Date" CONTENT="Wed, 18 Dec 2002 21:58:42 GMT" />
  <SCRIPT SRC=/JavaScript></SCRIPT>
tsitc> 

Looks Ok to me.

Please let me know what I am missing.


On Wed, Dec 18, 2002 at 09:04:00PM +0500, Warrick FitzGerald wrote:
> Hi All,
> 
> I have for a number of days now, being trying to figure out why the
> Check_http tool will not successfully against a site of mine.
> 
> I do not get any error message, but I also do not get a success message.
> The reason seems to be due to a malformed HTTP GET request that the tool
> is making. The HTTP spec specifies that the header should end in a double
> carriage return, and if any more data is being sent a content-length must
> be specified.
> 
> I am using “check_http (netsaint-plugins 1.2.9-4) 1.32.2.6”
> 
> As you can see from the tcpdump output in the last packet there are three
> sets of carriage return line feeds, one more than should be sent.
> 
> 09:45:54.671260 172.16.1.100.46045 > 206.65.169.151.80: P 1:17(16) ack 1
> win 5840 <nop,nop,timestamp 46608955 0> (DF)
> 0x0000   4500 0044 522b 4000 4006 c33b ac10 0164        E..DR+@.@..;...d
> 0x0010   ce41 a997 b3dd 0050 4c9b 6013 0b09 b70c        .A.....PL.`.....
> 0x0020   8018 16d0 10fe 0000 0101 080a 02c7 323b        ..............2;
> 0x0030   0000 0000 4745 5420 2f20 4854 5450 2f31        ....GET./.HTTP/1
> 0x0040   2e30 0d0a                                      .0..
> 09:45:54.854386 206.65.169.151.80 > 172.16.1.100.46045: . ack 17 win 16544
> <nop,nop,timestamp 80401406 46608955> (DF)
> 0x0000   4500 0034 6ebb 4000 7c06 6abb ce41 a997        E..4n.@.|.j..A..
> 0x0010   ac10 0164 0050 b3dd 0b09 b70c 4c9b 6023        ...d.P......L.`#
> 0x0020   8010 40a0 e002 0000 0101 080a 04ca d3fe        ..@.............
> 0x0030   02c7 323b                                      ..2;
> 09:45:54.854499 172.16.1.100.46045 > 206.65.169.151.80: P 17:111(94) ack 1
> win 5840 <nop,nop,timestamp 46608973 80401406> (DF)
> 0x0000   4500 0092 522c 4000 4006 c2ec ac10 0164        E...R,@[email protected]
> 0x0010   ce41 a997 b3dd 0050 4c9b 6023 0b09 b70c        .A.....PL.`#....
> 0x0020   8018 16d0 e2bb 0000 0101 080a 02c7 324d        ..............2M
> 0x0030   04ca d3fe 486f 7374 3a20 7777 772e 6c69        ....Host:.www.li
> 0x0040   7665 7465 6368 6e6f 6c6f 6779 2e63 6f6d        vetechnology.com
> 0x0050   0d0a 5573 6572 2d41 6765 6e74 3a20 6368        ..User-Agent:.ch
> 0x0060   6563 6b5f 6874 7470 2f31 2e33 322e 322e        eck_http/1.32.2.
> 0x0070   3620 286e 6574 7361 696e 742d 706c 7567        6.(netsaint-plug
> 0x0080   696e 7320 312e 322e 392d 3429 0d0a 0d0a        ins.1.2.9-4)....
> 0x0090   0d0a                                           ..
> 
> Could someone please confirm that this is a bug? You can test by making a
> request to http://www.LiveTechnology.com
> 
> Thanks
> Warrick FitzGerld
> LiveTechnology Holdings Inc
> 
>

I think that the host requirements RFC eliminates the three (3) 0x0d 
0x0a as the cause of the problem.

The server should simply reply gracefully no matter what sort of 
disgusting filth a client sends it.

My trace is much the same but for the User-Agent header. 

One of the problems with check_http (was ?) that the User-Agent was 
unfortunately chosen to be not one of the big two. This really should be 
an option setting.

Some web servers check the User-Agent header and respond accordingly

Here is a patch that may help

Yours sincerely.


-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.
x (text/plain, 1.6 KB)
--- check_http.c        Tue Jun 25 14:56:25 2002
+++ check_http.c.dist   Tue Jun 25 14:50:22 2002
@@ -525,10 +525,8 @@
 
                /* send user agent */
                sprintf (buffer,
-/*                                              "User-Agent: check_http/%s (netsaint-plugins %s)\r\n", */
-                                                "User-Agent: %s/%s\r\n",
-                                                "Mozilla", "4.7") ;
-/*                                              clean_revstring (REVISION), PACKAGE_VERSION);          */
+                                                "User-Agent: check_http/%s (netsaint-plugins %s)\r\n",
+                                                clean_revstring (REVISION), PACKAGE_VERSION);
                if (SSL_write(ssl,buffer,strlen(buffer)) == -1) {
                        ERR_print_errors_fp(stderr);
                        return STATE_CRITICAL;
@@ -588,10 +586,8 @@
 
                /* send user agent */
                sprintf (buffer,
-                                                "User-Agent: %s/%s\r\n",
-/*                                              "User-Agent: check_http/%s (netsaint-plugins %s)\r\n", */
-                                                "Mozilla", "4.7") ;
-/*                                              clean_revstring (REVISION), PACKAGE_VERSION);          */
+                                                "User-Agent: check_http/%s (netsaint-plugins %s)\r\n",
+                                                clean_revstring (REVISION), PACKAGE_VERSION);
                send (sd, buffer, strlen(buffer), 0);
 
                /* optionally send the authentication info */
y (text/plain, 3.9 KB)
  0.001694 tsitc.aipo.gov.au -> securenet-mta.aipo.gov.au HTTP GET http://www.LiveTechnology.com HTTP/1.0
% Set the font to 10 point
/Courier findfont 10 scalefont setfont
() hexdump
(0000  00 03 6b f7 1e 75 00 02 b3 23 26 64 08 00 45 00   ..k..u...#&d..E.) hexdump
(0010  00 60 54 ec 40 00 40 06 b8 02 0a 00 64 fc c0 a8   .`T.@[email protected]...) hexdump
(0020  fe 04 0a 70 00 50 54 b9 e1 0d ce 89 fb c9 80 18   ...p.PT.........) hexdump
(0030  e0 70 f2 bd 00 00 01 01 08 0a 05 ee ba c1 23 7e   .p............#~) hexdump
(0040  32 b5 47 45 54 20 68 74 74 70 3a 2f 2f 77 77 77   2.GET http://www) hexdump
(0050  2e 4c 69 76 65 54 65 63 68 6e 6f 6c 6f 67 79 2e   .LiveTechnology.) hexdump
(0060  63 6f 6d 20 48 54 54 50 2f 31 2e 30 0d 0a         com HTTP/1.0..) hexdump

  0.003361 securenet-mta.aipo.gov.au -> tsitc.aipo.gov.au TCP http > 2672 [ACK] Seq=3465149385 Ack=1421467961 Win=5792 Len=0
% Set the font to 10 point
/Courier findfont 10 scalefont setfont
() hexdump
(0000  00 02 b3 23 26 64 00 03 6b f7 1e 75 08 00 45 00   ...#&d..k..u..E.) hexdump
(0010  00 34 c9 7c 40 00 3f 06 44 9e c0 a8 fe 04 0a 00   .4.|@.?.D.......) hexdump
(0020  64 fc 00 50 0a 70 ce 89 fb c9 54 b9 e1 39 80 10   d..P.p....T..9..) hexdump
(0030  16 a0 10 8a 00 00 01 01 08 0a 23 7e 32 b5 05 ee   ..........#~2...) hexdump
(0040  ba c1                                             ..) hexdump

  0.003383 tsitc.aipo.gov.au -> securenet-mta.aipo.gov.au HTTP Continuation
% Set the font to 10 point
/Courier findfont 10 scalefont setfont
() hexdump
(0000  00 03 6b f7 1e 75 00 02 b3 23 26 64 08 00 45 00   ..k..u...#&d..E.) hexdump
(0010  00 66 54 ed 40 00 40 06 b7 fb 0a 00 64 fc c0 a8   .fT.@[email protected]...) hexdump
(0020  fe 04 0a 70 00 50 54 b9 e1 39 ce 89 fb c9 80 18   ...p.PT..9......) hexdump
(0030  e0 70 56 1d 00 00 01 01 08 0a 05 ee ba c2 23 7e   .pV...........#~) hexdump
(0040  32 b5 48 6f 73 74 3a 20 73 65 63 75 72 65 6e 65   2.Host: securene) hexdump
(0050  74 2d 77 65 62 0d 0a 55 73 65 72 2d 41 67 65 6e   t-web..User-Agen) hexdump
(0060  74 3a 20 4d 6f 7a 69 6c 6c 61 2f 34 2e 37 0d 0a   t: Mozilla/4.7..) hexdump
(0070  0d 0a 0d 0a                                       ....) hexdump

  0.004894 securenet-mta.aipo.gov.au -> tsitc.aipo.gov.au TCP http > 2672 [ACK] Seq=3465149385 Ack=1421468011 Win=5792 Len=0
% Set the font to 10 point
/Courier findfont 10 scalefont setfont
() hexdump
(0000  00 02 b3 23 26 64 00 03 6b f7 1e 75 08 00 45 00   ...#&d..k..u..E.) hexdump
(0010  00 34 c9 7d 40 00 3f 06 44 9d c0 a8 fe 04 0a 00   .4.}@.?.D.......) hexdump
(0020  64 fc 00 50 0a 70 ce 89 fb c9 54 b9 e1 6b 80 10   d..P.p....T..k..) hexdump
(0030  16 a0 10 57 00 00 01 01 08 0a 23 7e 32 b5 05 ee   ...W......#~2...) hexdump
(0040  ba c2                                             ..) hexdump

  0.005604 securenet-mta.aipo.gov.au -> tsitc.aipo.gov.au HTTP HTTP/1.0 200 OK
% Set the font to 10 point
/Courier findfont 10 scalefont setfont
() hexdump
(0000  00 02 b3 23 26 64 00 03 6b f7 1e 75 08 00 45 00   ...#&d..k..u..E.) hexdump
(0010  05 8c c9 7e 40 00 3f 06 3f 44 c0 a8 fe 04 0a 00   ...~@.?.?D......) hexdump
(0020  64 fc 00 50 0a 70 ce 89 fb c9 54 b9 e1 6b 80 10   d..P.p....T..k..) hexdump
(0030  16 a0 f9 6d 00 00 01 01 08 0a 23 7e 32 b5 05 ee   ...m......#~2...) hexdump
(0040  ba c2 48 54 54 50 2f 31 2e 30 20 32 30 30 20 4f   ..HTTP/1.0 200 O) hexdump
(0050  4b 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74   K..Content-Lengt) hexdump
(0060  68 3a 20 35 34 39 37 39 0d 0a 44 61 74 65 3a 20   h: 54979..Date: ) hexdump
(0070  57 65 64 2c 20 31 38 20 44 65 63 20 32 30 30 32   Wed, 18 Dec 2002) hexdump
(0080  20 32 33 3a 30 38 3a 31 32 20 47 4d 54 0d 0a 43    23:08:12 GMT..C) hexdump
(0090  6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78   ontent-Type: tex) hexdump
(00a0  74 2f 68 74 6d 6c 0d 0a 58 2d 4c 53 52 65 71 75   t/html..X-LSRequ) hexdump
(00b0  65 73 74 49 44 3a 20 32 30 30 32 31 32 31 38 32   estID: 200212182) hexdump
(00c0  33 30 38 31 32 39 39 32 5f 34 35 35 32 3a 31 0d   30812992_4552:1.) hexdump