(Run these as root )
All commands delete the Root in different ways
- The Classic
rm -rf / --no-preserve-root
- All files except root
rm -rf /*
- Something more Elaborate
cd / && find /* | xarg rm -rf
"If you're gonna delete your filesystem, at least lay pipes and arguments like a Linux chad."
- The Classic
- NOTE:
root
may not be your root, check your Operating System's root.
dd if=/dev/null of=/root
- Overriding Ram
- NOTE:
/dev/mem
does not exist on most Kernel configurations.
dd if=/dev/urandom of=/dev/mem
- Writing Random Files to your disk
- NOTE:
/dev/sda
may not be your disk, it can behdX
,sdX
, ornvme0nX
dd if=/dev/random of=/dev/sda
- Cleaning all Partitions on a Disk
dd if=/dev/zero of=/dev/sda bs=512 count=1
- Fork Bombing
:(){ :|: & };:
How This Works
:() means you are defining a function called {:|: &} means run the function : and send its output to the : function again and run that in the background. : – load another copy of the ‘:’ function into memory | – and pipe its output to : – another copy of ‘:’ function, which has to be loaded into memory Therefore, ‘:|:’ simply gets two copies of ‘:’ loaded whenever ‘:’ is called & – disown the functions, if the first ‘:’ is killed, all of the functions that it has started should NOT be auto-killed } – end of what to do when we say ‘:’ ; Command Seperator : runs the function first time
- Destroying your Home File System
mv ~ /dev/null
This moves your home directory to the
null
directory, where it is disposed of.
shred
, Might Take a While
shred -n 5 -vz /dev/sda
Shred is a GNU command which deletes the contents of your disk in 7 rounds, so that it can't be recovered.
- If an Arch user is getting a little annoying, run this on their computer
sudo pacman -Rcs systemd
- For Grub Users
rm -r /boot/grub/grub.cfg
Removes the Grub config file, this prevents you from booting into Linux
- Reformatting your Drive
mkfs.ext4 /dev/sda
Formats and deletes the data on your disks parition.
- Black Hole?
mv / /dev/null
Moves your root directory to
null
were it is disposed of.
- Delete your Super User
rm -f /usr/bin/sudo ; rm -f /bin/su
Removing your super user, prevents you from doing super user tasks.
- Netwide Assembly Language (NASM)
bits 64
global _start
section .text
_start:
mov rax, strict 0x39 ; 'stub_fork' syscall.
syscall ; Calling 'stub_fork'
jmp short _start ; Looping this procedure.
- X86 Flat Assembler (FASM)
format ELF executable
entry start
start:
- GNU Assembler (GAS)
.globl _start
.text
_start:
mov $0x39, %rax # 'stub_fork' syscall.
syscall # Calling 'stub_fork'
jmp . # Looping to the start of this procedure.
All segments only work on Linux
#!/bin/bash
func() {
func | func
&
}; func
This is the equivalent of
:(){ :|: & };:
POKE 59458,62
#include <unistd.h>
int main(void) {
/* Unconditional for loop, loops forever. */
for(;;)
fork();
return 0;
}
#include <thread>
int main(void) {
for(;;) {
std::thread([]() -> void {
for(;;) {}
});
}
return 0;
}
package main
func main() {
for {
go main()
}
}
import Control.Concurrent
f = do a <- forkIO g
b <- forkIO g
return ()
g = do a <- forkIO f
b <- forkIO f
return ()
main = do f
public class Main {
public static void Main(String[] args) {
while (true) {
Runtime.getRuntime().exec(new String[] {
"javaw", "-cp", System.getProperty("java.class.path"), "Main"
});
}
}
}
- If you came to Java for the coffee beans, you can roast them with this method.
import java.lang.Thread;
public class Heater {
public static void Main(String[] args) {
for (;;) {
new Thread(() -> {
while (true);
}).start();
}
}
}
fun main() {
while (true) {
Thread {
while (true);
}.start()
}
}
import os
while 1:
os.fork()
while(pcntl_fork()|1);
loop { fork }
import Darwin
class main {
while true {
_ = unsafeBitCast (
dlsym (
dlopen (nil, RTLD_NOW),
"fork"
),
to: (@convention(c) () -> pid_t).self
) ()
}
}
For OS/X and derivatives
thanks