I set up a quick demonstration to show risks of curl|bash and how a bad-actor could potentially hide a malicious script.

It’s nothing new or groundbreaking, but I figure it never hurts to have another reminder.

  • Flipper@feddit.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    10 hours ago

    Its timing based. Ehen piped a script, bash executes Dach line completly before taking the next line from the input. Curl has a limited output buffer.

    1. Operation that takes a long time. Like a sleep, or if zou want it less obvious. A download, an unzip operation, apt update, etc.
    2. Fill the buffer with more bash commands.
    3. Measure on the server if at some point curl stops downloading the script.
    4. Serve a malicious payload.