code
stringlengths 1
1.05M
| repo_name
stringlengths 6
83
| path
stringlengths 3
242
| language
stringclasses 222
values | license
stringclasses 20
values | size
int64 1
1.05M
|
|---|---|---|---|---|---|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_26585
{
meta:
date = "2024-02-21"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {48 FA FF B4 09 C0 19 D1 2A 00 80 52 2A 01 00 B9 BF 3B 03 D5 89 56 40 F9 1F 01 09 EB F5 17 9F 1A}
$fix = {E0 03 08 AA 81 3A 00 B9 45 EF FF 97}
condition:
((not $vul) or $fix) and console.log("OpenHarmony-CVE-2024-26585 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-26585/TestCaseRule-OpenHarmony-CVE-2024-26585.yara
|
YARA
|
unknown
| 1,140
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE202436270
{
meta:
date="2024-12-29"
openharmony_sa=""
cve="CVE-2024-36270"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {08 FD DF C8 88 01 00 B4 08 41 00 91 08 FD DF C8}
$vul = {08 FD DF C8 08 41 00 91 08 FD DF C8 28 01 00 B4}
condition:
((not $vul) and $fix) and console.log("CVE-2024-36270 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-36270/TestCaseRule-OpenHarmony-CVE-2024-36270.yara
|
YARA
|
unknown
| 1,094
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule CVE_2024_38564
{
meta:
date = "2024-12-18"
openharmony_sa = ""
cve = "CVE-2024-38564"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {e0 03 13 2a ?? ?? ?? ?? 88 06 40 b9 1f 01 00 6b}
condition:
$fix and console.log("CVE-2024-38564 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38564/TestCaseRule-CVE-2024-38564.yara
|
YARA
|
unknown
| 1,030
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_38577
{
meta:
date="2024-12-06"
openharmony_sa=""
cve="CVE-2024-38577"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {45 5D 41 F9 06 61 41 F9 E0 23 00 91 01 08 80 52 ?? ?? 19 94}
condition:
$fix and console.log("CVE-2024-38577 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38577/TestCaseRule-CVE-2024-38577.yara
|
YARA
|
unknown
| 1,028
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_38588
{
meta:
date="2024-12-06"
openharmony_sa=""
cve="CVE-2024-38588"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {93 00 00 B4 ?? 4D FE 97 E0 03 13 AA 1D 00 00 94}
condition:
$fix and console.log("CVE-2024-38588 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38588/TestCaseRule-CVE-2024-38588.yara
|
YARA
|
unknown
| 1,020
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_38601
{
meta:
date = "2023-03-08"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {?? ?? 50 94 F9 03 00 AA E0 03 17 AA ?? ?? 00 94 E0 03 18 AA E1 03 19 AA ?? ?? 50 94}
condition:
$fix and console.log("OpenHarmony-CVE-2024-38601 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38601/TestCaseRule-OpenHarmony-CVE-2024-38601.yara
|
YARA
|
unknown
| 1,083
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_5535
{
meta:
date="2024-11-15"
openharmony_sa=""
cve="CVE-2024-5535"
affected_files="/system/lib/chipset-pub-sdk/libssl_openssl.z.so"
strings:
$fix = {?? F1 01 00 ?? F8 00 00 0B 70 ?? D4}
condition:
$fix and console.log("CVE-2024-5535 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/CVE-2024-5535/TestCaseRule-CVE-2024-5535.yara
|
YARA
|
unknown
| 1,038
|
/*
*Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*http://www.apache.org/licenses/LICENSE-2.0
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_42114
{
meta:
date = "2024-07-12"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {69 6E 6F 64 65 20 28 69 6E 6F 3D}
$fix = {69 6E 6F 64 65 20 28 69 6E 6F 3D 25 6C 78 29 20 68 61 73 20 63 6F 72 72 75 70 74 65 64 20 69 5F 78 61 74 74 72 5F 6E 69 64 3A 20 25 75 2C 20 72 75 6E 20 66 73 63 6B 20 74 6F 20 66 69 78 2E 00}
condition:
((not $vul) or $fix) and console.log("OpenHarmony-CVE-2024-39467 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/09/OpenHarmony-CVE-2024-39467/TestCaseRule-OpenHarmony-CVE-2024-39467.yara
|
YARA
|
unknown
| 1,184
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule CVE_2023_52672
{
meta:
date = "2024-12-18"
openharmony_sa = ""
cve = "CVE-2023-52672"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {f8 37 b5 4e 14 12 74 92 00 b9 74 9a 00 b9}
condition:
(not $vul) and console.log("CVE-2023-52672 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE-2023-52672/TestCaseRule-CVE-2023-52672.yara
|
YARA
|
unknown
| 1,029
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_35947
{
meta:
date = "2024-05-19"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = "parse err after word:%d=%s\n"
condition:
$fix and console.log("OpenHarmony-CVE-2024-35947 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE-2024-35947/TestCaseRule-OpenHarmony-CVE-2024-35947.yara
|
YARA
|
unknown
| 1,003
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_40971
{
meta:
date="2024-12-10"
openharmony_sa=""
cve="CVE_2024_40971"
affected_files=""
strings:
$fix = {68 92 47 B9 ?? ?? ?? ?? 49 00 80 52 75 C2 1F 39 7F E2 1F 39 F5 0B 40 F9}
condition:
$fix and console.log("CVE_2024_40971 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE-2024-40971/CVE-2024-40971.yara
|
YARA
|
unknown
| 984
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_41035
{
meta:
date="2024-12-19"
openharmony_sa=""
cve="CVE-2024-41035"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix="config %d interface %d altsetting %d has an endpoint descriptor with address 0x%X, changing to 0x%X"
condition:
$fix and console.log("CVE-2024-41035 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE-2024-41035/TestCaseRule-CVE-2024-41035.yara
|
YARA
|
unknown
| 1,068
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestcaseRule_OpenHarmony_CVE-2024-41087
{
meta:
date = "2024-10"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {E0 03 13 AA ?? ?? DF 97 04 00 00 14}
$vul = {E0 03 13 AA F5 76 DF 97}
condition:
((not $vul) and $fix) and console.log("CVE-2024-41087 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE-2024-41087/TestcaseRule-OpenHarmony-CVE-2024-41087.yara
|
YARA
|
unknown
| 1,057
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_42115
{
meta:
date="2024-10"
openharmony_sa=""
cve="CVE_2024_42115"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {60 C2 01 91 ?? ?? F8 97}
$fix = {60 C2 01 91 7F 2E 00 F9 ?? ?? F8 97}
condition:
((not $vul) or $fix) and console.log("CVE-2024-42115 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/CVE_2024_42115/TestCaseRule-CVE-2024-42115.yara
|
YARA
|
unknown
| 1,087
|
/*
*Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*http://www.apache.org/licenses/LICENSE-2.0
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_42114
{
meta:
date = "2024-09-26"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {A8 82 23 91 F3 03 00 AA 08 FD DF C8 16 01 40 F9 C8 52 41 39}
$fix = {D6 C2 00 91 F3 03 00 AA E0 03 16 AA 0F 40 51 94 A8 82 23 91 09 41 38 D5 08 FD DF C8 E1 03 13 AA}
condition:
((not $vul) or $fix) and console.log("OpenHarmony-CVE-2024-42114 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/10/OpenHarmony-CVE-2024-42114/TestCaseRule-OpenHarmony-CVE-2024-42114.yara
|
YARA
|
unknown
| 1,113
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_26684
{
meta:
date = "2024-02-19"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = "Read Rx Descriptor Parity checker Error"
condition:
$fix and console.log("OpenHarmony-CVE-2024-26684 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2024/12/CVE-2024-26684/TestCaseRule-OpenHarmony-CVE-2024-26684.yara
|
YARA
|
unknown
| 1,016
|
import "console"
rule CVE_2024_54030
{
meta:
date = "2025-01-22"
openharmony_sa = ""
cve = "CVE-2024-54030"
// 这是你提取出来的那个文件名
affected_files = "/system/lib/libsoftbus_server.z.so"
strings:
// 特征:这是补丁中新增的字符串。
// 如果文件里有这句话,说明打过补丁了。
$fix = "lock list err"
condition:
// 逻辑:如果找到了 $fix 字符串,打印 pass (通过测试)
$fix and console.log("CVE-2024-54030 testcase pass")
}
|
2301_80000730/security
|
vulntest/SSTSTestcases/2025/01/CVE-2024-54030/CVE-2024-54030.yara
|
YARA
|
unknown
| 576
|
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
}
|
2301_80000730/security
|
vulntest/vultraining/entry/hvigorfile.ts
|
TypeScript
|
unknown
| 234
|
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
}
|
2301_80000730/security
|
vulntest/vultraining/hvigorfile.ts
|
TypeScript
|
unknown
| 234
|
<form name="punchout_form" method="post" action="https://openapi-sandbox.dl.alipaydev.com/gateway.do?charset=utf-8&method=alipay.trade.page.pay&sign=WXDgNH13hpLyRJCpEN8809kzbFVv2rra%2BXT458dLGDRMXuvrZmY%2FuqoPXCUGTDa6NkEFDDYEXmCKKLTgF8m5QC%2FL1HA8D2ABIS%2FnBGjw%2FzvPR9v3AZ20SFbjkYB05s8Mvh%2Bo%2FLb%2FW7%2FBoXbFRCxhY%2FJRpKXJ2hn9TF%2Bof2TWxuORHQN7GwmTEJweNgp3mxa5nqZY9qIY0voJav6lHwkf%2F2dEAb2nUz4DN1g9TqmU7KJx7rbb6OaoK9OiH3ho5lnRLKIwrxIO9ZRy2h9BSBHE4ivSERqOcXaX2JRPo7MtWmbeqB5L4YY1XBgRqcn7BRECL9j6rfGp0G2F8MS%2BOtBEKg%3D%3D&return_url=https%3A%2F%2Fgaga.plus¬ify_url=http%3A%2F%2Fxfg-studio.natapp1.cc%2Fapi%2Fv1%2Falipay%2Falipay_notify_url&version=1.0&app_id=9021000132689924&sign_type=RSA2×tamp=2024-09-30+10%3A09%3A00&alipay_sdk=alipay-sdk-java-4.38.157.ALL&format=json">
<input type="hidden" name="biz_content" value="{"out_trade_no":"2104794633863934","total_amount":"1.68","subject":"测试商品","product_code":"FAST_INSTANT_TRADE_PAY"}">
<input type="submit" value="立即支付" style="display:none" >
</form>
<script>document.forms[0].submit();</script>
|
2203_75730178/s-pay-mall-mvc
|
docs/dev-ops/nginx/html/form.html
|
HTML
|
unknown
| 1,161
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>商品下单支付页</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f7f7f7;
text-align: center; /* 添加居中对齐 */
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.product-info {
margin-bottom: 20px;
border: 1px solid #ddd; /* 添加边框 */
padding: 10px; /* 添加内边距 */
text-align: center; /* 添加居中对齐 */
}
.product-info h2 {
margin: 0;
margin-bottom: 5px;
}
.product-info p {
font-size: 36px; /* 加大字体 */
font-weight: bold; /* 加粗字体 */
color: red; /* 字体颜色改为红色 */
margin: 0; /* 移除默认的margin */
margin-top: 20px;
}
.order-button {
display: block;
width: calc(100% - 40px); /* 减去padding的宽度 */
padding: 10px;
margin: 10px auto; /* 添加自动外边距实现居中 */
font-size: 16px;
color: #fff;
background-color: #007bff;
border: none;
cursor: pointer;
border-radius: 20px; /* 添加圆角 */
}
.order-button:hover {
background-color: #0056b3;
}
.account-info {
font-size: 12px; /* 设置字体大小为9号 */
text-align: center; /* 居中对齐 */
display: block; /* 使span表现得像块级元素 */
margin: 10px 0; /* 添加上下外边距 */
}
</style>
</head>
<body>
<div class="container">
<div class="product-info">
<h2>美女程序员 - 同款机械键盘</h2>
<img width="350" src="images/sku-keyboard-001.png"/>
<p>价格:¥1.68</p>
</div>
<button id="orderButton" class="order-button">立即下单「沙箱支付」</button>
<span class="account-info">测试账号:kvhmoj3832@sandbox.com 密码:111111 支付:111111</span>
</div>
<script>
function getCookie(name) {
let cookieArr = document.cookie.split(";");
for(let i = 0; i < cookieArr.length; i++) {
let cookiePair = cookieArr[i].split("=");
if(name == cookiePair[0].trim()) {
return decodeURIComponent(cookiePair[1]);
}
}
return null;
}
document.getElementById('orderButton').addEventListener('click', function() {
var userId = getCookie("loginToken");
if (!userId) {
window.location.href = "login.html"; // 跳转到登录页
return;
}
var productId = "100010090091";
var url = 'http://192.168.1.106:8080/api/v1/alipay/create_pay_order';
var requestBody = {
userId: userId,
productId: productId
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(requestBody) // 将请求体转换为JSON字符串
})
.then(response => response.json()) // 解析JSON格式的响应
.then(json => {
if (json.code === "0000") { // 假设成功的code是"0000"
var formHtml = json.data; // 获取data字段中的HTML表单字符串
document.body.innerHTML += formHtml; // 将表单添加到页面上
document.forms[0].submit(); // 自动提交表单
} else {
console.error('Error:', json.info); // 输出错误信息
}
})
.catch(error => console.error('Error:', error));
});
</script>
</body>
</html>
|
2203_75730178/s-pay-mall-mvc
|
docs/dev-ops/nginx/html/index.html
|
HTML
|
unknown
| 3,728
|
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>S Pay Mall 商城登录页</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.login-container {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 400px;
width: 100%;
}
.login-container h1 {
margin-bottom: 20px;
color: #333;
}
.qr-code {
margin: 20px 0;
}
.qr-code img {
width: 200px;
height: 200px;
}
.instructions {
color: #666;
font-size: 14px;
}
</style>
</head>
<body>
<div class="login-container">
<h1>S Pay Mall 商城登录页</h1>
<div class="qr-code">
<img id="qr-code-img" src="./images/placeholder.png" alt="微信二维码">
</div>
<p class="instructions">请使用微信扫描二维码登录</p>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
// 获取二维码 ticket
fetch('http://192.168.1.106:8080/api/v1/login/weixin_qrcode_ticket')
.then(response => response.json())
.then(data => {
if (data.code === "0000") {
const ticket = data.data;
const qrCodeImg = document.getElementById('qr-code-img');
qrCodeImg.src = `https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${ticket}`;
// 开始轮询检查登录状态
const intervalId = setInterval(() => {
checkLoginStatus(ticket, intervalId);
}, 3000); // 每3秒检查一次
} else {
console.error('获取二维码 ticket 失败:', data.info);
}
})
.catch(error => {
console.error('请求失败:', error);
});
function checkLoginStatus(ticket, intervalId) {
fetch(`http://192.168.1.106:8080/api/v1/login/check_login?ticket=${ticket}`)
.then(response => response.json())
.then(data => {
if (data.code === "0000") {
console.info("login success");
// 停止轮询
clearInterval(intervalId);
// 保存登录 token 到 cookie,设置有效期为30天
setCookie('loginToken', data.data, 30);
// 在这里可以重定向到登录后的页面
window.location.href = 'index.html'; // 假设登录成功后跳转到首页
} else {
console.info("login wait");
}
})
.catch(error => {
console.error('请求失败:', error);
});
}
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
const expires = "expires=" + date.toUTCString();
document.cookie = name + "=" + value + ";" + expires + ";path=/";
}
});
</script>
</body>
</html>
|
2203_75730178/s-pay-mall-mvc
|
docs/dev-ops/nginx/html/login.html
|
HTML
|
unknown
| 3,681
|
package cn.bugstack.common.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 通用的枚举值
* @create 2023-07-22 21:24
*/
public class Constants {
public final static String SPLIT = ",";
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum ResponseCode {
SUCCESS("0000", "调用成功"),
UN_ERROR("0001", "调用失败"),
ILLEGAL_PARAMETER("0002", "非法参数"),
NO_LOGIN("0003", "未登录"),
;
private String code;
private String info;
}
@Getter
@AllArgsConstructor
public enum OrderStatusEnum {
CREATE("CREATE", "创建完成 - 如果调单了,也会从创建记录重新发起创建支付单"),
PAY_WAIT("PAY_WAIT", "等待支付 - 订单创建完成后,创建支付单"),
PAY_SUCCESS("PAY_SUCCESS", "支付成功 - 接收到支付回调消息"),
DEAL_DONE("DEAL_DONE", "交易完成 - 商品发货完成"),
CLOSE("CLOSE", "超时关单 - 超市未支付"),
;
private final String code;
private final String desc;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/constants/Constants.java
|
Java
|
unknown
| 1,226
|
package cn.bugstack.common.exception;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 应用自定义异常
* @create 2024-02-25 12:17
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AppException extends RuntimeException {
private static final long serialVersionUID = 8653090271840061986L;
/**
* 异常码
*/
private String code;
/**
* 异常信息
*/
private String info;
public AppException(String code) {
this.code = code;
}
public AppException(String code, Throwable cause) {
this.code = code;
super.initCause(cause);
}
public AppException(String code, String message) {
this.code = code;
this.info = message;
}
public AppException(String code, String message, Throwable cause) {
this.code = code;
this.info = message;
super.initCause(cause);
}
@Override
public String toString() {
return "cn.bugstack.common.exception.AppException{" +
"code='" + code + '\'' +
", info='" + info + '\'' +
'}';
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/exception/AppException.java
|
Java
|
unknown
| 1,198
|
package cn.bugstack.common.response;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Response<T> implements Serializable {
private static final long serialVersionUID = 7000723935764546321L;
private String code;
private String info;
private T data;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/response/Response.java
|
Java
|
unknown
| 430
|
package cn.bugstack.common.weixin;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@XStreamAlias("xml")
public class MessageTextEntity {
@XStreamAlias("ToUserName")
private String toUserName;
@XStreamAlias("FromUserName")
private String fromUserName;
@XStreamAlias("CreateTime")
private String createTime;
@XStreamAlias("MsgType")
private String msgType;
@XStreamAlias("Event")
private String event;
@XStreamAlias("EventKey")
private String eventKey;
@XStreamAlias("MsgID")
private String msgId;
@XStreamAlias("Status")
private String status;
@XStreamAlias("Ticket")
private String ticket;
@XStreamAlias("Content")
private String content;
// Getters and Setters
public String getToUserName() {
return toUserName;
}
public void setToUserName(String toUserName) {
this.toUserName = toUserName;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getEvent() {
return event;
}
public void setEvent(String event) {
this.event = event;
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getEventKey() {
return eventKey;
}
public void setEventKey(String eventKey) {
this.eventKey = eventKey;
}
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/weixin/MessageTextEntity.java
|
Java
|
unknown
| 2,285
|
package cn.bugstack.common.weixin;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SignatureUtil {
/**
* 验证签名
*/
public static boolean check(String token, String signature, String timestamp, String nonce) {
String[] arr = new String[]{token, timestamp, nonce};
// 将token、timestamp、nonce三个参数进行字典序排序
sort(arr);
StringBuilder content = new StringBuilder();
for (String s : arr) {
content.append(s);
}
MessageDigest md;
String tmpStr = null;
try {
md = MessageDigest.getInstance("SHA-1");
// 将三个参数字符串拼接成一个字符串进行sha1加密
byte[] digest = md.digest(content.toString().getBytes());
tmpStr = byteToStr(digest);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
// 将sha1加密后的字符串可与signature对比,标识该请求来源于微信
return tmpStr != null && tmpStr.equals(signature.toUpperCase());
}
/**
* 将字节数组转换为十六进制字符串
*/
private static String byteToStr(byte[] byteArray) {
StringBuilder strDigest = new StringBuilder();
for (byte b : byteArray) {
strDigest.append(byteToHexStr(b));
}
return strDigest.toString();
}
/**
* 将字节转换为十六进制字符串
*/
private static String byteToHexStr(byte mByte) {
char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
char[] tempArr = new char[2];
tempArr[0] = Digit[(mByte >>> 4) & 0X0F];
tempArr[1] = Digit[mByte & 0X0F];
return new String(tempArr);
}
/**
* 进行字典排序
*/
private static void sort(String[] str) {
for (int i = 0; i < str.length - 1; i++) {
for (int j = i + 1; j < str.length; j++) {
if (str[j].compareTo(str[i]) < 0) {
String temp = str[i];
str[i] = str[j];
str[j] = temp;
}
}
}
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/weixin/SignatureUtil.java
|
Java
|
unknown
| 2,258
|
package cn.bugstack.common.weixin;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.core.util.QuickWriter;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
import com.thoughtworks.xstream.io.xml.XppDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.io.Writer;
import java.util.*;
public class XmlUtil {
/**
* 解析微信发来的请求(xml)
*/
@SuppressWarnings("unchecked")
public static Map<String, String> xmlToMap(HttpServletRequest request) throws Exception {
// 从request中取得输入流
try (InputStream inputStream = request.getInputStream()) {
// 将解析结果存储在HashMap中
Map<String, String> map = new HashMap<>();
// 读取输入流
SAXReader reader = new SAXReader();
// 得到xml文档
Document document = reader.read(inputStream);
// 得到xml根元素
Element root = document.getRootElement();
// 得到根元素的所有子节点
List<Element> elementList = root.elements();
// 遍历所有子节点
for (Element e : elementList)
map.put(e.getName(), e.getText());
// 释放资源
inputStream.close();
return map;
}
}
/**
* 将map转化成xml响应给微信服务器
*/
static String mapToXML(Map map) {
StringBuffer sb = new StringBuffer();
sb.append("<xml>");
mapToXML2(map, sb);
sb.append("</xml>");
try {
return sb.toString();
} catch (Exception e) {
return null;
}
}
private static void mapToXML2(Map map, StringBuffer sb) {
Set set = map.keySet();
for (Object o : set) {
String key = (String) o;
Object value = map.get(key);
if (null == value)
value = "";
if (value.getClass().getName().equals("java.util.ArrayList")) {
ArrayList list = (ArrayList) map.get(key);
sb.append("<").append(key).append(">");
for (Object o1 : list) {
HashMap hm = (HashMap) o1;
mapToXML2(hm, sb);
}
sb.append("</").append(key).append(">");
} else {
if (value instanceof HashMap) {
sb.append("<").append(key).append(">");
mapToXML2((HashMap) value, sb);
sb.append("</").append(key).append(">");
} else {
sb.append("<").append(key).append("><![CDATA[").append(value).append("]]></").append(key).append(">");
}
}
}
}
public static XStream getMyXStream() {
return new XStream(new XppDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer out) {
return new PrettyPrintWriter(out) {
// 对所有xml节点都增加CDATA标记
boolean cdata = true;
@Override
public void startNode(String name, Class clazz) {
super.startNode(name, clazz);
}
@Override
protected void writeText(QuickWriter writer, String text) {
if (cdata && !StringUtils.isNumeric(text)) {
writer.write("<![CDATA[");
writer.write(text);
writer.write("]]>");
} else {
writer.write(text);
}
}
};
}
});
}
/**
* bean转成微信的xml消息格式
*/
public static String beanToXml(Object object) {
XStream xStream = getMyXStream();
xStream.alias("xml", object.getClass());
xStream.processAnnotations(object.getClass());
String xml = xStream.toXML(object);
if (!StringUtils.isEmpty(xml)) {
return xml;
} else {
return null;
}
}
/**
* xml转成bean泛型方法
*/
public static <T> T xmlToBean(String resultXml, Class clazz) {
// XStream对象设置默认安全防护,同时设置允许的类
XStream stream = new XStream(new DomDriver());
stream.addPermission(AnyTypePermission.ANY);
XStream.setupDefaultSecurity(stream);
stream.allowTypes(new Class[]{clazz});
stream.processAnnotations(new Class[]{clazz});
stream.setMode(XStream.NO_REFERENCES);
stream.alias("xml", clazz);
return (T) stream.fromXML(resultXml);
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/weixin/XmlUtil.java
|
Java
|
unknown
| 5,164
|
/**
* @description
* @author Fuzhengwei bugstack.cn @小傅哥
* @create 2024-09-27 17:01
*/
package cn.bugstack.common.weixin;
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-common/src/main/java/cn/bugstack/common/weixin/package-info.java
|
Java
|
unknown
| 131
|
package cn.bugstack.dao;
import cn.bugstack.domain.po.PayOrder;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface IOrderDao {
void insert(PayOrder payOrder);
PayOrder queryUnPayOrder(PayOrder payOrder);
void updateOrderPayInfo(PayOrder payOrder);
void changeOrderPaySuccess(PayOrder order);
List<String> queryNoPayNotifyOrder();
List<String> queryTimeoutCloseOrderList();
boolean changeOrderClose(String orderId);
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-dao/src/main/java/cn/bugstack/dao/IOrderDao.java
|
Java
|
unknown
| 498
|
/**
* @description
* @author Fuzhengwei bugstack.cn @小傅哥
* @create 2024-09-27 17:00
*/
package cn.bugstack.dao;
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-dao/src/main/java/cn/bugstack/dao/package-info.java
|
Java
|
unknown
| 121
|
/**
* @description
* @author Fuzhengwei bugstack.cn @小傅哥
* @create 2024-09-27 17:00
*/
package cn.bugstack.domain;
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/package-info.java
|
Java
|
unknown
| 124
|
package cn.bugstack.domain.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PayOrder {
private Long id;
private String userId;
private String productId;
private String productName;
private String orderId;
private Date orderTime;
private BigDecimal totalAmount;
private String status;
private String payUrl;
private Date payTime;
private Date createTime;
private Date updateTime;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/po/PayOrder.java
|
Java
|
unknown
| 618
|
package cn.bugstack.domain.req;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ShopCartReq {
private String userId;
private String productId;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/req/ShopCartReq.java
|
Java
|
unknown
| 287
|
package cn.bugstack.domain.req;
import lombok.*;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 获取微信登录二维码请求对象
* @create 2024-09-28 13:36
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WeixinQrCodeReq {
private int expire_seconds;
private String action_name;
private ActionInfo action_info;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public static class ActionInfo {
Scene scene;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public static class Scene {
int scene_id;
String scene_str;
}
}
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ActionNameTypeVO {
QR_SCENE("QR_SCENE", "临时的整型参数值"),
QR_STR_SCENE("QR_STR_SCENE", "临时的字符串参数值"),
QR_LIMIT_SCENE("QR_LIMIT_SCENE", "永久的整型参数值"),
QR_LIMIT_STR_SCENE("QR_LIMIT_STR_SCENE", "永久的字符串参数值");
private String code;
private String info;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/req/WeixinQrCodeReq.java
|
Java
|
unknown
| 1,139
|
package cn.bugstack.domain.res;
import cn.bugstack.common.constants.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PayOrderRes {
private String userId;
private String orderId;
private String payUrl;
private Constants.OrderStatusEnum orderStatusEnum;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/res/PayOrderRes.java
|
Java
|
unknown
| 413
|
package cn.bugstack.domain.res;
import lombok.Data;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 获取微信登录二维码响应对象
* @create 2024-09-28 13:36
*/
@Data
public class WeixinQrCodeRes {
private String ticket;
private Long expire_seconds;
private String url;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/res/WeixinQrCodeRes.java
|
Java
|
unknown
| 316
|
package cn.bugstack.domain.res;
import lombok.Data;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 获取 Access token DTO 对象
* @create 2024-09-28 13:32
*/
@Data
public class WeixinTokenRes {
private String access_token;
private int expires_in;
private String errcode;
private String errmsg;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/res/WeixinTokenRes.java
|
Java
|
unknown
| 338
|
package cn.bugstack.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ProductVO {
/** 商品ID */
private String productId;
/** 商品名称 */
private String productName;
/** 商品描述 */
private String productDesc;
/** 商品价格 */
private BigDecimal price;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/vo/ProductVO.java
|
Java
|
unknown
| 334
|
package cn.bugstack.domain.vo;
import java.util.HashMap;
import java.util.Map;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 微信模板消息
* @create 2024-09-28 13:38
*/
public class WeixinTemplateMessageVO {
private String touser = "or0Ab6ivwmypESVp_bYuk92T6SvU";
private String template_id = "GLlAM-Q4jdgsktdNd35hnEbHVam2mwsW2YWuxDhpQkU";
private String url = "https://weixin.qq.com";
private Map<String, Map<String, String>> data = new HashMap<>();
public WeixinTemplateMessageVO(String touser, String template_id) {
this.touser = touser;
this.template_id = template_id;
}
public void put(TemplateKey key, String value) {
data.put(key.getCode(), new HashMap<String, String>() {
private static final long serialVersionUID = 7092338402387318563L;
{
put("value", value);
}
});
}
public static void put(Map<String, Map<String, String>> data, TemplateKey key, String value) {
data.put(key.getCode(), new HashMap<String, String>() {
private static final long serialVersionUID = 7092338402387318563L;
{
put("value", value);
}
});
}
public enum TemplateKey {
USER("user","用户ID")
;
private String code;
private String desc;
TemplateKey(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getTemplate_id() {
return template_id;
}
public void setTemplate_id(String template_id) {
this.template_id = template_id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Map<String, Map<String, String>> getData() {
return data;
}
public void setData(Map<String, Map<String, String>> data) {
this.data = data;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-domain/src/main/java/cn/bugstack/domain/vo/WeixinTemplateMessageVO.java
|
Java
|
unknown
| 2,443
|
package cn.bugstack.service;
import java.io.IOException;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 微信服务
* @create 2024-09-28 13:44
*/
public interface ILoginService {
String createQrCodeTicket() throws Exception;
String checkLogin(String ticket);
void saveLoginState(String ticket, String openid) throws IOException;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/ILoginService.java
|
Java
|
unknown
| 370
|
package cn.bugstack.service;
import cn.bugstack.domain.req.ShopCartReq;
import cn.bugstack.domain.res.PayOrderRes;
import java.util.List;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 订单服务接口
* @create 2024-09-29 09:43
*/
public interface IOrderService {
PayOrderRes createOrder(ShopCartReq shopCartReq) throws Exception;
void changeOrderPaySuccess(String orderId);
List<String> queryNoPayNotifyOrder();
List<String> queryTimeoutCloseOrderList();
boolean changeOrderClose(String orderId);
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/IOrderService.java
|
Java
|
unknown
| 552
|
package cn.bugstack.service.impl;
import cn.bugstack.common.constants.Constants;
import cn.bugstack.dao.IOrderDao;
import cn.bugstack.domain.po.PayOrder;
import cn.bugstack.domain.req.ShopCartReq;
import cn.bugstack.domain.res.PayOrderRes;
import cn.bugstack.domain.vo.ProductVO;
import cn.bugstack.service.IOrderService;
import cn.bugstack.service.rpc.ProductRPC;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.google.common.eventbus.EventBus;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 订单服务
* @create 2024-09-29 09:47
*/
@Slf4j
@Service
public class OrderServiceImpl implements IOrderService {
@Value("${alipay.notify_url}")
private String notifyUrl;
@Value("${alipay.return_url}")
private String returnUrl;
@Resource
private IOrderDao orderDao;
@Resource
private ProductRPC productRPC;
@Resource
private AlipayClient alipayClient;
@Resource
private EventBus eventBus;
@Override
public PayOrderRes createOrder(ShopCartReq shopCartReq) throws Exception {
// 1. 查询当前用户是否存在未支付订单或掉单订单
PayOrder payOrderReq = new PayOrder();
payOrderReq.setUserId(shopCartReq.getUserId());
payOrderReq.setProductId(shopCartReq.getProductId());
PayOrder unpaidOrder = orderDao.queryUnPayOrder(payOrderReq);
if (null != unpaidOrder && Constants.OrderStatusEnum.PAY_WAIT.getCode().equals(unpaidOrder.getStatus())) {
log.info("创建订单-存在,已存在未支付订单。userId:{} productId:{} orderId:{}", shopCartReq.getUserId(), shopCartReq.getProductId(), unpaidOrder.getOrderId());
return PayOrderRes.builder()
.orderId(unpaidOrder.getOrderId())
.payUrl(unpaidOrder.getPayUrl())
.build();
} else if (null != unpaidOrder && Constants.OrderStatusEnum.CREATE.getCode().equals(unpaidOrder.getStatus())) {
log.info("创建订单-存在,存在未创建支付单订单,创建支付单开始 userId:{} productId:{} orderId:{}", shopCartReq.getUserId(), shopCartReq.getProductId(), unpaidOrder.getOrderId());
PayOrder payOrder = doPrepayOrder(unpaidOrder.getProductId(), unpaidOrder.getProductName(), unpaidOrder.getOrderId(), unpaidOrder.getTotalAmount());
return PayOrderRes.builder()
.orderId(payOrder.getOrderId())
.payUrl(payOrder.getPayUrl())
.build();
}
// 2. 查询商品 & 创建订单
ProductVO productVO = productRPC.queryProductByProductId(shopCartReq.getProductId());
String orderId = RandomStringUtils.randomNumeric(16);
orderDao.insert(PayOrder.builder()
.userId(shopCartReq.getUserId())
.productId(shopCartReq.getProductId())
.productName(productVO.getProductName())
.orderId(orderId)
.totalAmount(productVO.getPrice())
.orderTime(new Date())
.status(Constants.OrderStatusEnum.CREATE.getCode())
.build());
// 3. 创建支付单
PayOrder payOrder = doPrepayOrder(productVO.getProductId(), productVO.getProductName(), orderId, productVO.getPrice());
return PayOrderRes.builder()
.orderId(orderId)
.payUrl(payOrder.getPayUrl())
.build();
}
@Override
public void changeOrderPaySuccess(String orderId) {
PayOrder payOrderReq = new PayOrder();
payOrderReq.setOrderId(orderId);
payOrderReq.setStatus(Constants.OrderStatusEnum.PAY_SUCCESS.getCode());
orderDao.changeOrderPaySuccess(payOrderReq);
eventBus.post(JSON.toJSONString(payOrderReq));
}
@Override
public List<String> queryNoPayNotifyOrder() {
return orderDao.queryNoPayNotifyOrder();
}
@Override
public List<String> queryTimeoutCloseOrderList() {
return orderDao.queryTimeoutCloseOrderList();
}
@Override
public boolean changeOrderClose(String orderId) {
return orderDao.changeOrderClose(orderId);
}
private PayOrder doPrepayOrder(String productId, String productName, String orderId, BigDecimal totalAmount) throws AlipayApiException {
AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
request.setNotifyUrl(notifyUrl);
request.setReturnUrl(returnUrl);
JSONObject bizContent = new JSONObject();
bizContent.put("out_trade_no", orderId);
bizContent.put("total_amount", totalAmount.toString());
bizContent.put("subject", productName);
bizContent.put("product_code", "FAST_INSTANT_TRADE_PAY");
request.setBizContent(bizContent.toString());
String form = alipayClient.pageExecute(request).getBody();
PayOrder payOrder = new PayOrder();
payOrder.setOrderId(orderId);
payOrder.setPayUrl(form);
payOrder.setStatus(Constants.OrderStatusEnum.PAY_WAIT.getCode());
orderDao.updateOrderPayInfo(payOrder);
return payOrder;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/impl/OrderServiceImpl.java
|
Java
|
unknown
| 5,632
|
package cn.bugstack.service.impl;
import cn.bugstack.domain.vo.WeixinTemplateMessageVO;
import cn.bugstack.domain.req.WeixinQrCodeReq;
import cn.bugstack.domain.res.WeixinQrCodeRes;
import cn.bugstack.domain.res.WeixinTokenRes;
import cn.bugstack.service.ILoginService;
import cn.bugstack.service.weixin.IWeixinApiService;
import com.google.common.cache.Cache;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import retrofit2.Call;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 微信服务
* @create 2024-09-28 13:46
*/
@Service
public class WeixinLoginServiceImpl implements ILoginService {
@Value("${weixin.config.app-id}")
private String appid;
@Value("${weixin.config.app-secret}")
private String appSecret;
@Value("${weixin.config.template_id}")
private String template_id;
@Resource
private Cache<String, String> weixinAccessToken;
@Resource
private IWeixinApiService weixinApiService;
@Resource
private Cache<String, String> openidToken;
@Override
public String createQrCodeTicket() throws Exception {
// 1. 获取 accessToken
String accessToken = weixinAccessToken.getIfPresent(appid);
if (null == accessToken) {
Call<WeixinTokenRes> call = weixinApiService.getToken("client_credential", appid, appSecret);
WeixinTokenRes weixinTokenRes = call.execute().body();
assert weixinTokenRes != null;
accessToken = weixinTokenRes.getAccess_token();
weixinAccessToken.put(appid, accessToken);
}
// 2. 生成 ticket
WeixinQrCodeReq weixinQrCodeReq = WeixinQrCodeReq.builder()
.expire_seconds(2592000)
.action_name(WeixinQrCodeReq.ActionNameTypeVO.QR_SCENE.getCode())
.action_info(WeixinQrCodeReq.ActionInfo.builder()
.scene(WeixinQrCodeReq.ActionInfo.Scene.builder()
.scene_id(100601)
.build())
.build())
.build();
Call<WeixinQrCodeRes> call = weixinApiService.createQrCode(accessToken, weixinQrCodeReq);
WeixinQrCodeRes weixinQrCodeRes = call.execute().body();
assert null != weixinQrCodeRes;
return weixinQrCodeRes.getTicket();
}
@Override
public String checkLogin(String ticket) {
return openidToken.getIfPresent(ticket);
}
@Override
public void saveLoginState(String ticket, String openid) throws IOException {
openidToken.put(ticket, openid);
// 1. 获取 accessToken 【实际业务场景,按需处理下异常】
String accessToken = weixinAccessToken.getIfPresent(appid);
if (null == accessToken){
Call<WeixinTokenRes> call = weixinApiService.getToken("client_credential", appid, appSecret);
WeixinTokenRes weixinTokenRes = call.execute().body();
assert weixinTokenRes != null;
accessToken = weixinTokenRes.getAccess_token();
weixinAccessToken.put(appid, accessToken);
}
// 2. 发送模板消息
Map<String, Map<String, String>> data = new HashMap<>();
WeixinTemplateMessageVO.put(data, WeixinTemplateMessageVO.TemplateKey.USER, openid);
WeixinTemplateMessageVO templateMessageDTO = new WeixinTemplateMessageVO(openid, template_id);
templateMessageDTO.setUrl("https://gaga.plus");
templateMessageDTO.setData(data);
Call<Void> call = weixinApiService.sendMessage(accessToken, templateMessageDTO);
call.execute();
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/impl/WeixinLoginServiceImpl.java
|
Java
|
unknown
| 3,802
|
/**
* @description
* @author Fuzhengwei bugstack.cn @小傅哥
* @create 2024-09-27 17:00
*/
package cn.bugstack.service;
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/package-info.java
|
Java
|
unknown
| 125
|
package cn.bugstack.service.rpc;
import cn.bugstack.domain.vo.ProductVO;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@Service
public class ProductRPC {
public ProductVO queryProductByProductId(String productId){
ProductVO productVO = new ProductVO();
productVO.setProductId(productId);
productVO.setProductName("测试商品");
productVO.setProductDesc("这是一个测试商品");
productVO.setPrice(new BigDecimal("1.68"));
return productVO;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/rpc/ProductRPC.java
|
Java
|
unknown
| 541
|
package cn.bugstack.service.weixin;
import cn.bugstack.domain.vo.WeixinTemplateMessageVO;
import cn.bugstack.domain.req.WeixinQrCodeReq;
import cn.bugstack.domain.res.WeixinQrCodeRes;
import cn.bugstack.domain.res.WeixinTokenRes;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 微信API服务 retrofit2
* @create 2024-09-28 13:30
*/
public interface IWeixinApiService {
/**
* 获取 Access token
* 文档:<a href="https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html">Get_access_token</a>
*
* @param grantType 获取access_token填写client_credential
* @param appId 第三方用户唯一凭证
* @param appSecret 第三方用户唯一凭证密钥,即appsecret
* @return 响应结果
*/
@GET("cgi-bin/token")
Call<WeixinTokenRes> getToken(@Query("grant_type") String grantType,
@Query("appid") String appId,
@Query("secret") String appSecret);
/**
* 获取凭据 ticket
* 文档:<a href="https://developers.weixin.qq.com/doc/offiaccount/Account_Management/Generating_a_Parametric_QR_Code.html">Generating_a_Parametric_QR_Code</a>
* <a href="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET">前端根据凭证展示二维码</a>
*
* @param accessToken getToken 获取的 token 信息
* @param weixinQrCodeReq 入参对象
* @return 应答结果
*/
@POST("cgi-bin/qrcode/create")
Call<WeixinQrCodeRes> createQrCode(@Query("access_token") String accessToken, @Body WeixinQrCodeReq weixinQrCodeReq);
/**
* 发送微信公众号模板消息
* 文档:https://mp.weixin.qq.com/debug/cgi-bin/readtmpl?t=tmplmsg/faq_tmpl
*
* @param accessToken getToken 获取的 token 信息
* @param weixinTemplateMessageVO 入参对象
* @return 应答结果
*/
@POST("cgi-bin/message/template/send")
Call<Void> sendMessage(@Query("access_token") String accessToken, @Body WeixinTemplateMessageVO weixinTemplateMessageVO);
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-service/src/main/java/cn/bugstack/service/weixin/IWeixinApiService.java
|
Java
|
unknown
| 2,264
|
# 基础镜像
FROM openjdk:8-jre-slim
# 作者
MAINTAINER xiaofuge
# 配置
ENV PARAMS=""
# 时区
ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加应用
ADD target/s-pay-mall-mvc-app.jar /s-pay-mall-mvc-app.jar
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /s-pay-mall-mvc-app.jar $PARAMS"]
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/Dockerfile
|
Dockerfile
|
unknown
| 345
|
# 普通镜像构建,随系统版本构建 amd/arm
docker build -t fuzhengwei/s-pay-mall-mvc-app:1.0 -f ./Dockerfile .
# 兼容 amd、arm 构建镜像
# docker buildx build --load --platform liunx/amd64,linux/arm64 -t xiaofuge/xfg-frame-archetype-app:1.0 -f ./Dockerfile . --push
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/build.sh
|
Shell
|
unknown
| 282
|
package cn.bugstack;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 启动入口
* @create 2024-09-27 16:56
*/
@SpringBootApplication
@Configurable
@EnableScheduling
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class);
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/Application.java
|
Java
|
unknown
| 573
|
package cn.bugstack.config;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(AliPayConfigProperties.class)
public class AliPayConfig {
@Bean("alipayClient")
public AlipayClient alipayClient(AliPayConfigProperties properties) {
return new DefaultAlipayClient(properties.getGatewayUrl(),
properties.getApp_id(),
properties.getMerchant_private_key(),
properties.getFormat(),
properties.getCharset(),
properties.getAlipay_public_key(),
properties.getSign_type());
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/config/AliPayConfig.java
|
Java
|
unknown
| 855
|
package cn.bugstack.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Data
@ConfigurationProperties(prefix = "alipay", ignoreInvalidFields = true)
public class AliPayConfigProperties {
// 「沙箱环境」应用ID - 您的APPID,收款账号既是你的APPID对应支付宝账号。获取地址;https://open.alipay.com/develop/sandbox/app
private String app_id;
// 「沙箱环境」商户私钥,你的PKCS8格式RSA2私钥
private String merchant_private_key;
// 「沙箱环境」支付宝公钥
private String alipay_public_key;
// 「沙箱环境」服务器异步通知页面路径
private String notify_url;
// 「沙箱环境」页面跳转同步通知页面路径 需http://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
private String return_url;
// 「沙箱环境」
private String gatewayUrl;
// 签名方式
private String sign_type = "RSA2";
// 字符编码格式
private String charset = "utf-8";
// 传输格式
private String format = "json";
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/config/AliPayConfigProperties.java
|
Java
|
unknown
| 1,147
|
package cn.bugstack.config;
import cn.bugstack.listener.OrderPaySuccessListener;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.eventbus.EventBus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
@Configuration
public class GuavaConfig {
@Bean(name = "weixinAccessToken")
public Cache<String, String> weixinAccessToken() {
return CacheBuilder.newBuilder()
.expireAfterWrite(2, TimeUnit.HOURS)
.build();
}
@Bean(name = "openidToken")
public Cache<String, String> openidToken() {
return CacheBuilder.newBuilder()
.expireAfterWrite(1, TimeUnit.HOURS)
.build();
}
@Bean
public EventBus eventBusListener(OrderPaySuccessListener listener){
EventBus eventBus = new EventBus();
eventBus.register(listener);
return eventBus;
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/config/GuavaConfig.java
|
Java
|
unknown
| 1,030
|
package cn.bugstack.config;
import cn.bugstack.service.weixin.IWeixinApiService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
@Slf4j
@Configuration
public class Retrofit2Config {
private static final String BASE_URL = "https://api.weixin.qq.com/";
@Bean
public Retrofit retrofit() {
return new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(JacksonConverterFactory.create()).build();
}
@Bean
public IWeixinApiService weixinApiService(Retrofit retrofit) {
return retrofit.create(IWeixinApiService.class);
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/config/Retrofit2Config.java
|
Java
|
unknown
| 791
|
package cn.bugstack.controller;
import cn.bugstack.common.constants.Constants;
import cn.bugstack.common.response.Response;
import cn.bugstack.controller.dto.CreatePayRequestDTO;
import cn.bugstack.domain.req.ShopCartReq;
import cn.bugstack.domain.res.PayOrderRes;
import cn.bugstack.service.IOrderService;
import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@RestController()
@CrossOrigin("*")
@RequestMapping("/api/v1/alipay/")
public class AliPayController {
@Value("${alipay.alipay_public_key}")
private String alipayPublicKey;
@Resource
private IOrderService orderService;
/**
* http://localhost:8080/api/v1/alipay/create_pay_order
*
* {
* "userId": "10001",
* "productId": "100001"
* }
*/
@RequestMapping(value = "create_pay_order", method = RequestMethod.POST)
public Response<String> createPayOrder(@RequestBody CreatePayRequestDTO createPayRequestDTO){
try {
log.info("商品下单,根据商品ID创建支付单开始 userId:{} productId:{}", createPayRequestDTO.getUserId(), createPayRequestDTO.getUserId());
String userId = createPayRequestDTO.getUserId();
String productId = createPayRequestDTO.getProductId();
// 下单
PayOrderRes payOrderRes = orderService.createOrder(ShopCartReq.builder()
.userId(userId)
.productId(productId)
.build());
log.info("商品下单,根据商品ID创建支付单完成 userId:{} productId:{} orderId:{}", userId, productId, payOrderRes.getOrderId());
return Response.<String>builder()
.code(Constants.ResponseCode.SUCCESS.getCode())
.info(Constants.ResponseCode.SUCCESS.getInfo())
.data(payOrderRes.getPayUrl())
.build();
} catch (Exception e) {
log.error("商品下单,根据商品ID创建支付单失败 userId:{} productId:{}", createPayRequestDTO.getUserId(), createPayRequestDTO.getUserId(), e);
return Response.<String>builder()
.code(Constants.ResponseCode.UN_ERROR.getCode())
.info(Constants.ResponseCode.UN_ERROR.getInfo())
.build();
}
}
/**
* http://xfg-studio.natapp1.cc/api/v1/alipay/alipay_notify_url
*/
@RequestMapping(value = "alipay_notify_url", method = RequestMethod.POST)
public String payNotify(HttpServletRequest request) throws AlipayApiException {
log.info("支付回调,消息接收 {}", request.getParameter("trade_status"));
if (!request.getParameter("trade_status").equals("TRADE_SUCCESS")) {
return "false";
}
Map<String, String> params = new HashMap<>();
Map<String, String[]> requestParams = request.getParameterMap();
for (String name : requestParams.keySet()) {
params.put(name, request.getParameter(name));
}
String tradeNo = params.get("out_trade_no");
String gmtPayment = params.get("gmt_payment");
String alipayTradeNo = params.get("trade_no");
String sign = params.get("sign");
String content = AlipaySignature.getSignCheckContentV1(params);
boolean checkSignature = AlipaySignature.rsa256CheckContent(content, sign, alipayPublicKey, "UTF-8"); // 验证签名
// 支付宝验签
if (!checkSignature) {
return "false";
}
// 验签通过
log.info("支付回调,交易名称: {}", params.get("subject"));
log.info("支付回调,交易状态: {}", params.get("trade_status"));
log.info("支付回调,支付宝交易凭证号: {}", params.get("trade_no"));
log.info("支付回调,商户订单号: {}", params.get("out_trade_no"));
log.info("支付回调,交易金额: {}", params.get("total_amount"));
log.info("支付回调,买家在支付宝唯一id: {}", params.get("buyer_id"));
log.info("支付回调,买家付款时间: {}", params.get("gmt_payment"));
log.info("支付回调,买家付款金额: {}", params.get("buyer_pay_amount"));
log.info("支付回调,支付回调,更新订单 {}", tradeNo);
// 可以增加 code 10000 与 tradeStatus TRADE_SUCCESS 判断
orderService.changeOrderPaySuccess(tradeNo);
return "success";
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/controller/AliPayController.java
|
Java
|
unknown
| 4,779
|
package cn.bugstack.controller;
import cn.bugstack.common.constants.Constants;
import cn.bugstack.common.response.Response;
import cn.bugstack.service.ILoginService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 登录服务
* @create 2024-09-28 13:58
*/
@Slf4j
@RestController()
@CrossOrigin("*")
@RequestMapping("/api/v1/login/")
public class LoginController {
@Resource
private ILoginService loginService;
/**
* http://xfg-studio.natapp1.cc/api/v1/login/weixin_qrcode_ticket
* @return
*/
@RequestMapping(value = "weixin_qrcode_ticket", method = RequestMethod.GET)
public Response<String> weixinQrCodeTicket() {
try {
String qrCodeTicket = loginService.createQrCodeTicket();
log.info("生成微信扫码登录 ticket:{}", qrCodeTicket);
return Response.<String>builder()
.code(Constants.ResponseCode.SUCCESS.getCode())
.info(Constants.ResponseCode.SUCCESS.getInfo())
.data(qrCodeTicket)
.build();
} catch (Exception e) {
log.error("生成微信扫码登录 ticket 失败", e);
return Response.<String>builder()
.code(Constants.ResponseCode.UN_ERROR.getCode())
.info(Constants.ResponseCode.UN_ERROR.getInfo())
.build();
}
}
/**
* http://xfg-studio.natapp1.cc/api/v1/login/check_login
*/
@RequestMapping(value = "check_login", method = RequestMethod.GET)
public Response<String> checkLogin(@RequestParam String ticket) {
try {
String openidToken = loginService.checkLogin(ticket);
log.info("扫码检测登录结果 ticket:{} openidToken:{}", ticket, openidToken);
if (StringUtils.isNotBlank(openidToken)) {
return Response.<String>builder()
.code(Constants.ResponseCode.SUCCESS.getCode())
.info(Constants.ResponseCode.SUCCESS.getInfo())
.data(openidToken)
.build();
} else {
return Response.<String>builder()
.code(Constants.ResponseCode.NO_LOGIN.getCode())
.info(Constants.ResponseCode.NO_LOGIN.getInfo())
.build();
}
} catch (Exception e) {
log.error("扫码检测登录结果失败 ticket:{}", ticket, e);
return Response.<String>builder()
.code(Constants.ResponseCode.UN_ERROR.getCode())
.info(Constants.ResponseCode.UN_ERROR.getInfo())
.build();
}
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/controller/LoginController.java
|
Java
|
unknown
| 2,906
|
package cn.bugstack.controller;
import cn.bugstack.common.weixin.MessageTextEntity;
import cn.bugstack.common.weixin.SignatureUtil;
import cn.bugstack.common.weixin.XmlUtil;
import cn.bugstack.service.ILoginService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 微信服务对接,对接地址:<a href="http://xfg-studio.natapp1.cc/api/v1/weixin/portal/receive">/api/v1/weixin/portal/receive</a>
* <p>
* http://xfg-studio.natapp1.cc/api/v1/weixin/portal/receive/
*/
@Slf4j
@RestController()
@CrossOrigin("*")
@RequestMapping("/api/v1/weixin/portal/")
public class WeixinPortalController {
@Value("${weixin.config.originalid}")
private String originalid;
@Value("${weixin.config.token}")
private String token;
@Resource
private ILoginService loginService;
@GetMapping(value = "receive", produces = "text/plain;charset=utf-8")
public String validate(@RequestParam(value = "signature", required = false) String signature,
@RequestParam(value = "timestamp", required = false) String timestamp,
@RequestParam(value = "nonce", required = false) String nonce,
@RequestParam(value = "echostr", required = false) String echostr) {
try {
log.info("微信公众号验签信息开始 [{}, {}, {}, {}]", signature, timestamp, nonce, echostr);
if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
throw new IllegalArgumentException("请求参数非法,请核实!");
}
boolean check = SignatureUtil.check(token, signature, timestamp, nonce);
log.info("微信公众号验签信息完成 check:{}", check);
if (!check) {
return null;
}
return echostr;
} catch (Exception e) {
log.error("微信公众号验签信息失败 [{}, {}, {}, {}]", signature, timestamp, nonce, echostr, e);
return null;
}
}
@PostMapping(value = "receive", produces = "application/xml; charset=UTF-8")
public String post(@RequestBody String requestBody,
@RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce,
@RequestParam("openid") String openid,
@RequestParam(name = "encrypt_type", required = false) String encType,
@RequestParam(name = "msg_signature", required = false) String msgSignature) {
try {
log.info("接收微信公众号信息请求{}开始 {}", openid, requestBody);
// 消息转换
MessageTextEntity message = XmlUtil.xmlToBean(requestBody, MessageTextEntity.class);
if ("event".equals(message.getMsgType()) && "SCAN".equals(message.getEvent())) {
loginService.saveLoginState(message.getTicket(), openid);
return buildMessageTextEntity(openid, "登录成功");
}
return buildMessageTextEntity(openid, "你好," + message.getContent());
} catch (Exception e) {
log.error("接收微信公众号信息请求{}失败 {}", openid, requestBody, e);
return "";
}
}
private String buildMessageTextEntity(String openid, String content) {
MessageTextEntity res = new MessageTextEntity();
// 公众号分配的ID
res.setFromUserName(originalid);
res.setToUserName(openid);
res.setCreateTime(String.valueOf(System.currentTimeMillis() / 1000L));
res.setMsgType("text");
res.setContent(content);
return XmlUtil.beanToXml(res);
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/controller/WeixinPortalController.java
|
Java
|
unknown
| 3,952
|
package cn.bugstack.controller;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description
* @create 2024-09-27 16:59
*/
public class XxxController {
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/controller/XxxController.java
|
Java
|
unknown
| 161
|
package cn.bugstack.controller.dto;
import lombok.Data;
@Data
public class CreatePayRequestDTO {
// 用户ID 【实际产生中会通过登录模块获取,不需要透彻】
private String userId;
// 产品编号
private String productId;
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/controller/dto/CreatePayRequestDTO.java
|
Java
|
unknown
| 263
|
package cn.bugstack.job;
import cn.bugstack.service.IOrderService;
import com.alipay.api.AlipayClient;
import com.alipay.api.domain.AlipayTradeQueryModel;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.response.AlipayTradeQueryResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 检测未接收到或未正确处理的支付回调通知
* @create 2024-09-30 09:59
*/
@Slf4j
@Component()
public class NoPayNotifyOrderJob {
@Resource
private IOrderService orderService;
@Resource
private AlipayClient alipayClient;
@Scheduled(cron = "0/3 * * * * ?")
public void exec() {
try {
log.info("任务;检测未接收到或未正确处理的支付回调通知");
List<String> orderIds = orderService.queryNoPayNotifyOrder();
if (null == orderIds || orderIds.isEmpty()) return;
for (String orderId : orderIds) {
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
AlipayTradeQueryModel bizModel = new AlipayTradeQueryModel();
bizModel.setOutTradeNo(orderId);
request.setBizModel(bizModel);
AlipayTradeQueryResponse alipayTradeQueryResponse = alipayClient.execute(request);
String code = alipayTradeQueryResponse.getCode();
// 判断状态码
if ("10000".equals(code)) {
orderService.changeOrderPaySuccess(orderId);
}
}
} catch (Exception e) {
log.error("检测未接收到或未正确处理的支付回调通知失败", e);
}
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/job/NoPayNotifyOrderJob.java
|
Java
|
unknown
| 1,885
|
package cn.bugstack.job;
import cn.bugstack.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 超时关单
* @create 2024-09-30 09:59
*/
@Slf4j
@Component()
public class TimeoutCloseOrderJob {
@Resource
private IOrderService orderService;
@Scheduled(cron = "0 0/10 * * * ?")
public void exec() {
try {
log.info("任务;超时30分钟订单关闭");
List<String> orderIds = orderService.queryTimeoutCloseOrderList();
if (null == orderIds || orderIds.isEmpty()) {
log.info("定时任务,超时30分钟订单关闭,暂无超时未支付订单 orderIds is null");
return;
}
for (String orderId : orderIds) {
boolean status = orderService.changeOrderClose(orderId);
log.info("定时任务,超时30分钟订单关闭 orderId: {} status:{}", orderId, status);
}
} catch (Exception e) {
log.error("定时任务,超时15分钟订单关闭失败", e);
}
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/job/TimeoutCloseOrderJob.java
|
Java
|
unknown
| 1,298
|
package cn.bugstack.listener;
import com.google.common.eventbus.Subscribe;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author Fuzhengwei bugstack.cn @小傅哥
* @description 支付成功回调消息
* @create 2024-09-30 09:52
*/
@Slf4j
@Component
public class OrderPaySuccessListener {
@Subscribe
public void handleEvent(String paySuccessMessage) {
log.info("收到支付成功消息,可以做接下来的事情,如;发货、充值、开户员、返利 {}", paySuccessMessage);
}
}
|
2203_75730178/s-pay-mall-mvc
|
s-pay-mall-web/src/main/java/cn/bugstack/listener/OrderPaySuccessListener.java
|
Java
|
unknown
| 563
|
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_OpenHarmony_SA_2023_0101
{
meta:
date = "2023-02-13"
openharmony_sa = "OpenHarmony-SA-2023-0101"
cve = "CVE-2023-0035"
file = "libsoftbus_client.z.so"
strings:
$fix = "write InterfaceToken failed!"
condition:
$fix and console.log("OpenHarmony-SA-2023-0101 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/01/OpenHarmony-SA-2023-0101/TestCaseRule-OpenHarmony-SA-2023-0101.yara
|
YARA
|
unknown
| 1,012
|
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_OpenHarmony_SA_2023_0102
{
meta:
date = "2023-02-17"
openharmony_sa = "OpenHarmony-SA-2023-0102"
cve = "CVE-2023-0036"
file = "libinputmethod_service.z.so"
strings:
/*
.text:00045E0E LDRB.W R3, [SP,#0x68+var_34]
.text:00045E12 ADD R0, PC ;
.text:00045E14 LDR R2, [SP,#0x68+var_30]
*/
$fix = {9D F8 34 30 78 44 0E 9A}
condition:
$fix and console.log("OpenHarmony-SA-2023-0102 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/01/OpenHarmony-SA-2023-0102/TestCaseRule-OpenHarmony-SA-2023-0102.yara
|
YARA
|
unknown
| 1,207
|
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_OpenHarmony_SA_2023_0201
{
meta:
date = "2023-02"
openharmony_sa = "OpenHarmony-SA-2023-0201"
cve = "CVE-2023-0083"
severity = "low"
file = "libace_engine_declarative_ark.z.so" //受影响于OpenHarmony-v3.1-Release到OpenHarmony-v3.1.5-Release
strings:
$fix = "The number of argument is less than 1, or the argument is not array." //更新后字符串
condition:
(elf.machine == elf.EM_ARM) and $fix and console.log("OpenHarmony-SA-2023-0201 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/02/OpenHarmony-SA-2023-0201/TestCaseRule-OpenHarmony-SA-2023-0201.yara
|
YARA
|
unknown
| 1,197
|
/*
* Copyright (c) 2024 Beijing University Of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2022_4450 {
meta:
date = "2023-1-15"
file = "/system/lib/libhukssdk.z.so"
openharmony_sa = ""
strings:
$original_pattern = {08 46 DF 22 7C 44 21 46 82 F0 8A ED 01 98 21 46 DF 22 00 68 82 F0 84 ED}
$new_pattern = { 08 46 31 46 DF 22 82 F0 92 E8 00 20 31 46 20 60 DF 22 02 9C 20 68 82 F0 8A E8 }
condition:
((not $original_pattern) and $new_pattern) and console.log("CVE_2022_4450 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/03/CVE-2022-4450/TestCaseInfo-CVE-2022-4450.yara
|
YARA
|
unknown
| 1,137
|
/*
* Copyright (c) 2024 BUPT.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_CVE_2023_23914
{
meta:
date="2023-03"
openharmony_sa=""
cve="CVE-2023-23914"
affected_files="libhttp.z.so"
path ="rk3568/lib.unstripped/communication/netstack/libhttp.z.so"
strings:
$fix = "Reject response due to more than %u content encodings"
condition:
$fix and console.log("CVE-2023-23914 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/03/CVE-2023-23914/TestCaseRule-CVE-2023-23914.yara
|
YARA
|
unknown
| 989
|
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_OpenHarmony_SA_2023_0301
{
meta:
date = "2023-03-08"
openharmony_sa = "OpenHarmony-SA-2023-0301"
cve = "CVE-2023-24465"
severity = "medium"
file = "libwifi_scan_ability.z.so"
func = "WifiScanStub::OnScanByParams"
strings:
$features = "run OnScanByParams code %{public}u, datasize %{public}zu" nocase wide ascii
/* 3.1.4 vul code
.text:0000B0D0 01 46 MOV R1, R0
.text:0000B0D2 20 46 MOV R0, R4
*/
$vul = {01 46 ?? 46}
/* 3.1.4 with patch
.text:0000B0DA 7D 44 ADD R5, PC ; ""
.text:0000B0DC 08 BF IT EQ
.text:0000B0DE 29 46 MOVEQ R1, R5
*/
$fix = {7? 44 08 BF ?? 46}
condition:
(elf.machine == elf.EM_ARM) and $features and ((not $vul) or $fix) and console.log("OpenHarmony-SA-2023-0301 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/03/OpenHarmony-SA-2023-0301/TestCaseRule-OpenHarmony-SA-2023-0301.yara
|
YARA
|
unknown
| 1,828
|
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_OpenHarmony_SA_2023_0302
{
meta:
date = "2023-03-10"
openharmony_sa = "OpenHarmony-SA-2023-0302"
file = "libappexecfwk_core.z.so"
path = "rk3568/appexecfwk/bundle_framework/libappexecfwk_core.z.so"
strings:
$fix = "ERR_APPEXECFWK_PARSE_PROFILE_PROP_SIZE_CHECK_ERROR"
condition:
$fix and console.log("OpenHarmony-SA-2023-0302 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/03/OpenHarmony-SA-2023-0302/TestCaseRule-OpenHarmony-SA-2023-0302.yara
|
YARA
|
unknown
| 1,043
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2022_30787
{
meta:
date = "2024-01-15"
file = "/system/bin/fsck.ntfs"
strings:
$fix = "name in inode %lld"
condition:
$fix and console.log("TestCaseRule-OpenHarmony-CVE-2022-30787 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2023/04/OpenHarmony-CVE-2022-30787/TestCaseRule-OpenHarmony-CVE-2022-30787.yara
|
YARA
|
unknown
| 973
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_2398
{
meta:
date="2024-11-11"
openharmony_sa=""
cve="CVE-2024-2398"
affected_files="/system/lib/libcurl_shared.z.so"
strings:
$fix= {F0 B5 ?? B0 ?? 46 D0 F8 ?? ?? ?? 4D ?? 44 60 B1}
condition:
$fix and console.log("CVE-2024-2398 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/06/CVE-2024-2398/TestCaseRule-CVE-2024-2398.yara
|
YARA
|
unknown
| 1,004
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_2478
{
meta:
date="2024-11-11"
openharmony_sa=""
cve="CVE-2024-2478"
affected_files="/system/lib/libwpa_sys.z.so"//in 4.1.x, and "/system/lib/libwpa.z.so" in 4.0.x
strings:
$fixstring= "EAP-PEAP: Require Phase 2 authentication for initial connection"
condition:
$fixstring and console.log("CVE-2024-2478 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/06/CVE-2024-2478/TestCaseRule-CVE-2024-2478.yara
|
YARA
|
unknown
| 1,077
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_26883
{
meta:
date="2024-12-05"
openharmony_sa=""
cve="CVE-2024-26883"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix_4_0_x = {89 35 01 D0 29 85 4C B9 3F 0D 55 6B 03 FE FF 54 14 00 00 14}
$fix_4_1_x = {1F 01 09 6B 69 00 00 54 D4 00 80 92 EA FF FF 17}
condition:
($fix_4_0_x or $fix_4_1_x) and console.log("CVE-2024-26883 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/07/CVE-2024-26883/TestCaseRule-CVE-2024-26883.yara
|
YARA
|
unknown
| 1,124
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_26884
{
meta:
date="2024-12-05"
openharmony_sa=""
cve="CVE-2024-26884"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {1F 01 09 6B 48 03 00 54 E8 03 08 2A}
condition:
$fix and console.log("CVE-2024-26884 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/07/CVE-2024-26884/TestCaseRule-CVE-2024-26884.yara
|
YARA
|
unknown
| 1,006
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule TestCaseRule_CVE_2024_27004
{
meta:
date = "2024-12-23"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {08 20 80 D2 49 04 80 52 A8 D5 FB F2 ?? 16 01 ?? 00 80 ?? 91}
condition:
$fix and console.log("CVE-2024-27004 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/07/CVE-2024-27004/TestCaseRule-CVE-2024-27004.yara
|
YARA
|
unknown
| 1,021
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_27038
{
meta:
date="2024-05-01"
openharmony_sa=""
cve="CVE_2024_27038"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {1f 04 40 b1 48 00 00 54 00 00 40 f9}
$fix = {1f 04 40 b1 68 00 00 54 48 00 00 54 00 00 40 f9}
condition:
((not $vul) or $fix) and console.log("CVE_2024_27038 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/07/CVE-2024-27038/CVE-2024-27038.yara
|
YARA
|
unknown
| 1,081
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2023_52739
{
meta:
date="2025-06-30"
openharmony_sa=""
cve="CVE_2023_52739"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {6a 16 42 f9 4a 21 00 91 15 00 00 14}
$fix = {68 1a 42 f9 17 05 00 f9 1b 00 00 14}
condition:
((not $vul) or $fix) and console.log("CVE_2024_52739 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2023-52739/TestCaseRule-CVE-2023-52739.yara
|
YARA
|
unknown
| 1,069
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_52781
{
meta:
date="2024-05-21"
openharmony_sa=""
cve="CVE_2023_52781"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {6a 16 42 f9 4a 21 00 91 15 00 00 14}
$fix = {68 1a 42 f9 17 05 00 f9 1b 00 00 14}
condition:
((not $vul) or $fix) and console.log("CVE_2024_27038 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2023-52781/CVE-2023-52781.yara
|
YARA
|
unknown
| 1,069
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_52835
{
meta:
data="2024-12-17"
openharmony_sa=""
cve="CVE-2024-52835"
file="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$b_version = {C8 7E 7D 93 08 05 00 D1 1F 05 40 F1}
$b_version2 = {08 FD 4C D3 08 11 C0 DA 1F D5 00 71}
condition:
$b_version and $b_version2 and console.log("CVE-2023-52835 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2023-52835/TestCaseRule-CVE-2023-52835.yara
|
YARA
|
unknown
| 1,075
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2023_52868
{
meta:
date = "2024-12-27"
file = ""
strings:
$fix = {FA 03 16 AA ?2 6F 00 ?0 42 ?? ?? 91 81 02 80 52 43 87 44 B8 E0 03 1A AA ?? B? E4 97}
condition:
$fix and console.log("TestCaseRule_CVE_2023_52868 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2023-52868/TestCaseRule-CVE-2023-52868.yara
|
YARA
|
unknown
| 1,007
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_26733
{
meta:
date="2024-12-23"
openharmony_sa=""
cve="CVE-2024-26733"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {61 62 03 91 1F 39 00 71 02 31 89 1A}
condition:
$fix and console.log("CVE-2024-26733 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-26733/TestCaseRule-CVE-2024-26733.yara
|
YARA
|
unknown
| 1,006
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_26934
{
meta:
date="2024-12-05"
openharmony_sa=""
cve="CVE-2024-26934"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {?? E0 FF 97 E0 03 14 AA ?? ?? DB 97}
condition:
$fix and console.log("CVE-2024-26934 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-26934/TestCaseRule-CVE-2024-26934.yara
|
YARA
|
unknown
| 1,006
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_27399
{
meta:
date = "2024-05-23"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
openharmony_sa=""
cve="CVE_2024_27399"
strings:
$vul = {75 02 40 F9 ?? 05 10 37 }
$fix = {75 02 40 F9 ?? 05 10 37 D5 04 00 B4}
condition:
((not $vul) or $fix) and console.log("CVE_2024_27399 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-27399/TestCaseRule-CVE-2024-27399.yara
|
YARA
|
unknown
| 1,098
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_28182
{
meta:
date="2024-11-15"
openharmony_sa=""
cve="CVE-2024-28182"
affected_files="/system/lib/platformsdk/libnghttp2_shared.z.so"
strings:
$fixstring = "Too many CONTINUATION frames following a HEADER frame"
condition:
$fixstring and console.log("CVE-2024-28182 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-28182/TestCaseRule-CVE-2024-28182.yara
|
YARA
|
unknown
| 1,069
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_35789 {
meta:
date = "20240508"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {0? 1D 00 94}
$unfix = {A4 1D 00 94}
/* 4.1.3 版本特殊判断 */
$s = {B4 34 00 94}
condition:
$fix and ( not $unfix or $s ) and console.log("CVE-2024-35789 pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-35789/CVE-2024-35789.yara
|
YARA
|
unknown
| 1,055
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestcaseRule_OpenHarmony_CVE_2024_35822
{
meta:
date = "2024-05-17"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = "USB gadget: queue request to disabled ep 0x%x (%s)\n"
condition:
$fix and console.log("OpenHarmony-CVE-2024-35822 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-35822/TestcaseRule-OpenHarmony-CVE-2024-35822.yara
|
YARA
|
unknown
| 1,027
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_35969
{
meta:
date="2024-06-20"
files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {C0 82 00 91 08 FC DF 88 08 02 00 34}
condition:
$fix and console.log("CVE-2024-35969 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-35969/TestCaseRule-OpenHarmony-CVE-2024-35969.yara
|
YARA
|
unknown
| 975
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule CVE_2024_36008
{
meta:
date="2024-12-18"
openharmony_sa=""
cve="CVE-2024-36008"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix= {C6 06 00 B4 F3 03 00 AA A0 02 80 12 4B 0C 1C 12 7F 81 03 71}
condition:
$fix and console.log("CVE-2024-36008 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36008/TestCaseRule-CVE-2024-36008.yara
|
YARA
|
unknown
| 1,041
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_36899
{
meta:
date="2024-12-06"
openharmony_sa=""
cve="CVE-2024-36939"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {?? ?? E3 97 60 32 52 F9}
condition:
$fix and console.log("CVE-2024-36899 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36899/TestCaseRule-CVE-2024-36899.yara
|
YARA
|
unknown
| 993
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_36901
{
meta:
date="2024-12-16"
openharmony_sa=""
cve="CVE-2024-36901"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {CB B0 9B 52 A8 83 1F F8 48 2C 40 F9 08 F9 7F 92 09 01 40 F9 0A 5D 40 F9 4B 58 01 79 48 08 40 F9 49 08 00 F9 EA 05 00 B4 4B A9 41 B9 8B 04 00 35 F5 03 01 AA 6A 72 40 79 4A 02 10 37}
condition:
$fix and console.log("CVE-2024-36901 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36901/TestCaseRule-CVE-2024-36901.yara
|
YARA
|
unknown
| 1,149
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_36904 {
meta:
date = "20240508"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {B5 FD FF 35}
condition:
$fix and console.log("CVE-2024-36904 pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36904/CVE-2024-36904.yara
|
YARA
|
unknown
| 940
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_36939
{
meta:
date="2024-12-06"
openharmony_sa=""
cve="CVE-2024-36939"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {?? ?? 37 94 80 00 00 B4 E0 03 13 AA ?? D5 FF 97 04 00 00 14 E0 03 13 AA ?? D5 FF 97 60 01 80 12}
condition:
$fix and console.log("CVE-2024-36939 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36939/TestCaseRule-CVE-2024-36939.yara
|
YARA
|
unknown
| 1,065
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_36940
{
meta:
date="2024-12-10"
file=""
strings:
$fix={60 2A 40 F9 01 A4 00 ?0 21 ?? ?? 91 E2 03 14 2A ?? ?? 0A 94 E7 FF FF 17}
$nofix={68 0A 40 F9 E0 03 13 AA 01 05 40 F9 02 11 40 B9 10 00 00 94 E0 03 13 AA}
condition:
$fix and not $nofix and console.log("TestCaseRule_CVE-2024-36940 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36940/TestCaseRule-CVE-2024-36940.yara
|
YARA
|
unknown
| 1,057
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_36941
{
meta:
data = "2024-12-07"
openharmony_sa = ""
cve = "CVE-2024-36941"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix_version = {A9 02 00 B4 77 56 14 9B}
condition:
// 匹配 5.0 版本的机器码并输出信息
$fix_version and console.log("CVE-2024-36941 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-36941/TestCaseRule-CVE-2024-36941.yara
|
YARA
|
unknown
| 1,104
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_CVE_2024_4603
{
meta:
date="2024-11-14"
file=""
strings:
$fix={70 B5 05 46 80 68 0C 46 00 28 1C BF E9 68 00 29 02 D1 72 25 19 26 15 E0}
condition:
$fix and console.log("TestCaseRule_CVE_2024_4603 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/08/CVE-2024-4603/TestCaseRule-CVE-2024-4603.yara
|
YARA
|
unknown
| 955
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_25739
{
meta:
date = "2024-02-12"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = "LEB size too small for a volume record"
condition:
$fix and console.log("OpenHarmony-CVE-2024-25739 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/09/CVE-2024-25739/TestCaseRule-OpenHarmony-CVE-2024-25739.yara
|
YARA
|
unknown
| 1,013
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule TestCaseRule_OpenHarmony_CVE_2024_26585
{
meta:
date = "2024-02-21"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$vul = {48 FA FF B4 09 C0 19 D1 2A 00 80 52 2A 01 00 B9 BF 3B 03 D5 89 56 40 F9 1F 01 09 EB F5 17 9F 1A}
$fix = {E0 03 08 AA 81 3A 00 B9 45 EF FF 97}
condition:
((not $vul) or $fix) and console.log("OpenHarmony-CVE-2024-26585 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/09/CVE-2024-26585/TestCaseRule-OpenHarmony-CVE-2024-26585.yara
|
YARA
|
unknown
| 1,140
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE202436270
{
meta:
date="2024-12-29"
openharmony_sa=""
cve="CVE-2024-36270"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {08 FD DF C8 88 01 00 B4 08 41 00 91 08 FD DF C8}
$vul = {08 FD DF C8 08 41 00 91 08 FD DF C8 28 01 00 B4}
condition:
((not $vul) and $fix) and console.log("CVE-2024-36270 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/09/CVE-2024-36270/TestCaseRule-OpenHarmony-CVE-2024-36270.yara
|
YARA
|
unknown
| 1,094
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
import "elf"
rule CVE_2024_38564
{
meta:
date = "2024-12-18"
openharmony_sa = ""
cve = "CVE-2024-38564"
file = "/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {e0 03 13 2a ?? ?? ?? ?? 88 06 40 b9 1f 01 00 6b}
condition:
$fix and console.log("CVE-2024-38564 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38564/TestCaseRule-CVE-2024-38564.yara
|
YARA
|
unknown
| 1,030
|
/*
* Copyright (c) 2024 Beijing University of Posts and Telecommunications.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "console"
rule CVE_2024_38577
{
meta:
date="2024-12-06"
openharmony_sa=""
cve="CVE-2024-38577"
affected_files="/dev/block/platform/fe310000.sdhci/by-name/boot_linux"
strings:
$fix = {45 5D 41 F9 06 61 41 F9 E0 23 00 91 01 08 80 52 ?? ?? 19 94}
condition:
$fix and console.log("CVE-2024-38577 testcase pass")
}
|
2301_80000730/security_1307
|
vulntest/SSTSTestcases/2024/09/CVE-2024-38577/TestCaseRule-CVE-2024-38577.yara
|
YARA
|
unknown
| 1,028
|