Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Exploits-HackingTools
[Top] [All Lists]

[UNIX] Crypt::ECB Block Zero Truncation

Subject: [UNIX] Crypt::ECB Block Zero Truncation
Date: 21 Dec 2004 18:20:30 +0200
The following security advisory is sent to the securiteam mailing list, and can 
be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html 

- - - - - - - - -



  Crypt::ECB Block Zero Truncation
------------------------------------------------------------------------


SUMMARY

There is a bug in the Crypt::ECB module that affects the way it processes 
blocks of data. It appears that Crypt::ECB incorrectly processes the last 
block of data if it contains a single ASCII "0". This has been tested 
using the Blowfish, Rijndael, TripleDES, DES, and IDEA algorithms. Below 
is some proof-of-concept code to demonstrate the problem. The problem is 
produced where the plain-text data length is one more than ((n % 8) == 0).

DETAILS

Proof of Concept:
#!/usr/local/bin/perl

use Crypt::ECB;

my $cipher = "Blowfish";
my $key    = "pb25YTt7d5b55711fd50bffcec4058d3e6c86bfc4c796bec2249b447";
my $plain  = "12345678123456780";

my $crypt = Crypt::ECB->new;

$crypt->padding(PADDING_AUTO);
$crypt->cipher($cipher) or die $crypt->errstring;
$crypt->key($key);

printf "Plain     = '%s'\n", $plain;

my $enc = $crypt->encrypt_hex($plain);
printf "Encrypted = '%s'\n", $enc;

my $dec = $crypt->decrypt_hex($enc);
printf "Decrypted = '%s'\n", $dec;

Patch:
### 
### Diff for ECB fix (output from diff -u)
###
### Test Data:
###             Plain: ILlW1nr30
###             Key:     
pb25YTt7d5b55711fd50bffcec4058d3e6c86bfc4c796bec2249b447
###             Pad:     AUTO
###
--- ECB.pm      2000-12-23 13:16:38.000000000 -0500
+++ ECB2.pm     2004-12-06 12:45:23.000000000 -0500
@@ -1,4 +1,4 @@
-package Crypt::ECB;
+package Crypt::ECB2;

 # Copyright (C) 2000  Christoph Appel, cappel@debis.com
 #  see documentation for details
@@ -274,7 +274,7 @@
     $crypt->{Mode}   = '';
     $crypt->{buffer} = '';

-    return '' unless $data;
+    return '' unless length($data) > 0;

     my $cipher = $crypt->_getcipher;


ADDITIONAL INFORMATION

The information has been provided by  <mailto:brs@fsproduce.com> Bennett 
R. Samowich.



======================================== 


This bulletin is sent to members of the SecuriTeam mailing list. 
To unsubscribe from the list, send mail with an empty subject line and body to: 
list-unsubscribe@securiteam.com 
In order to subscribe to the mailing list, simply forward this email to: 
list-subscribe@securiteam.com 


==================== 
==================== 

DISCLAIMER: 
The information in this bulletin is provided "AS IS" without warranty of any 
kind. 
In no event shall we be liable for any damages whatsoever including direct, 
indirect, incidental, consequential, loss of business profits or special 
damages. 




<Prev in Thread] Current Thread [Next in Thread>
  • [UNIX] Crypt::ECB Block Zero Truncation, SecuriTeam <=