News for hackers. Stuff that matters.
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by tryauuum on Saturday January 28, 2023 @10:09AM (#34558123)

  echo {a..z} | tr ' ' '\n' | sort -R | head -1 > /proc/sysrq-trigger 
this is my favourite linux russian roulette
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by LinuxBender on Saturday January 28, 2023 @10:41AM (#34558444)
Here's a variant that works in #!/bin/ash

    base64 /dev/urandom | tr -d '/+'| sed s/[^[:alpha:]]//g |tr 'A-Z' 'a-z' | dd bs=1 count=1 2>/dev/null
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by sillysaurusx on Saturday January 28, 2023 @11:36AM (#34558995)
For a moment I was excited to learn about a new shell named ash.
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by captainkrtek on Saturday January 28, 2023 @11:48AM (#34559099)
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by joshenders on Saturday January 28, 2023 @05:38PM (#34562763)
Got your wish
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by mhio on Tuesday January 31, 2023 @08:52AM (#34594975)
I hate to be a golfer... buuuut this should still be pretty generic shell

    LC_ALL=C tr -dc 'a-z' </dev/urandom | head -c 1
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by tryauuum on Wednesday February 01, 2023 @10:10AM (#34611514)
I think you don't even need

  head -c 1
because sysrq-trigger will read only one character anyway
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by mhio on Wednesday February 01, 2023 @11:55PM (#34622251)
Nice one! I wasn't taking testing that far =)

edit - Actually I don't think it closes the input, so for an initial char that doesn't cause something fatal it looks to continue writing.

Re:Russhian Roulette: 1/6 chance of posting your SSH private... by tryauuum on Thursday February 02, 2023 @08:39AM (#34626320)
just tested -- only reads first char, at least with echo (also any character which is not used is used as "h")

  echo apm > /proc/sysrq-trigger
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by mhio on Thursday February 02, 2023 @06:00PM (#34634517)
I saw that too, but in this case `echo` exits. My note was just regarding the pipeline will continue to write forever if the first character was any of the non destructive commands.

Without trashing vms...

    ( while true; do printf 'a'; done ) > /proc/sysrq-trigger
With the `head`, the output is closed.
Re:Russhian Roulette: 1/6 chance of posting your SSH private... by stavros on Saturday January 28, 2023 @11:09AM (#34558736)
This echoes a letter to /proc/sysrq-trigger, with Deck of Many Fates results:

https://www.kernel.org/doc/html/v4.15/admin-guide/sysrq.html...

EDIT: Yeah, uh, it works.