312-50V13 · Question #26
env x='(){ :;};echo exploit' bash c 'cat/etc/passwd' What is the Shellshock bash vulnerability attempting to do on a vulnerable Linux host?
The correct answer is D. Display passwd content to prompt. The Shellshock bash vulnerability, demonstrated by the provided command, attempts to execute arbitrary commands by injecting them into environment variables, ultimately displaying the content of /etc/passwd.
Question
Options
- ARemoves the passwd file
- BChanges all passwords in passwd
- CAdd new user to the passwd file
- DDisplay passwd content to prompt
How the community answered
(31 responses)- B6% (2)
- C3% (1)
- D90% (28)
Why each option
The Shellshock bash vulnerability, demonstrated by the provided command, attempts to execute arbitrary commands by injecting them into environment variables, ultimately displaying the content of `/etc/passwd`.
The command `cat /etc/passwd` is used to display the file's content, not remove it; `rm` would be used for removal.
The command `cat /etc/passwd` only displays the file; it does not change any passwords. Password changes typically involve commands like `passwd`.
The command `cat /etc/passwd` does not add new users; adding users typically involves `useradd` or direct modification of `/etc/passwd` and `/etc/shadow` in a structured way.
In a vulnerable system, the bash shell will parse the function definition within the `x` variable from the environment, and then execute the subsequent `bash -c 'cat/etc/passwd'` command, causing the content of the `/etc/passwd` file to be displayed to standard output.
Concept tested: Shellshock vulnerability exploitation
Source: https://www.redhat.com/en/topics/security/shellshock
Topics
Community Discussion
No community discussion yet for this question.