Skip to content

Commit d592934

Browse files
committed
Merge branch 'develop' into main
2 parents adb92a9 + 0af393b commit d592934

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

code/app/common.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ function downCode($codePath, $prName, $codeUrl, $is_private = 0, $username = '',
230230

231231
function cleanString($string)
232232
{
233-
$string = preg_replace("/[^a-z0-9]/i", "", $string);
233+
$string = strtolower($string);
234+
$string = preg_replace("/[^a-z0-9A-Z]/i", "", $string);
235+
236+
$string = empty($string) ? md5($string) : $string;
234237

235238
return $string;
236239
}

code/app/controller/Code.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function rescan(Request $request)
6060
'python_scan_time' => '2000-01-01 00:00:00',
6161
'webshell_scan_time' => '2000-01-01 00:00:00',
6262
];
63-
Db::table('app')->where(['id' => $id])->save($array);
63+
Db::table('code')->where(['id' => $id])->save($array);
6464
Db::table('fortify')->where(['code_id' => $id])->delete();
6565
Db::table('semgrep')->where(['code_id' => $id])->delete();
6666
Db::table('code_webshell')->where(['code_id' => $id])->delete();

code/app/model/OneForAllModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function subdomainScan()
3535
$filename = $file_path.$domain.'.csv';
3636
if (!file_exists($filename)) {
3737
PluginModel::addScanLog($v['id'], __METHOD__, 2);
38-
addlog(["文件不存在:{$filename}"]);
38+
addlog(["OneForAll子域名扫描结果,文件不存在:{$filename}"]);
3939
AppModel::updateScanTime($v['id'],'subdomain_scan_time');
4040
continue;
4141
}
@@ -56,7 +56,7 @@ public static function subdomainScan()
5656
AppModel::updateScanTime($v['id'],'subdomain_scan_time');
5757
@unlink($filename);
5858
} else {
59-
addlog(["内容获取失败:{$filename}"]);
59+
addlog(["OneForAll子域名扫描,内容获取失败:{$filename}"]);
6060
}
6161
PluginModel::addScanLog($v['id'], __METHOD__, 1);
6262
}

code/app/model/WebScanModel.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,21 @@ public static function xray()
168168
$result = [];
169169
execLog($cmd, $result);
170170
$result = implode("\n", $result);
171-
addlog(["漏洞扫描结束", $id, $url, $cmd, base64_encode($result)]);
171+
addlog(["xray漏洞扫描结束", $id, $url, $cmd, base64_encode($result)]);
172172
$result = file_put_contents($pathArr['cmd_result'], $result);
173173
if ($result == false) {
174-
addlog(["写入执行结果失败", base64_encode($pathArr['cmd_result'])]);
174+
addlog(["xray写入执行结果失败", base64_encode($pathArr['cmd_result'])]);
175+
continue;
175176
}
176177
} else {
177178
addlog("xray文件已存在:{$pathArr['tool_result']}");
178179
}
179180
//如果结果文件不存在
180181
if (file_exists($pathArr['tool_result']) == false) {
181-
addlog("文件不存在:{$pathArr['tool_result']} ,扫描URL失败: {$url}");
182+
addlog("xray扫描结果文件不存在:{$pathArr['tool_result']},扫描URL失败: {$url}");
182183
Db::table('app')->where(['id' => $id])->save(['xray_scan_time' => date('2048-m-d H:i:s')]);
183184
PluginModel::addScanLog($val['id'], __METHOD__, 2);
185+
continue;
184186
}
185187

186188
$data = json_decode(file_get_contents($pathArr['tool_result']), true);
@@ -198,7 +200,7 @@ public static function xray()
198200
'poc' => $value['detail']['payload']
199201
];
200202
$addr[] = $newData;
201-
echo "添加漏洞结果:" . json_encode($newData) . PHP_EOL;
203+
echo "xray添加漏洞结果:" . json_encode($newData) . PHP_EOL;
202204
XrayModel::addXray($newData);
203205
}
204206
addlog(["xray扫描数据写入成功:".json_encode($addr)]);

0 commit comments

Comments
 (0)