0

I found a command injection vulnerability in Linux. The system does not allow any white space characters meaning

The following command works:

;ls

But I want to provide command with space, like:

;ls -l

Since it does not allow spaces, it does not work. I tried with multiple options like Hexa for space, octal, using /NULL characters /a, /t, etc but nothing works.

In brief, is there any possibility to type multiple shell commands with no spaces in bash shell?

In more details, this is webapp which talks to Linux directly. What ever I enter in webapps - it will reflect in Linux command prompt. If I enter

;ls -a (it does not work due to space)
;ls;ifconfig; (it works and shows both commands)

migrated from security.stackexchange.com Dec 23 '15 at 5:31

This question came from our site for information security professionals.

  • You really provide us with very little to go on. Is this injection through a web app and if not, what? What is removing the whitespace? – Neil Smithline Dec 23 '15 at 3:09
  • This sounds like a superuser question because it is basically a question about bash. – schroeder Dec 23 '15 at 3:44
0

The following line includes no spaces, yet in plain bash it should run ls -l:

IFS=_;command='ls_-l';$command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy