-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwlhelper.php
134 lines (117 loc) · 5.48 KB
/
wlhelper.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
$searchIn = 1; // If 0 - search on WeLeakInfo API, if 1 - search in LeakCheck
$type = "email"; // Set your type element for search e.g. email | Btw WeLeakInfo API sucks, so only works if type is an email. Also you can search by nickname or phone number but no change the type. You must set type as email.
$apiKey = "XXXX-XXXX-XXXX-XXXX"; // Set your api key. | Api key format: XXXX-XXXX-XXXX-XXXX
$leaksElements = [
/*
If you want use this script you
must remove e-mail addresses below.
*/
"test@test.ru",
"propablyNotExistingEmail1@example.com",
"propablyNotExistingEmail2@example.com",
"test@example.com"
];
class WeLeakHelper
{
public function __construct()
{
echo "\n";
echo "\033[31m \n";
echo " \ \ / / | | | | | ____| | | _ \| ____| _ \ \n";
echo " \ \ /\ / /| | | |_| | _| | | | |_) | _| | |_) |\n";
echo " \ V V / | |___| _ | |___| |___| __/| |___| _ < \n";
echo " \_/\_/ |_____|_| |_|_____|_____|_| |_____|_| \_\ \n";
echo "\n";
echo " Created by VendeN \033[\n";
echo "\n";
}
public function check($searchIn, $type, $apiKey, $leaksElements):void
{
foreach ($leaksElements as $leak)
{
if ($searchIn == 0)
{
$url = "http://api.weleakinfo.to/api?value=$leak&type=$type&key=$apiKey";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$json = json_decode($output, true);
echo "\n";
echo "\e[92mSearching on: WeLeakInfo.to";
echo "\n";
if ($json["success"] === true)
{
echo "\033[33m!! $leak is vulnerable !! \n";
for ($i = 0;$i < count($json["result"]);$i++)
{
if (count($json["result"]["$i"]["sources"]) === 0)
{
echo "\e[92m" . $json["result"]["$i"]["line"] . " from unknown database" . "\n";
}
else
{
for ($l = 0;$l < count($json["result"]["$i"]["sources"]);$l++)
{
echo "\e[92m" . $json["result"]["$i"]["line"] . " from database " . "\033[34m" . $json["result"]["$i"]["sources"]["$l"] . "\n";
}
}
}
}
else
{
echo "\e[31mNot found passwords for: " . $leak . "\n";
}
echo "\e[39m";
}
elseif ($searchIn == 1)
{
$url = "https://leakcheck.net/api/?key=$apiKey&check=$leak&type=$type";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$json = json_decode($output, true);
echo "\n";
echo "\e[92mSearching on: LeakCheck.net\n";
echo "\n";
if ($json["success"] === true)
{
echo "\033[33m!! $leak is vulnerable !! \n";
for ($i = 0;$i < count($json["result"]);$i++)
{
if (count($json["result"]["$i"]["sources"]) === 0)
{
echo "\e[92m" . $json["result"]["$i"]["line"] . " from unknown database" . "\n";
}
else
{
for ($l = 0;$l < count($json["result"]["$i"]["sources"]);$l++)
{
echo "\e[92m" . $json["result"]["$i"]["line"] . " from database " . "\033[34m" . $json["result"]["$i"]["sources"]["$l"] . "\n";
}
}
}
}
else
{
echo "\e[31mNot found passwords for: " . $leak . "\n";
}
echo "\e[39m";
}
else {
echo "\e[31mInvalid platform please check yours configuration and try again.\n";
echo "\e[39m";
}
}
}
}
$weLeakHelper = new WeLeakHelper();
$weLeakHelper->check($searchIn, $type, $apiKey, $leaksElements);