noxxi / p5-ssl-tools

various standalone perl scripts
199 stars 78 forks source link

False negative when attempting to test heartbleed with STARTTLS on SMTP #6

Closed henshin closed 10 years ago

henshin commented 10 years ago

I've been testing this script and it works great but i'm come across some machines which have SMTP port 25 open and when trying to exploit the vulnerability using STARTTLS, the script returns a timeout error. However, testing it with other implementations like https://github.com/sensepost/heartbleed-poc work fine. The issue is probably related to the case when the server dumps the memory through heartbleed but doesn't close the connection and makes the script time out. There have been reports of the same false negative on other scritps. On the _readframe function, If you print the buffer before returning you will see some garbage followed by the bleed:

if ( ! select( my $rout = $rin,undef,undef,$timeout )) {
    $$rerr = 'timeout';
    print Dumper $buf ."\n";    ---> added this line - It dumps the server bleed (i used the module Data::Dumper)
    return;
};
noxxi commented 10 years ago

Thanks for reporting. This should be fixed with the latest release. If not please give specific example so that I can reproduce the problem.

henshin commented 10 years ago

Awesome! Works fine now