Commit | Line | Data |
---|---|---|
8de51304 H |
1 | <?php\r |
2 | \r | |
3 | /* Example for password "czISc.fWfjsQQ" ("admin"):\r | |
4 | * $salt = ("cz"); //First two characters of password\r | |
5 | * $hash = ("ISc.fWfjsQQ"); //Rest of password\r | |
6 | */\r | |
7 | \r | |
8 | \r | |
9 | $salt = ("cz"); //First two characters of password\r | |
10 | $hash = ("ISc.fWfjsQQ"); //Rest of password\r | |
11 | $pass = ("admin"); //Debug only (Contains known password)\r | |
12 | \r | |
13 | //////////////////////////////////////////////////////////////////////////////\r | |
14 | \r | |
15 | //READLINE Function\r | |
16 | function readline($prompt="") {\r | |
17 | echo $prompt;\r | |
18 | \r | |
19 | $t = "";\r | |
20 | $c = "";\r | |
21 | \r | |
22 | while(1) {\r | |
23 | $c = fread(STDIN, "1");\r | |
24 | if ($c == "\n") { // && ($c == "\r") //May be later on oher systems\r | |
25 | return trim($t);\r | |
26 | } else {\r | |
27 | $t = ($t.$c);\r | |
28 | }\r | |
29 | }\r | |
30 | \r | |
31 | return $t;\r | |
32 | \r | |
33 | }\r | |
34 | //READLINE End\r | |
35 | \r | |
36 | //CODE\r | |
37 | $loop = 1;\r | |
38 | while($loop) {\r | |
39 | \r | |
40 | $try = readline();\r | |
41 | \r | |
42 | //$try = $pass; //Debug only\r | |
43 | $crypt = crypt($try, $salt);\r | |
44 | if ( $crypt == ($salt.$hash) ) {\r | |
45 | echo ("\nSalt: $salt\nHash: $hash\nPass: $try\n\n");\r | |
46 | }\r | |
47 | \r | |
48 | }\r | |
49 | \r | |
50 | ?>\r |