RetroFed Forum
Your home away from modern life.
The Minefield
Post Reply
AuthorMessage
RomulusCornflakes lemmy.world RomulusCornflakes@lemmy.world
Joined: 2025-10-14
(edited) Quote

[me@penguin ~]$ ls not	much	minefield [me@penguin ~]$ cd minefield [me@penguin minefield]$ ls 1	6	11	16	README 2	7	12	17 3	8	13	18 4	9	14	19 5	10	15	20 [me@penguin minefield]$ cat README Welcome traveller.  You have reached The Minefield.  In this directory are a series of executables. You must choose one to run.  One of these executables will return you to your home directory. The others will erase your entire hard drive.  That one executable is your only way out. You cannot "cd" or "exit" your way out of this directory. Not even "shutdown" will work. And don't bother reaching for the power switch, it won't work either.  Choose carefully.  And good luck. [me@penguin minefield]$ cd [me@penguin minefield]$ cd ~ [me@penguin minefield]$ exit [me@penguin minefield]$ shutdown [me@penguin minefield]$
390   Original
weissbinder feddit.org weissbinder@feddit.org
Joined: 2025-01-23
#2 · Quote Reply

How can you prevent users from leaving a directory?

43
flyingSock feddit.org flyingSock@feddit.org
Joined: 2024-08-02
#3 · Quote Reply

How can you prevent users from leaving a directory?

chroot, and override exit with an alias,could work

37
Akatsuki Levi lemmy.world AkatsukiLevi@lemmy.world
Joined: 2023-06-05
#4 · Quote Reply

ls -lah

5
gegil sopuli.xyz gegil@sopuli.xyz
Joined: 2025-06-15
#5 · Quote Reply

How can you prevent users from leaving a directory?

How can you prevent a shutdown using a power key?

11
theunknownmuncher lemmy.world theunknownmuncher@lemmy.world
Joined: 2024-06-13
#6 · Quote Reply

How can you prevent a shutdown using a power key?

You can't, lol. Think it's just a joke

5
Unleaded8163 fedia.io Unleaded8163@fedia.io
Joined: 2023-09-12
#7 · Quote Reply

How can you prevent a shutdown using a power key?

You could probably install a handler for the event that's triggered when the power button is pressed. Most OSes do that and pop up a graceful shutdown options window. Most hardware will have a hard shutdown option when you hold the power button for a few seconds. You would probably have to overwrite the BIOS or something at that level to prevent that way out.

11
Daedskin lemmy.zip Daedskin@lemmy.zip
Joined: 2025-06-26
#8 · Quote Reply

ctrl-D

8
XLE piefed.social XLE@piefed.social
Joined: 2025-06-23
#9 · Quote Reply

How can you prevent a shutdown using a power key?

There's an Emacs command to do that

C-x M-c M-minefield

23
hperrin lemmy.ca hperrin@lemmy.ca
Joined: 2024-12-13
#10 · Quote Reply

You could probably install a handler for the event that's triggered when the power button is pressed. Most OSes do that and pop up a graceful shutdown options window. Most hardware will have a hard shutdown option when you hold the power button for a few seconds. You would probably have to overwrite the BIOS or something at that level to prevent that way out.

You could also just unplug it.

17
AstroLightz lemmy.world AstroLightz@lemmy.world
Joined: 2023-06-29
#11 · Quote Reply

I can think of a way out:

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

34
hperrin lemmy.ca hperrin@lemmy.ca
Joined: 2024-12-13
#12 · Quote Reply

How can you prevent users from leaving a directory?

AFAIK, there’s no way to without modifying the system tools and shell.

16
snooggums piefed.world snooggums@piefed.world
Joined: 2025-07-08
#13 · Quote Reply

Does it have a perpetual energy source if I unplug it?

14
assembly lemmy.world assembly@lemmy.world
Joined: 2023-06-12
#14 · Quote Reply

Combat the minefield with a fork bomb. Ain’t no process surviving this engagement.

63
shweddy lemmy.world shweddy@lemmy.world
Joined: 2026-03-21
#15 · Quote Reply

Does it fry my hardware? Or can I just do another fresh install

4
Anafabula discuss.tchncs.de Anafabula@discuss.tchncs.de
Joined: 2023-06-10
#16 · Quote Reply

\cd ~
78
Wildmimic anarchist.nexus Wildmimic@anarchist.nexus
Joined: 2025-09-05
#17 · Quote Reply

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

4
DasFaultier sh.itjust.works DasFaultier@sh.itjust.works
Joined: 2024-01-22
#18 · Quote Reply

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.

18
corsicanguppy lemmy.ca corsicanguppy@lemmy.ca
Joined: 2023-06-12
#19 · Quote Reply

\cd ~

When people don't know normal things we learned in '92, I get worried.

18
stoy lemmy.zip stoy@lemmy.zip
Joined: 2023-10-17
#20 · Quote Reply

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.

36
rockSlayer lemmy.blahaj.zone rockSlayer@lemmy.blahaj.zone
Joined: 2025-02-24
#21 · Quote Reply

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

20
pelya lemmy.world pelya@lemmy.world
Joined: 2023-07-03
#22 · Quote Reply

I can think of a way out: Just throw the whole PC away. It's someone else's problem now!

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).

4
ChaoticNeutralCzech feddit.org ChaoticNeutralCzech@feddit.org
Joined: 2024-06-23
#23 · Quote Reply

How can you prevent a shutdown using a power key?

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.

