Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
not_IO ( not_IO@lemmy.blahaj.zone )  to Programmer Humor@programming.devEnglish · 2 months ago

finally something worse then curl | sh

lemmy.blahaj.zone

message-square
52
link
fedilink
505

finally something worse then curl | sh

lemmy.blahaj.zone

not_IO ( not_IO@lemmy.blahaj.zone )  to Programmer Humor@programming.devEnglish · 2 months ago
message-square
52
link
fedilink

https://labyrinth.zone/objects/96478395-64d9-452c-a906-9e6159cd10a3

  • Unleaded8163 ( Unleaded8163@fedia.io ) 
    link
    fedilink
    arrow-up
    25
    ·
    2 months ago

    If you trust the site, curl | sh is no worse than any other install method. If you don’t trust the site, it’s also no worse.

    • not_IO ( not_IO@lemmy.blahaj.zone ) OP
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      that’s why you install from repos managed by people you trust, it’s like an app store without all the evil

    • kayzeekayzee ( kayzeekayzee@lemmy.blahaj.zone ) 
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 months ago

      yeah you can also just curl > cat and check the script yourself

      • nanometer1625 ( nanometer1625@thelemmy.club ) 
        link
        fedilink
        arrow-up
        13
        ·
        2 months ago

        🐱.sh

        • softwarist ( softwarist@programming.dev ) 
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 months ago

          Relevant

          • cravl ( cravl@slrpnk.net ) 
            link
            fedilink
            arrow-up
            1
            ·
            2 months ago

            Huh, nifty.

      • FishFace ( FishFace@piefed.social ) 
        link
        fedilink
        English
        arrow-up
        9
        ·
        2 months ago

        Do you mean curl | cat or do you really want to create a file called cat?

        Also piping to cat seems redundant but malicious hosts can detect whether the request is getting redirected, using some clever trick, so it’s not.

        Also, your chance of spotting something bad in a malicious script is probably quite small.

        • xthexder ( xthexder@l.sw0.com ) 
          link
          fedilink
          arrow-up
          6
          ·
          2 months ago

          Saving it to a file is actually a decent method, since you can be sure the script you’re reviewing is the same one you’re running.

          Personally I often will just manually run the install steps in order if the script is simple enough. Half the time it’s just a bunch of OS version checks followed by a tar -xf

        • cenzorrll ( cenzorrll@piefed.ca ) 
          link
          fedilink
          English
          arrow-up
          6
          ·
          2 months ago

          This is my opinion on curl | sh/bash type directions. If the maintainers don’t provide a hash so I can confirm that is what they intended, there ain’t much I can do unless someone slapped in a function named “totallyNotMalware” into the script. I’ve looked through scripts, seen what they do, but I’m not good enough to recognize anything funky.

        • Ghoelian ( Ghoelian@piefed.social ) 
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 months ago

          If you just run the file you just created, it doesn’t matter that they detected a redirect. I mean it would be a bit silly to download a script, check it, and then re-download it to pipe into bash.

          • FishFace ( FishFace@piefed.social ) 
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 months ago

            Downloading a two kilobyte script a second time is probably less effort than remembering to rm the script after running it, so if you don’t want to keep it, it could be better :)

        • Dumhuvud ( Dumhuvud@programming.dev ) 
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 months ago

          Also piping to cat seems redundant but malicious hosts can detect whether the request is getting redirected, using some clever trick, so it’s not.

          Just so you know, servers cannot detect piping to any arbitrary process. The trick you’re talking about is detecting piping to an interpreter, for the lack of a better term. Piping sleep N to bash is observable behaviour, for example. Piping anything to cat is not.

          https://web.archive.org/web/20250622061208/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/

          • FishFace ( FishFace@piefed.social ) 
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 months ago

            Oh, I had totally forgotten how it worked! I thought it was exactly that. Thanks for the correction

      • not_IO ( not_IO@lemmy.blahaj.zone ) OP
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 months ago

        or just curl

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 360 users / day
  • 1.51K users / week
  • 3.19K users / month
  • 7.38K users / 6 months
  • 463 local subscribers
  • 33.4K subscribers
  • 1.52K Posts
  • 25K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code