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
[ Parent
| on HN ]
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.