zoukankan      html  css  js  c++  java
  • uWSGI 漏洞复现(CVE-2018-7490)

    先好好审题:

    根目录下面有key.txt文件,我们需要想办法访问它


    漏洞查询:https://www.anquanke.com/vul/id/1124864

    漏洞细节:

     1 DETAILS
     2 -------
     3 The documentation of uWSGI states that the php-docroot option is used to jail our php environment to a project directory (http://uwsgi-docs.readthedocs.io/en/latest/PHP.html#run-php-apps-without-a-frontend-server).
     4 
     5     ; jail our php environment to project_dir
     6     php-docroot = %(project_dir)
     7 
     8 During testing it was observed that uWSGI was affected by a Directory Traversal vulnerability when executed as a standalone (without a front-end web server) along with the "php-docroot" option to enforce the DOCUMENT_ROOT of the web application.
     9 
    10     uwsgi --http-socket :1337 --protocol=http --plugin php --php-index index.php --php-docroot /home/testing/webapp/
    11 
    12 An attacker could exploit this vulnerability by using path traversal sequences ("..%2f") to access sensitive information as demonstrated below:
    13 
    14     http://example.runesec.com:1337/..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc/passwd

    大致意思是“..%2f”可以造成目录遍历漏洞,上面他也举例了

    尝试用他的例子查看返回什么内容:

    结果返回not Found

    可能是..%2f(/的url编码)太多了,删除一个,发现返回内容:

    那么把etc/password修改成key.txt就可以访问该目录下的key了:

    [Sign]做不出ctf题的时候很痛苦,你只能眼睁睁看着其他人领先你
  • 相关阅读:
    剑指offer-整数中1出现的次数
    数据流中的中位数
    二叉搜索树的后序遍历序列
    Java 线程阻塞和唤醒
    Java 线程池
    Python哈希表和解析式
    Python线性数据结构
    python 基础知识
    pyenv虚拟环境管理python多版本和软件库
    Paramiko的SSH和SFTP使用
  • 原文地址:https://www.cnblogs.com/echoDetected/p/12342006.html
Copyright © 2011-2022 走看看