News for hackers. Stuff that matters.
Re:Detecting the use of "curl | bash" server-side by e12e on Sunday July 29, 2018 @07:20AM (#17637532)
Quote(trying to fit it to narrow widt, for others on mobile):

  curl -s \
  'https://pgp.mit.edu/pks/lookup?op=get&search=0x1657198823E52A61'
  | gpg --import \
  && if z=$(curl -s 'https://install.zerotier.com/' | gpg);
  then echo "$z"
  | sudo bash;
  fi
It's interesting - it tries to import a given gpg key from keyserver, then grabs a gpg armored text file with a bash header - with the gpg header wrapped in a here-document:

  #!/bin/bash
  <<ENDOFSIGSTART=
  -----BEGIN PGP SIGNED MESSAGE-----
  Hash: SHA256

  ENDOFSIGSTART=
  
I'm unsure, but I think you could just stick your malicious code before the signature?

  #!/bin/bash
  sudo much_evil
  <<ENDOFSIGSTART=
  -----BEGIN PGP SIGNED MESSAGE-----
  Hash: SHA256

  ENDOFSIGSTART=
So it really isn't any better, as far as I can tell. There's also a trade-off between scripts that can be typed (curl https://i.com.com) and need copy-pasting - as copy-pasting also isn't safe - even if that's a somewhat different attack vector (compromising the web site, altering js depending on visitor).
Re:Detecting the use of "curl | bash" server-side by api on Sunday July 29, 2018 @11:02AM (#17638479)
Putting malicious code before the signature doesn't work because gpg chops it out. It only outputs the verified part.

It is definitely a kludge though.

Re:Detecting the use of "curl | bash" server-side by e12e on Sunday July 29, 2018 @02:55PM (#17639672)
So the shebang is redundant, except for testing during development? [ed: and for allowing the daring to just do curl|bash, I guess]
Re:Detecting the use of "curl | bash" server-side by api on Monday July 30, 2018 @10:04AM (#17644458)
It's not strictly necessary, no.