forked from dumnet/wpdecrypt
-
Notifications
You must be signed in to change notification settings - Fork 8
/
wpdecrypt.php
46 lines (38 loc) · 1.02 KB
/
wpdecrypt.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require_once("PasswordHash.php");
Class WP_Decrypt {
private $WP_HASHER;
public $wordlist;
public $HASH;
public function __construct() {
$explode = (strtoupper(substr(PHP_OS, 0, 3)) === "WIN") ? "\r\n" : "\n";
$this->wordlist = file_get_contents("wordlist.txt");
$this->wordlist = explode($explode, $this->wordlist);
$this->WP_HASHER = new PasswordHash(8, TRUE);
$this->run();
}
public function input() {
$handle = fopen("php://stdin", "r");
$fgets = fgets($handle);
$fgets = str_replace(["\n","\r"], "", $fgets);
fclose($handle);
return $fgets;
}
public function decrypt() {
$result = array();
foreach($this->wordlist as $list) {
if($this->WP_HASHER->CheckPassword($list, $this->HASH)) {
$result[] = $list;
}
}
$output = implode("", $result);
print (empty($output) ? "[!] ".$this->HASH." -> Not Found!\n" : "[!] ".$this->HASH." -> $output\n");
}
public function run() {
print "[*] HASH: ";
$this->HASH = $this->input();
print $this->decrypt();
}
}
$wp = new WP_Decrypt;
?>