Skip to content
Permalink
Browse files
Redis Commands
  • Loading branch information
hijohnnylin committed Dec 14, 2019
1 parent 8249a74 commit 241e909
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
@@ -82,26 +82,26 @@ router.post("/postgres-command",
*
*********************************************/

// router.post("/redis-command",
// [
// authenticate,
// body("command")
// .exists().withMessage("Missing Command."),
// body("arguments"),
// validateCheck
// ],
// (request, response, next) => {
// return RedisClient.send_command(request.values.command, request.values.arguments ? request.values.arguments.split(",") : null, (error, result) => {
// if (error) {
// next(error);
// }
// else {
// response.status(200).json({
// message: result
// });
// }
// });
// });
router.post("/redis-command",
[
authenticate,
body("command")
.exists().withMessage("Missing Command."),
body("arguments"),
validateCheck
],
(request, response, next) => {
return RedisClient.send_command(request.values.command, request.values.arguments ? request.values.arguments.split(",") : null, (error, result) => {
if (error) {
next(error);
}
else {
response.status(200).json({
message: result
});
}
});
});

router.post("/get-brute",
[
@@ -24,15 +24,15 @@
</div>
</div>

<!-- <div class="container-fluid mt-1 p-3 rounded confirmed-bg text-center">
<div class="container-fluid mt-1 p-3 rounded confirmed-bg text-center">
<h1 class="h6 text-center"><strong>Redis Console</strong></h1>
<div>
<input type="text" id="redisCommand" class="form-control" placeholder="Command e.g, KEYS"/>
<input type="text" id="redisArguments" class="form-control" placeholder="Comma separated arguments"/>
<textarea rows="12" type="text" id="redisResult" class="form-control mt-2"></textarea>
<button id="redisCommandButton" onclick="redisCommand();" class="btn confirmed-blue-btn btn-sm mt-2" style="width: 50%;">Submit</button>
</div>
</div> -->
</div>

<div class="container-fluid mt-1 p-3 rounded confirmed-bg text-center">
<h1 class="h6 text-center"><strong>Get Brute for IP</strong></h1>
@@ -82,24 +82,24 @@
http.send(params);
}
// function redisCommand() {
// var http = new XMLHttpRequest();
// var url = "redis-command";
// http.open("POST", url, true);
// var params = "command=" + encodeURIComponent(document.getElementById("redisCommand").value) + "&arguments=" + encodeURIComponent(document.getElementById("redisArguments").value);
// http.responseType = 'json';
// http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// http.onreadystatechange = function() {
// if (http.readyState == 4) {
// if (http.status == 200) {
// document.getElementById("redisResult").value = http.response.message;
// return;
// }
// alert("Error: " + JSON.stringify(http.response));
// }
// }
// http.send(params);
// }
function redisCommand() {
var http = new XMLHttpRequest();
var url = "redis-command";
http.open("POST", url, true);
var params = "command=" + encodeURIComponent(document.getElementById("redisCommand").value) + "&arguments=" + encodeURIComponent(document.getElementById("redisArguments").value);
http.responseType = 'json';
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if (http.readyState == 4) {
if (http.status == 200) {
document.getElementById("redisResult").value = http.response.message;
return;
}
alert("Error: " + JSON.stringify(http.response));
}
}
http.send(params);
}
function getBrute() {
var http = new XMLHttpRequest();

0 comments on commit 241e909

Please sign in to comment.