]> jfr.im git - irc/blitzed-org/libopm.git/commitdiff
Apply "[irc-security] BOPM patch for MikroTik HttpProxy, possibly others" master origin/HEAD origin/master
authordg <redacted>
Thu, 28 May 2009 20:13:22 +0000 (20:13 +0000)
committerdg <redacted>
Thu, 28 May 2009 20:13:22 +0000 (20:13 +0000)
<redacted>:

Here's a quick patch for BOPM-3.1.3 which will help the HTTP CONNECT
scanner catch MikroTik HttpProxies (and any other quirky implementations
which require some initial data before activating the tunnel).

Terrence Koeman kindly tested the patched BOPM vs unpatched BOPM
performance against the current proxybl database, and while the patched
BOPM appears to have caught everything, the unpatched BOPM missed ~150
out of ~4600.

src/proxy.c

index 08d8ef3953d430b9671a1609d574825a2553c70e..5ce2336fee14fcbe5e6ee49635e4b237b97d45d6 100644 (file)
@@ -55,6 +55,9 @@ int libopm_proxy_http_write(OPM_T *scanner, OPM_SCAN_T *scan, OPM_CONNECTION_T *
    if(send(conn->fd, SENDBUF, strlen(SENDBUF), 0) == -1)
       return 0; /* Return error code ? */
 
+   /* extra linefeed required for MikroTik HttpProxy, must be separate send() */
+   send(conn->fd, "\r\n", 2, 0);
+
    return OPM_SUCCESS;
 }