Skip to content

Commit 39323b2

Browse files
committed
更新未授权扫描功能
1 parent 46d4b19 commit 39323b2

File tree

7 files changed

+18
-36
lines changed

7 files changed

+18
-36
lines changed

code/app/controller/Code.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Code extends Common
1717
public $tools = [
1818
'fortify'=>'fortify',
1919
'semgrep'=>'semgrep',
20-
'kunlun'=>'kunlun',
20+
//'kunlun'=>'kunlun',
2121
'murphysec'=>'murphysec',
2222
'webshell'=>'河马webshell检测',
2323
];
@@ -147,7 +147,7 @@ public function details(Request $request)
147147
}
148148
$data['fortify'] = Db::table('fortify')->where($where)->order("id", 'desc')->limit(0, 10)->select()->toArray();
149149
//$data['kunlun'] = Db::connect('kunlun')->table("index_scanresulttask")->where($where)->order("id", 'desc')->limit(0, 10)->select()->toArray();
150-
$data['kunlun'] = [];
150+
//$data['kunlun'] = [];
151151
$data['semgrep'] = Db::table('semgrep')->where($where)->order("id", 'desc')->limit(0, 10)->select()->toArray();
152152
$data['mobsfscan'] = Db::table('mobsfscan')->where($where)->order("id", 'desc')->limit(0, 10)->select()->toArray();
153153
$data['murphysec'] = Db::table('murphysec')->where($where)->order("id", 'desc')->limit(0, 10)->select()->toArray();

code/app/controller/LinuxBaselineCheck.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

code/config/database.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
// 是否严格检查字段是否存在
4141
'fields_strict' => false,
4242

43-
4443
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
4544
'deploy' => 0,
4645
// 数据库读写是否分离 主从式有效
@@ -76,7 +75,6 @@
7675
// 是否严格检查字段是否存在
7776
'fields_strict' => false,
7877

79-
8078
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
8179
'deploy' => 0,
8280
// 数据库读写是否分离 主从式有效

code/public/install/step3.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,16 @@
2626
<div>
2727
<?php
2828
error_reporting(E_ALL);
29-
//检查数据库参数是否正确,修改系统配置文件
29+
// 检查数据库参数是否正确,修改系统配置文件
3030
writingConf();
3131

3232
//更新python配置
3333
setPythonConfig();
3434

3535
//从SQL文件中提取SQL语句
36-
$sqlArr = getSQLArr();
37-
36+
$sqlArr = getSQLArr('./qingscan.sql');
3837
//批量执行SQL语句
39-
batchExecuteSql($sqlArr);
38+
batchExecuteSql('mysql',$sqlArr);
4039

4140
addOldData();
4241
?>
@@ -63,10 +62,10 @@ function setPythonConfig(){
6362
}
6463

6564

66-
function batchExecuteSql($sqlArr)
67-
{
65+
function batchExecuteSql($database,$sqlArr)
66+
{;
6867
foreach ($sqlArr as $sql) {
69-
$result = Db::execute($sql);
68+
$result = Db::connect($database)->execute($sql);
7069
if ($result === 0) {
7170
// echo "执行SQL语句成功:<pre>{$sql}</pre><br>";
7271
} elseif (strstr($sql, "INSERT") && $result === 1) {
@@ -107,9 +106,9 @@ function addOldData()
107106
}
108107
}
109108

110-
function getSqlArr()
109+
function getSqlArr($filename)
111110
{
112-
$str = file_get_contents("./qingscan.sql");
111+
$str = file_get_contents($filename);
113112
//匹配删表语句
114113
$zhengze = "/DROP.*;/Us";
115114
preg_match_all($zhengze, $str, $shanbiao);
@@ -147,12 +146,12 @@ function writingConf()
147146
$config['connections']['mysql']['database'] = $_POST['DB_NAME'];
148147
$config['connections']['mysql']['charset'] = $_POST['DB_CHARSET'];
149148

150-
$config['connections']['kunlun']['hostname'] = $_POST['DB_HOST'];
149+
/*$config['connections']['kunlun']['hostname'] = $_POST['DB_HOST'];
151150
$config['connections']['kunlun']['hostport'] = $_POST['DB_PORT'];
152151
$config['connections']['kunlun']['username'] = $_POST['DB_USER'];
153152
$config['connections']['kunlun']['password'] = $_POST['DB_PASS'];
154153
$config['connections']['kunlun']['database'] = 'kunlun';
155-
$config['connections']['kunlun']['charset'] = $_POST['DB_CHARSET'];
154+
$config['connections']['kunlun']['charset'] = $_POST['DB_CHARSET'];*/
156155

157156
$database = "<?php \n";
158157
$database .= 'return ' . var_export($config, true) . ';';

code/view/code/list.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class="btn btn-outline-danger">批量删除</a>
5858
<th>项目地址</th>
5959
<th>clone方式</th>
6060
<th>Fortify</th>
61-
<th>Kunlun-M</th>
61+
<!--<th>Kunlun-M</th>-->
6262
<th>Semgrep</th>
6363
<th>mobsfscan</th>
6464
<th>murphysec</th>
@@ -87,11 +87,11 @@ class="btn btn-outline-danger">批量删除</a>
8787
<?php echo $fortifyNum[$value['id']] ?? 0 ?>
8888
</a>
8989
</td>
90-
<td>
91-
<a title="扫描时间:<?php echo $value['kunlun_scan_time'] ?>"
92-
href="<?php echo url('kunlun/index', ['code_id' => $value['id']]); ?>"><?php echo $kunlunNum[$value['id']] ?? 0 ?>
90+
<!--<td>
91+
<a title="扫描时间:<?php /*echo $value['kunlun_scan_time'] */?>"
92+
href="<?php /*echo url('kunlun/index', ['code_id' => $value['id']]); */?>"><?php /*echo $kunlunNum[$value['id']] ?? 0 */?>
9393
</a>
94-
</td>
94+
</td>-->
9595
<td>
9696
<a title="扫描时间:<?php echo $value['semgrep_scan_time'] ?>"
9797
href="<?php echo url('code/semgrep_list', ['code_id' => $value['id']]); ?>"><?php echo $semgrepNum[$value['id']] ?? 0 ?>

docker/data/update.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.3.0
1+
v1.7.1

docker/data/v1.7.3.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
INSERT INTO `QingScan`.`auth_rule` (`href`, `title`, `is_delete`, `is_open_auth`, `pid`, `sort`, `created_at`, `menu_status`, `update_time`, `level`, `delete_time`, `icon_url`) VALUES ('unauthorized/index', '未授权列表', 0, 1, 35, 4, 1669016435, 1, 1669016502, 2, 0, '');
2-
32
INSERT INTO `QingScan`.`process_safe` (`key`, `value`, `status`, `note`, `update_time`, `type`) VALUES ('scan unauthorizeScan', 'cd /root/qingscan/code && php think scan unauthorizeScan>> /tmp/unauthorizeScan.txt & ', 0, '未授权扫描', '2022-11-21 18:11:52', 4);

0 commit comments

Comments
 (0)