4
KoboldCoterie pawb.social KoboldCoterie@pawb.social
Joined: 2023-06-05
#24 · Quote Reply

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".

114
pelya lemmy.world pelya@lemmy.world
Joined: 2023-07-03
#25 · Quote Reply

How can you prevent a shutdown using a power key?

If you are using KDE

4
SwingingTheLamp piefed.zip SwingingTheLamp@piefed.zip
Joined: 2025-12-27
#26 · Quote Reply

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.

13
moonshadow slrpnk.net moonshadow@slrpnk.net
Joined: 2025-11-12
#27 · Quote Reply

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?

61
esc piefed.social esc@piefed.social
Joined: 2026-03-24
#28 · Quote Reply

You could probably install a handler for the event that's triggered when the power button is pressed. Most OSes do that and pop up a graceful shutdown options window. Most hardware will have a hard shutdown option when you hold the power button for a few seconds. You would probably have to overwrite the BIOS or something at that level to prevent that way out.

alt+sysrq+b bypasses this handler, also switching to another vt should just drop you in a normal shell it as well as long the login shell isn't modified. There are a lot of ways that can be used to break out.

3
durinn programming.dev emotional_soup_88@programming.dev
Joined: 2025-11-22
#29 · (edited) Quote Reply

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?

2
RustySharp programming.dev RustySharp@programming.dev
Joined: 2023-06-19
#30 · Quote Reply

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

18
timestatic feddit.org timestatic@feddit.org
Joined: 2024-07-01
#31 · Quote Reply

They never guess the next move: Unplugs pc

45
felbane lemmy.world felbane@lemmy.world
Joined: 2023-11-23
#32 · Quote Reply

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."

15
OwOarchist pawb.social OwOarchist@pawb.social
Joined: 2026-02-13
#33 · Quote Reply

cat 1

23
grue lemmy.world grue@lemmy.world
Joined: 2023-06-13
#34 · Quote Reply

How can you prevent users from leaving a directory?

Magic, I guess, 'cause nothing in the sceenshot would do it, unless the attacker had already replaced cat with a trojan or something.

20
rockerfaceπŸ‡ΊπŸ‡¦ lemmy.cafe rockerface@lemmy.cafe
Joined: 2025-06-29
#35 · Quote Reply

They never guess the next move: Unplugs pc

loud knocking on the door

25
khannie lemmy.world khannie@lemmy.world
Joined: 2023-06-21
#36 · Quote Reply

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.

Diabolical!

2
CannedYeet lemmy.world CannedYeet@lemmy.world
Joined: 2023-07-02
#37 · Quote Reply

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.

31
SavvyWolf pawb.social savvywolf@pawb.social
Joined: 2023-06-27
#38 · Quote Reply

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

(cd is a shell builtin)

28
ikidd lemmy.world ikidd@lemmy.world
Joined: 2023-06-23
#39 · Quote Reply

strings 1

3
πŸ‡¦πŸ‡Ίπ•„π•¦π•Ÿπ•₯π•–π••π•”π•£π• π•”π• π••π•šπ•π•– hilariouschaos.com muntedcrocodile@hilariouschaos.com
Joined: 2025-02-09
#40 · Quote Reply

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.

6
π•Ύπ–•π–Žπ–ˆπ–ž π•Ώπ–šπ–“π–† lemmy.world spicytuna62@lemmy.world
Joined: 2023-06-12
#41 · Quote Reply

loud knocking on the door

Either that or the PC keeps running anyway.

14
wonderingwanderer sopuli.xyz wonderingwanderer@sopuli.xyz
Joined: 2025-12-31
#42 · Quote Reply

Has "let's play a game" vibes

16
tyler programming.dev tyler@programming.dev
Joined: 2023-06-12
#43 · Quote Reply

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".

Well yeah? And you do it in a vm. But seems like a decently simple problem anyway. ls -al and compare the sizes.

17
tyler programming.dev tyler@programming.dev
Joined: 2023-06-12
#44 · (edited) Quote Reply

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 thus wouldn’t have access to erase the drive, there’s like a hundred ways to solve this.

3
tyler programming.dev tyler@programming.dev
Joined: 2023-06-12
#45 · Quote Reply

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.

4
glibg10b lemmy.zip glibg10b@lemmy.zip
Joined: 2026-02-05
#46 · Quote Reply

Reminder that binaries cannot change a shell's working directory, so the non-mines will do nothing. (cd is a shell builtin)

Technically they could if run as root by modifying the parent process

9
Sasquatch lemmy.ml Sasquatch@lemmy.ml
Joined: 2023-08-12
#47 · Quote Reply

Reminder that binaries cannot change a shell's working directory, so the non-mines will do nothing. (cd is a shell builtin)

it could just reinvoke $SHELL in the parent dir

6
kivihiili lemmy.blahaj.zone kivihiili@lemmy.blahaj.zone
Joined: 2026-01-01
#48 · Quote Reply

[deleted]
22
not_IO lemmy.blahaj.zone not_IO@lemmy.blahaj.zone
Joined: 2024-12-06
#49 · Quote Reply

\cd ~

what does this change?

13
rangber lemmy.zip rangber@lemmy.zip
Joined: 2026-03-24
#50 · Quote Reply

The power cable would like to have a word.

46
Allero lemmy.today Allero@lemmy.today
Joined: 2023-12-20
#51 · Quote Reply

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

5
Post Reply Page 1 of 2   Goto page 1, 2 Last »
Back to top