-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpasslist.php
More file actions
36 lines (30 loc) · 831 Bytes
/
passlist.php
File metadata and controls
36 lines (30 loc) · 831 Bytes
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
<?php
$words = array(
'red',
'fox',
'walking',
'on',
'the',
'street',
);
$passwords = array();
array_rand_combine($words, "", ' ', $passwords, 6);
$passwords = implode("\n", $passwords);
file_put_contents('passwords.txt', $passwords);
function array_rand_combine($arr, $temp_string, $connector = '', &$collect, $maxDepth, $deep = 0) {
$deep++;
if ($deep > $maxDepth)
return;
if ($temp_string != "")
$collect[] = $temp_string;
for ($i = 0; $i < sizeof($arr); $i++) {
$arrcopy = $arr;
$elem = array_splice($arrcopy, $i, 1);
if (sizeof($arrcopy) > 0) {
array_rand_combine($arrcopy, $temp_string . $connector . $elem[0], $connector, $collect, $maxDepth, $deep);
} else {
$collect[] = $temp_string . $connector . $elem[0];
}
}
}
?>