From 13054d82e27164f2c004417e65af94c3e03e46c5 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Wed, 22 Oct 2025 23:02:29 -0600 Subject: [PATCH] initial commit via gitinitshit --- README.md | 3 +++ a.out | 0 build_poweroff_aarch64.sh | 4 ++++ build_poweroff_x86_x64.sh | 4 ++++ cleanup.sh | 5 +++++ poweroff_aarch64.s | 28 ++++++++++++++++++++++++++++ poweroff_x86_64.asm | 31 +++++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+) create mode 100644 README.md create mode 100644 a.out create mode 100644 build_poweroff_aarch64.sh create mode 100644 build_poweroff_x86_x64.sh create mode 100644 cleanup.sh create mode 100644 poweroff_aarch64.s create mode 100644 poweroff_x86_64.asm diff --git a/README.md b/README.md new file mode 100644 index 0000000..471a5dd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# 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** diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29 diff --git a/build_poweroff_aarch64.sh b/build_poweroff_aarch64.sh new file mode 100644 index 0000000..ce3089d --- /dev/null +++ b/build_poweroff_aarch64.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +as -o poweroff_aarch64.o poweroff_aarch64.s +ld -o poweroff_aarch64 poweroff_aarch64.o diff --git a/build_poweroff_x86_x64.sh b/build_poweroff_x86_x64.sh new file mode 100644 index 0000000..3d39d84 --- /dev/null +++ b/build_poweroff_x86_x64.sh @@ -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 diff --git a/cleanup.sh b/cleanup.sh new file mode 100644 index 0000000..ff197de --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,5 @@ +#!/bin/bash +rm -f *.o 2>/dev/null # object files +rm -f *.out 2>/dev/null +rm poweroff_aarch64 2>/dev/null +rm -f build_poweroff_x86_x64 2>/dev/null diff --git a/poweroff_aarch64.s b/poweroff_aarch64.s new file mode 100644 index 0000000..0fc6c50 --- /dev/null +++ b/poweroff_aarch64.s @@ -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 diff --git a/poweroff_x86_64.asm b/poweroff_x86_64.asm new file mode 100644 index 0000000..35ff166 --- /dev/null +++ b/poweroff_x86_64.asm @@ -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