Skip to content

Commit 055f749

Browse files
committed
add 验证码相关漏洞
1 parent 09cf2e3 commit 055f749

File tree

39 files changed

+239
-81
lines changed

39 files changed

+239
-81
lines changed

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 25 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
| 漏洞名称 | 难度 |
44
| ---------------------- | ---- |
5-
| [SQL 注入漏洞] | 🌟🌟🌟 |
5+
| [SQL 注入漏洞] | 🌟🌟 |
66
| [XSS 漏洞] | 🌟 |
77
| [SSRF 漏洞] | 🌟🌟 |
8-
| [CORS 漏洞] | 🌟🌟🌟 |
9-
| [RCE 漏洞] | 🌟🌟🌟 |
10-
| [Fastjson反序列化漏洞] | 🌟🌟🌟🌟 |
8+
| [CORS 漏洞] | 🌟🌟 |
9+
| [RCE 漏洞] | 🌟🌟 |
10+
| [反序列化漏洞-Fastjson反序列化] | 🌟🌟🌟🌟 |
11+
| [验证码相关漏洞] | 🌟🌟 |
12+
1113

1214
### 使用说明
1315

images/index.png

262 KB
Loading

secexample.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<configuration />
1515
</facet>
1616
</component>
17-
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
17+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
1818
<output url="file://$MODULE_DIR$/target/classes" />
1919
<output-test url="file://$MODULE_DIR$/target/test-classes" />
2020
<content url="file://$MODULE_DIR$">
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.suyu.secexample.messageecho.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.ui.Model;
5+
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.PostMapping;
7+
8+
import java.util.Random;
9+
10+
@Controller
11+
public class messagecontroller {
12+
13+
int Code = 0;
14+
@GetMapping("/messageecho")
15+
public String index(){
16+
return "messageecho/messageecho";
17+
}
18+
19+
@GetMapping("/messageecho/getcode")
20+
public String getcode(Model model){
21+
Random r = new Random();
22+
int number = r.nextInt(900000);
23+
model.addAttribute("code",number);
24+
System.out.println(number);
25+
Code =number;
26+
return "messageecho/messageechooutput";
27+
}
28+
29+
@PostMapping("/messageecho/testcode")
30+
public String testcode(Integer code1,Model model){
31+
String result ="登陆失败";
32+
if (code1 != null && code1 != 0 &&Code == code1){
33+
System.out.println(true);
34+
result ="登陆成功";
35+
}
36+
model.addAttribute("code1",result);
37+
return "messageecho/messageechooutput";
38+
}
39+
}

src/main/resources/application.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ logging:
2525
secexample:
2626
sql:
2727
mapper:
28-
UserMapper: DEBUG
28+
UserMapper: DEBUG
29+

src/main/resources/banner.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
_____ ______ _
2-
/ ____| | ____| | |
3-
| (___ ___ ___ | |__ __ ____ _ _ __ ___ _ __ | | ___
1+
_____ ______ _
2+
/ ____| | ____| | |
3+
| (___ ___ ___ | |__ __ ____ _ _ __ ___ _ __ | | ___
44
\___ \ / _ \/ __| | __| \ \/ / _` | '_ ` _ \| '_ \| |/ _ \
55
____) | __/ (__ | |____ > < (_| | | | | | | |_) | | __/
66
|_____/ \___|\___| |______/_/\_\__,_|_| |_| |_| .__/|_|\___|
7-
| |
8-
|_|
9-
----by txf
7+
| |
8+
|_|

src/main/resources/templates/index.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h1>Java漏洞演示平台</h1>
2020
<div style="margin-top: 50px;margin-left: 25px;margin-right: 25px" class="ui cards">
2121
<div class="card">
2222
<div class="content">
23-
<div class="header">SQL注入漏洞</div>
23+
<div class="header">注入漏洞-SQL注入</div>
2424
<div class="description">SQL注入通过把SQL命令插入到Web表单提交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行指定的SQL语句</div>
2525
</div>
2626
<a class="ui bottom attached button" th:href="@{/sql}" ><i class="add icon"></i>测试漏洞</a>
@@ -61,12 +61,18 @@ <h1>Java漏洞演示平台</h1>
6161
</div>
6262
<div class="card">
6363
<div class="content">
64-
<div class="header">Fastjson反序列化漏洞</div>
65-
<div class="description">通过Gadgets链绕过autoType开关,在autoType关闭的情况下仍然可能可以绕过黑白名单防御机制,实现了反序列化漏洞利用的远程代码执行效果.Fastjson历史版本中,autoType安全黑名单已被多次绕过,官方也一直在持续补充增强该黑名单,并在1.2.68版本中引入一个safeMode的配置,配置safeMode后,无论白名单和黑名单,都不支持autoType,不过默认并未开启该配置。由于autoType开关漏洞利用门槛较低,可绕过autoType限制,风险影响较大.</div>
64+
<div class="header">反序列化漏洞-Fastjson反序列化</div>
65+
<div class="description">序列化和反序列化本身并不存在问题。但当输入的反序列化的数据可被用户控制,那么攻击者即可通过构造恶意输入,让反序列化产生非预期的对象,在此过程中执行构造的任意代码。</div>
6666
</div>
6767
<a class="ui bottom attached button" th:href="@{/fastjson}" ><i class="add icon"></i>测试漏洞</a>
6868
</div>
69-
69+
<div class="card">
70+
<div class="content">
71+
<div class="header">验证码相关漏洞</div>
72+
<div class="description">短信回显<br>短信轰炸<br>前端绕过验证<br>验证码爆破</div>
73+
</div>
74+
<a class="ui bottom attached button" th:href="@{/messageecho}" ><i class="add icon"></i>测试漏洞</a>
75+
</div>
7076
</div>
7177

7278

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Java漏洞靶场</title>
6+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
7+
</head>
8+
<body>
9+
10+
<div style="padding: 40px;
11+
text-align: center;
12+
background: #1abc9c;
13+
color: white;">
14+
<h1>Java漏洞演示平台</h1>
15+
<button class="ui inverted secondary basic button"><a style="color: white" th:href="home">回到首页</a></button>
16+
</div>
17+
18+
19+
20+
21+
<form style="text-align: center;margin: 0px auto;margin-top: 50px;" border="10">
22+
<div class="ui input">
23+
<input type="text" name="tele" placeholder="手机号码">
24+
<a class="ui button" th:href="@{/messageecho/getcode}">获取验证码</a>
25+
</div>
26+
</form>
27+
28+
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)