forked from GemGeorge/SniperPhish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangePwd.php
139 lines (134 loc) · 6.73 KB
/
ChangePwd.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
135
136
137
138
139
<?php
require_once(dirname(__FILE__) . '/db.php');
require_once(dirname(__FILE__) . '/common_functions.php');
if(isset($_GET['token'])){
if(!isTokenValid($conn,$_GET['token']))
die("Incorrect request");
}
else
die();
?>
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon.png">
<title>SniperPhish - The Web-Email Spear Phishing Toolkit</title>
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="css/select2.min.css">
<link rel="stylesheet" type="text/css" href="css/style.min.css">
</head>
<body>
<div class="main-wrapper">
<!-- ============================================================== -->
<!-- Preloader - style you can find in spinners.css -->
<!-- ============================================================== -->
<div class="preloader">
<div class="lds-ripple">
<div class="lds-pos"></div>
<div class="lds-pos"></div>
</div>
</div>
<!-- ============================================================== -->
<!-- Preloader - style you can find in spinners.css -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Login box.scss -->
<!-- ============================================================== -->
<div class=" d-flex no-block justify-content-center align-items-center bg-dark">
<div class="bg-dark border-top border-secondary">
<div class="text-center p-t-20 p-b-20">
<span class="db"><img src="images/logo-icon2x.png" alt="logo" /><img src="images/logo.png" alt="logo" /></span>
</div>
</div>
</div>
<div class="auth-wrapper d-flex no-block justify-content-center align-items-center bg-dark req-box">
<div class="auth-box bg-dark req-box">
<form class="form-horizontal m-t-20" id="doPwdReset">
<div class="row border-top border-secondary">
<div class="col-12">
<div class="form-group p-t-20">
<div id="inst_fields">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text bg-info text-white" id="basic-addon1"><i class="fa fas fa-key"></i></span>
</div>
<input type="password" class="form-control form-control-lg" placeholder="New Password" id="tb_pwd" aria-label="Username" aria-describedby="basic-addon1" required>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text bg-info text-white" id="basic-addon2"><i class="fa fas fa-key"></i></span>
</div>
<input type="password" class="form-control form-control-lg" placeholder="Confirm Password" id="tb_pwd_confirm" aria-label="Password" aria-describedby="basic-addon1" required>
</div>
</div>
</div>
</div>
</div>
<div class="row border-top border-secondary">
<div class="col-12">
<div class="form-group">
<div class="p-t-20">
<button class="btn btn-info float-right" id="bt_reset_pwd" type="submit"><i class="fa fas"></i> Change</button>
</div>
</div>
</div>
<div id="lb_msg" class="m-t-10"></div>
</div>
</form>
</div>
</div>
</div>
<div class="auth-wrapper bg-dark">
</div>
<!-- ============================================================== -->
<!-- All Required js -->
<!-- ============================================================== -->
<script src="js/libs/jquery/jquery-3.6.0.min.js"></script>
<script src="js/libs/js.cookie.min.js"></script>
<!-- Bootstrap tether Core JavaScript -->
<script src="js/libs/popper.min.js"></script>
<script src="js/libs/bootstrap.min.js"></script>
<!-- ============================================================== -->
<!-- This page plugin js -->
<!-- ============================================================== -->
<script src="js/libs/select2.min.js"></script>
<script src="js/libs/moment.min.js"></script>
<script src="js/libs/moment-timezone-with-data.min.js"></script>
<script>
$('[data-toggle="tooltip"]').tooltip({ trigger: "hover" });
$(".preloader").fadeOut();
// ==============================================================
$("#doPwdReset").submit(function(event) {
event.preventDefault();
if($("#tb_pwd").val() != $("#tb_pwd_confirm").val()){
$("#lb_msg").html('<span class="text-danger">Passwords are not matching.</span>');
return;
}
$("#bt_reset_pwd i").toggleClass('fa-spinner fa-spin');
$.post("pwd_manager", {
action_type: "do_change_pwd",
new_pwd: $("#tb_pwd").val(),
token: location.search.split("?token=")[1],
},
function(data, status) {
$("#bt_reset_pwd i").toggleClass('fa-spinner fa-spin');
if (data != "success")
$("#lb_msg").html('<span class="text-danger">' + data + '</span>');
else {
$("#lb_msg").html('<span class="text-success">Password reset successs. SniperPhish will rediect to login screen in few seconds..</span>');
setTimeout(function() {
document.location = location.origin + '/spear';
}, 3000);
}
});
});
</script>
</body>
</html>