# Semcms v3.5 sql注入漏洞
=======================
一、漏洞简介
————
二、漏洞影响
————
Semcms v3.5
三、复现过程
————
### 漏洞分析
在分析过程中看到网上已经有人发现semcms
V2.4存在过滤不严导致sql注入的漏洞,不知道咋还没改,而且最新版过滤的关键字更少了。
首先查看首页文件index.php的代码
1
1 //网站logo
2
3 $weblogo=$web_url_meate.str_replace(‘../’,”,$row[‘web_logo’]);
4
5 // 控制文字标签 更改 获取的 语种 id
6
7 if (isset($_GET[“languageIDD”])){$Language=test_input(verify_str($_GET[“languageIDD”]));}else{$Language=verify_str($Language);}
8
9 if(!empty($Language)){
10
11 //网站SEO设定
12
13 $query=$db_conn->query(“select * from sc_tagandseo where languageID=$Language”);
14 $row=mysqli_fetch_array($query);
15 $tag_indexmetatit=datato($row[‘tag_indexmetatit’]);// 首页标题
1 // 防sql入注
2
3 if (isset($_GET)){$GetArray=$_GET;}else{$GetArray=”;} //所有GET方式提交的变量都进行防注入检查
4
5 foreach ($GetArray as $value){ //get
6
7 verify_str($value);
8
9 }
10
11 function inject_check_sql($sql_str) {
12
13 return preg_match(‘/select|insert|=|%|<|between|update|\'|\*|union|into|load_file|outfile/i',$sql_str); //过滤关键字
14 }
15
16 function verify_str($str) {
17
18 if(inject_check_sql($str)) {
19
20 exit('Sorry,You do this is wrong! (.-.)'); //如果出现关键字则提示
21 }
22
23 return $str;
24 }
1 function test_input($data) { //防止XSS
2 $data = str_replace("