How can you prevent users from leaving a directory?
chroot, and override exit with an alias,could work
How can you prevent a shutdown using a power key?
You can’t, lol. Think it’s just a joke

There’s an Emacs command to do that

C-x M-c M-minefield

Encrypt hard drive and keep the key in RAM. Could be recovered with a cold boot attack but that’s very advanced. The DOS virus ONEHALF would run as a daemon encrypring a block on the drive on each boot and intercept reads/writes to the encrypted part as if nothing ever happened. Only after encrypting ½ of the disk, it would reveal itself with an ominous

Dis is one half. Press any key to continue...

The decryption was eventually cracked by ESET and they developed a tool to recover the drive.

If you are using KDE

AFAIK, there’s no way to without modifying the system tools and shell.
Magic, I guess, 'cause nothing in the sceenshot would do it, unless the attacker had already replaced cat with a trojan or something.

I can think of a way out:

Just throw the whole PC away. It’s someone else’s problem now!

But that just becomes a Jumanji issue
But it’s on a dedicated server you have already paid for, which also hosts your own Minecraft game server with active players (mission-critical process which can never be allowed to stop).
Does it have a perpetual energy source if I unplug it?

There was an old virus that would copy your FAT table to ram, erase it from disk, and preset you with a slot machine UI where you would gamble to get the FAT back, if you won, great, the virus would write the FAT back to the drive, if not, you lost everything.

Rebooting without playing meant loosing everything.

FAT Table

Can I just pay? I can go to the ATM Machine and enter my PIN Number

You forget that FAT stands for “File Allocation Travesty.”
Combat the minefield with a fork bomb. Ain’t no process surviving this engagement.
\cd ~
When people don’t know normal things we learned in '92, I get worried.
what does this change?
Bypasses aliases and uses the original command
Does it fry my hardware? Or can I just do another fresh install
i had a school colleague who could write small programs in bytecode, so i think someone who really knows their shit can get out without issues with cat and ls, as long as there isn’t much obfuscation
Maybe something like find ./ -type f | xargs md5sum, then avoid the one directory where the executable has a different checksum. Heck, even find | ls might suffice.
This could be trivially defeated by a program which erases the hard drive unless run using a particular executable name. Then, all twenty entries could simply be hard links to the same executable file on disk, but one of the names would trigger different behavior.
So then you either cat the executable and hope it’s a shell script, you output the binary with a hex viewer and compare, you modify the executable so it’s in a lower permission group and this wouldn’t have access to erase the drive, there’s like a hundred ways to solve this.
Based on the responses in this thread, I feel like you could present this screenshot with a “I bet you couldn’t find your way out of this!” and a zip of the directory, and a significant number of users would voluntarily download it and extract it just to “prove that they could”.
Genuinely my first response. What are VMs for?
I run QubesOS BTW. My entire computer is just a bunch of VMs in a trench coat.
Running Qubes as a daily driver is some serious level of privacy enthusiasm
Well yeah? And you do it in a vm. But seems like a decently simple problem anyway. ls -al and compare the sizes.
Obvioulsy whoever set this minefield thought about this

I wonder if we could bash -n -v the source code? 🤔 Since -n should error check without execution.

Edit: maybe that only works on scripts?

They never guess the next move: Unplugs pc
loud knocking on the door
Either that or the PC keeps running anyway.
Boston Dynamics: “Ether that or the PC keeps running away.”
I’ll hit them with an rm /etc. We got out, we go out on together and on my terms.
Reminds me of gameshell, which is a rogue-like game designed to teach you the unix shell. So instead of navigating with NESW, you cd to locations. At one point you search the “garden”, which is an unmanageable tangle of directories, with find.
GitHub - phyver/GameShell: a game to learn (or teach) how to use standard commands in a Unix shell

a game to learn (or teach) how to use standard commands in a Unix shell - phyver/GameShell

GitHub

Reminder that binaries cannot change a shell’s working directory, so the non-mines will do nothing.

(cd is a shell builtin)

Good point. Also it wouldn’t stop you from just opening another terminal window haha.
Technically they could if run as root by modifying the parent process
it could just reinvoke $SHELL in the parent dir
I mean, you can just write a whole custom shell for this
Has “let’s play a game” vibes

while this is not real, something similar in principal very much was! (but not too widespread)

see here or look up “casino dos malware”

uh in short it erases “the disk’s” (unsure which) file allocation table (pretty much the dos/windows version of a superblock). apparently some versions did copy it to memory and give the user a chance though!

Casino - The Virus Encyclopedia

There also was Fake DOS back in the day
Old Software Review: Fake DOS Screen Saver 1.0

YouTube
The power cable would like to have a word.

We have squid games at home.

Squid games at home:

objdump -D * | less