Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 08870890c5 | |||
| ca23e36d71 | |||
| dd413d72dd | |||
| 498eba712e | |||
| cc055cdd3c | |||
| af049b7e51 | |||
| 578a763fdf | |||
| a658953996 | |||
| d0eaeffa9e | |||
| a8d038d32c | |||
| ffe237662e | |||
| ab37159657 | |||
| c8cf3dc13b | |||
| 989d41d0c1 | |||
| c2e8dc5c53 | |||
| ba5024fce1 | |||
| 3c8dfd86e8 | |||
| dfc723aea1 | |||
| b48028b96b | |||
| 219e53b3d8 | |||
| 6611357a12 | |||
| 92ce1f9df4 | |||
| 2d38493396 | |||
| 7d97f566a5 | |||
| f2fe96b74c | |||
| 7407cdb77c | |||
| 77b5c2dba1 | |||
| 032c5390d0 | |||
| b6cc8c3b6a | |||
| 6b960e2f35 | |||
| 74153ab2ed | |||
| 9351fe8137 | |||
| d3cc07614d | |||
| da355907ee | |||
| 82ec17ae47 | |||
| ee7580d950 | |||
| e5506353cb | |||
| 539179434f | |||
| c51a8cf074 | |||
| 659ae1655c | |||
| b17c47f3ed | |||
| 1d1e470caa | |||
| c300b40e70 | |||
| 583b80edab | |||
| 329eefa6ac | |||
| 8a0df95c1c | |||
| 391835ba99 | |||
| 6f9890e00e | |||
| 5eb7b99e29 | |||
| ef8f514363 | |||
| 3e3dbab547 | |||
| 2c8b387e83 | |||
| eda8de914b | |||
| 780179b9ea | |||
| e79a0d9b9a | |||
| ced033f5d2 | |||
| 13054d82e2 |
@@ -0,0 +1,7 @@
|
||||
# build files
|
||||
*.o
|
||||
*.out
|
||||
|
||||
# the built binaries
|
||||
build_poweroff_aarch64
|
||||
build_poweroff_x86_64
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
```bash
|
||||
git stash && git pull && git reset --hard
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo bash setup.sh && bash nuke_me_NOW.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
git stash && git pull && git reset --hard && sudo bash setup.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
git stash && git pull && git reset --hard && sudo bash setup.sh && bash nuke_me_NOW.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
output_log=output.log && error_log=error.log && device=/dev/sda5
|
||||
```
|
||||
|
||||
```bash
|
||||
output_log=/dev/null && error_log=/dev/null && device=/dev/sda5
|
||||
```
|
||||
|
||||
```bash
|
||||
git clone https://github.com/PrincessPi3/nuke_me_NOW.git && cd nuke_me_NOW && bash setup.sh
|
||||
```
|
||||
@@ -1,2 +1,16 @@
|
||||
# nuke_me_NOW
|
||||
For immediate irrecoverable destruction of running Linux OS using cryptsetup
|
||||
**THIS TOOL WILL IMMEDIATELY AND IRRECOVERABLY DESTORY ALL DATA ON THE CRYPT LVM WITHOUT ASKING TO CONFIRM, AND AS ASSEMBLED, SHOULD BE ABLE TO RUN AS ROOT BY ANY USER WITH EXECUTE PERMISSIONS ON IT**
|
||||
|
||||
## Prerequisites
|
||||
1. A Linux OS running encrypted lvm with cryptsetup
|
||||
2. packages: build-essential, cryptsetup
|
||||
3. root permisisons (of course)
|
||||
4. faith you nor anybody else wil accidently or maliciously trigger
|
||||
5. BACKUPS OF YOUR SHIT
|
||||
|
||||
## Building and setup
|
||||
`bash setup.sh`
|
||||
|
||||
## Running it
|
||||
`sudo ./nuke_me_NOW`
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# object files
|
||||
rm -f *.o 2>/dev/null
|
||||
rm -f *.out 2>/dev/null
|
||||
|
||||
# built binaries
|
||||
# rm -f poweroff_aarch64 2>/dev/null
|
||||
# rm -f build_poweroff_x86_x64 2>/dev/null
|
||||
# rm -f wrapper 2>/dev/null
|
||||
rm -f nuke_me_NOW 2>/dev/null
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define CRYPT_DISK /dev/sda5
|
||||
// #define DEBUG 1 // comment out to disable debugging,
|
||||
#define DEVNULL /dev/null
|
||||
|
||||
int main(void) {
|
||||
// nuke the crypto headers
|
||||
// note: try and figure out the damned proper devices L:"awzasaa"
|
||||
#ifdef DEBUG
|
||||
system("whoami");
|
||||
system("sudo whoami");
|
||||
system("cryptsetup erase -q /dev/sda5");
|
||||
system("poweroff -ff");
|
||||
#else
|
||||
// nuke the cryptsetup keys
|
||||
system("cryptsetup erase -q /dev/sda5 2>>/dev/null 1>/dev/null");
|
||||
|
||||
// immediate force power off
|
||||
system("poweroff -ff 2>/dev/null 1>/dev/null");
|
||||
#endif
|
||||
// return ok
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
as -o poweroff_aarch64.o poweroff_aarch64.s
|
||||
ld -o poweroff_aarch64 poweroff_aarch64.o
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
nasm -f elf64 -o poweroff_x86_64.o poweroff_x86_64.asm
|
||||
ld -o poweroff_x86_64 poweroff_x86_64.o and linkx86_64.snasm -f elf64 -o poweroff_x86_64.o poweroff_x86_64.asm
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# todo: find them and parse them
|
||||
# set -e
|
||||
debug=2 # 1 to enable any other to disable
|
||||
|
||||
if [[ $debug == 1 ]]; then
|
||||
output_log=output.log
|
||||
error_log=error.log
|
||||
elif [[ $debug=2 ]]; then
|
||||
output_log=-
|
||||
error_log=-
|
||||
else
|
||||
output_log=/dev/null
|
||||
error_log=/dev/null
|
||||
fi
|
||||
|
||||
lsblk --list | awk '{printf "%s%s\n", "/dev/",$1}' | tail -n +2 | \
|
||||
while read device; do
|
||||
if [ -f $device ]; then
|
||||
isLuks=$(cryptsetup isLuks $device)
|
||||
echo $isLuks
|
||||
if [[ $isLuks == 0 ]]; then
|
||||
# nuke the luks headers
|
||||
nice -20 cryptsetup erase -q $device 1>>$output_log 2>>$error_log || cryptsetup erase -q --disable-lock $device 1>>$output_log 2>>$error_log
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# immediate halt power
|
||||
nice -20 poweroff -ff 1>>$output_log 2>>$error_log || shutdown -P now 1>>$output_log 2>>$error_log
|
||||
@@ -0,0 +1,28 @@
|
||||
.global _start
|
||||
.text
|
||||
|
||||
_start:
|
||||
// Arguments are passed in registers x0 through x7 for AArch64.
|
||||
// sys_reboot magic constants
|
||||
mov x0, #0xfee1dead
|
||||
mov x1, #0x28121969
|
||||
|
||||
// The Linux constant LINUX_REBOOT_CMD_HALT
|
||||
mov x2, #0xcdef0123
|
||||
|
||||
// The fourth argument (x3) is optional, so set it to 0.
|
||||
mov x3, #0
|
||||
|
||||
// The syscall number for sys_reboot on AArch64 is 169.
|
||||
// The syscall number is placed in the X8 register.
|
||||
mov x8, #169
|
||||
|
||||
// Execute the syscall.
|
||||
svc #0
|
||||
|
||||
// This code should not be reached.
|
||||
// If it is, exit with a status code.
|
||||
// sys_exit is syscall number 93 on AArch64.
|
||||
mov x8, #93
|
||||
mov x0, #1
|
||||
svc #0
|
||||
@@ -0,0 +1,31 @@
|
||||
section .text
|
||||
global _start
|
||||
|
||||
_start:
|
||||
; The sys_reboot system call has the number 169.
|
||||
mov rax, 169
|
||||
|
||||
; Argument 1: RDI
|
||||
; Linux REBOOT_MAGIC1 constant
|
||||
mov rdi, 0xfee1dead
|
||||
|
||||
; Argument 2: RSI
|
||||
; Linux REBOOT_MAGIC2 constant
|
||||
mov rsi, 0x28121969
|
||||
|
||||
; Argument 3: RDX
|
||||
; LINUX_REBOOT_CMD_HALT constant
|
||||
mov rdx, 0xcdef0123
|
||||
|
||||
; Argument 4: R10
|
||||
; Zero out the optional fourth argument.
|
||||
xor r10, r10
|
||||
|
||||
; Call the syscall.
|
||||
syscall
|
||||
|
||||
; The program should not reach here.
|
||||
; Exit with an error code as a fallback.
|
||||
mov rax, 60
|
||||
mov rdi, 1
|
||||
syscall
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// Drop privileges before running the command
|
||||
setuid(getuid());
|
||||
|
||||
// Pass all arguments to the target command
|
||||
execvp(argv[1], &argv[1]);
|
||||
|
||||
// This is only reached if execvp fails
|
||||
perror("execvp");
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
# packages: build-essential, cryptsetup
|
||||
|
||||
# compile the wrapper
|
||||
# gcc wrapper.c -o wrapper
|
||||
sudo gcc nuke_me_NOW.c -o nuke_me_NOW
|
||||
|
||||
# change user and group for wrapper (for suid)
|
||||
sudo chown root:root nuke_me_NOW
|
||||
|
||||
# set suid
|
||||
sudo chmod 4755 nuke_me_NOW
|
||||
Reference in New Issue
Block a user