md5decrypter API [英] md5decrypter API

查看:18
本文介绍了md5decrypter API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,有这个网站 (http://md5decrypter.co.uk),给定一个 md5 哈希值,它将尝试返回原始字符串.

So, there's this website (http://md5decrypter.co.uk) which, given an md5 hash, will attempt to return the original string.

是否有 API 或有人制作了一个 PHP 类来使用它?我找不到...

Is there an API or has someone made a PHP class to work with it? I can't find one...

在你问之前,让我向你保证我没有恶意.

Before, you ask, let me assure you that I have no malicious intent.

提前致谢.

推荐答案

即使 md5decryptor 的那个人很好,他也不会仅仅因为你的要求而让你通过 HTTP 访问他的资产.与其他任何人一样,您可以使用需要验证码的公开可用网络界面 - 说明一切.

Even so the guy from md5decryptor is nice, he won't make his asset accessible to you via HTTP only because you're asking. As anybody else you can use the publicly available webinterface which requires a captcha - which says everything.

或者简而言之:不,那里没有 PHP API.

Or in short: No there ain't no PHP API out there.

但是,你为什么不自己经营呢?这是相当微不足道的:

However, why don't you run your own? It's rather trivial:

$decryptors = array('Google', 'Gromweb');

foreach ($hashes as $hash) {
    echo "$hash";
    foreach($decryptors as $decrytor)
    {
        if (NULL !== ($plain = MD5Decryptor::plain($hash, $decrytor))) {
            echo " - found: $plain ($decrytor)";
            break;
        }
    }
    echo "\n";
}

输出:

fcf1eed8596699624167416a1e7e122e - found: octopus (Google)
bed128365216c019988915ed3add75fb - found: passw0rd (Google)
d0763edaa9d9bd2a9516280e9044d885 - found: monkey (Google)
dfd8c10c1b9b58c8bf102225ae3be9eb - found: 12081977 (Google)
ede6b50e7b5826fe48fc1f0fe772c48f - found: 1q2w3e4r5t6y (Google)

那些您无法直接查找的,您可以手动粘贴到该站点.请记住,如果有更多人像您一样思考,就会有越来越多的网站关闭(其中大部分已经关闭).

Those you're not able to directly look-up, you can paste at that site manually. Keep in mind if more folks think like you, more and more sites will go down (most of them are already).

abstract class MD5Decryptor
{
    abstract public function probe($hash);

    public static function plain($hash, $class = NULL)
    {
        if ($class === NULL) {
            $class = get_called_class();
        } else {
            $class = sprintf('MD5Decryptor%s', $class);
        }
        $decryptor = new $class();

        if (count($hash) > 1) {
            foreach ($hash as &$one) {
                $one = $decryptor->probe($one);
            }
        } else {
            $hash = $decryptor->probe($hash);
        }
        return $hash;
    }

    public function dictionaryAttack($hash, array $wordlist)
    {
        $hash = strtolower($hash);
        foreach ($wordlist as $word) {
            if (md5($word) === $hash)
                return $word;
        }
    }
}

abstract class MD5DecryptorWeb extends MD5Decryptor
{
    protected $url;

    public function getWordlist($hash)
    {
        $list = FALSE;
        $url = sprintf($this->url, $hash);
        if ($response = file_get_contents($url)) {
            $list[$response] = 1;
            $list += array_flip(preg_split('/\s+/', $response));
            $list += array_flip(preg_split('/(?:\s|\.)+/', $response));
            $list = array_keys($list);
        }
        return $list;
    }

    public function probe($hash)
    {
        $hash = strtolower($hash);
        return $this->dictionaryAttack($hash, $this->getWordlist($hash));
    }
}

class MD5DecryptorGoogle extends MD5DecryptorWeb
{
    protected $url = 'http://www.google.com/search?q=%s';

}

class MD5DecryptorGromweb extends MD5DecryptorWeb
{
    protected $url = 'http://md5.gromweb.com/query/%s';
}

这篇关于md5decrypter API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