Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2019-5096-GoAhead-Web-Server-Dos-Exploit — CVE-2019-5096 的 Python 漏洞利用程序,针对 GoAhead Web 服务器上传处理程序中的释放后使用(use-after-free)漏洞,通过双重释放(double-free)导致拒绝服务。 | Kitploit
工具/GitHubGitHub/ianxtianxt/cve-2019-5096-goahead-web-server-dos-exploit
漏洞分析漏洞利用Web应用程序漏洞利用模糊测试二进制利用
GitHubianxtianxt/cve-2019-5096-goahead-web-server-dos-exploit

CVE-2019-5096-GoAhead-Web-Server-Dos-Exploit

CVE-2019-5096 的 Python 漏洞利用程序,针对 GoAhead Web 服务器上传处理程序中的释放后使用(use-after-free)漏洞,通过双重释放(double-free)导致拒绝服务。

查看仓库

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
1326年前尚未审核
分享

CVE-2019-5096 Use After Free Dos Exploit

root@kitploit:~
python TriggerDOS.py ip	

TriggerDoubleFree

漏洞分析

[https://github.com/embedthis/goahead.git] GoAhead githublink

git diff the patch

GitDiff

关键代码分析

在代码中定位到upload.c:370,可以看到在

root@kitploit:~
	wp->currentFile=0

前执行了

root@kitploit:~
typedef struct WebsUpload {
    char    *filename;              /**< Local (temp) name of the file */
    char    *clientFilename;        /**< Client side name of the file */
    char    *contentType;           /**< Content type */
    ssize   size;                   /**< Uploaded file size */
} WebsUpload;
...

typedef struct Webs {
...
    WebsUpload      *currentFile;
...
}Webs;
...
processContentData(Webs *wp){
...
	file = wp->currentFile;
	...
	hashEnter(wp->files, wp->uploadVar, valueSymbol(file), 0);
	defineUploadVars(wp);
	wp->currentFile=0;
	...
}

其中hashEnter函数是往hash表里添加一个元素,这里造成了 wp-currentFile 的多次引用。 wp->files(hash table)里的WebsUpload结构将在 http 会话结束( Webs 生命周期结束)调用 termWebs 时 free 掉

root@kitploit:~
static void termWebs(Webs *wp, int reuse)
{
...
#if ME_GOAHEAD_UPLOAD
    if (wp->files >= 0) {
        websFreeUpload(wp);//遍历hashtable 取出WebsUpload结构体free掉。
    }
#endif
}

接下来看另外一个free 的点:

root@kitploit:~
...
processUploadHeader(Webs *wp, char *line)
{
	while (key && stok(key, ";\r\n", &nextPair)) {// 这是以 ; 为分割符解析 upload 头部
		...
		else if (scaselesscmp(key, "filename") == 0) {
		...
		freeUploadFile(wp->currentFile);
		file = wp->currentFile = walloc(sizeof(WebsUpload));
		...		
        }
	}
}

发现如果 upload 头部有 filename 字段则 free 掉 wp->currentFile, 接着 walloc 一个 WebsUpload 。
由于 sizeof(WebsUpload) 落在 global_max_fast 大小以内,堆快将按照先进后出分配,则刚刚 free 的 堆快马上又被分配,并且在之后的 processContentData 函数时又会加入 hash 表。此时 hash 表内已有该 chunk两次引用, termWebs 时发生 double free 并 abort 。

触发漏洞

一次请求添加两个 upload 头部:
在 processContentData 函数之后再次进入 processUploadHeader 函数。即如下顺序调用:

websProcessUploadData (循环) #上传状态机,每次循环确定一个状态 ->initUpload()
->processContentBoundary()
->processUploadHeader()
->processContentData()
->processContentBoundary()
->processUploadHeader()
->processContentData()
->return;

代码执行可能性

...

下载工具