当前位置:网站首页>Shanda Wangan shooting range experimental platform project - personal record (IV)
Shanda Wangan shooting range experimental platform project - personal record (IV)
2022-04-23 19:30:00 【Chen Song】
The address of the column of the series of articles :
Shandong University Network Security shooting range experimental platform
The content of this issue :
- Construction of shooting range plate
One 、 Design page

In the early stage, I wrote the outline of this module , There is only one simple framework , Now you need to complete the whole logical setting .
The first is the folding frame : We will design a component reference in the page
<template>
<!-- Range module -->
<div class="honeypot">
<sduheader></sduheader>
<bug-card></bug-card>
</div>
</template>
The main contents are as follows :element-ui The folding panel

I found the accordion effect , The code structure is as follows , I set up 10 A content

After each category is expanded, there will be several questions below , The user clicks the title to do the title

This part of the code , Take the fourth column in the figure (CSRF) Examples :
<el-collapse-item name="4">
<template #title>
<h1>
<i class="el-icon-s-grid"></i>
CSRF
</h1>
</template>
<div>
<el-col v-for="(problem, problemid) in CSRFproblemlist" :key="problemid" >
<el-card class="problem-card" shadow="hover" @click="gotopro(problem.problemid)">
<h3 style="color: black;margin: 50px"> {
{problem.problemname}}</h3>
</el-card>
</el-col>
</div>
</el-collapse-item>
You can see , I use Template #title Rewrite the column title of this folding column , Then there are several card( card ) use v-for Cycle to get :
v-for="(problem, problemid) in CSRFproblemlist"
CSRPproblemlist stay script It's defined in :
export default {
data(){
return {
SQLproblemlist:[],
Forceproblemlist:[],
XSSproblemlist:[],
CSRFproblemlist:[
{
problemid:'0010',
problemname:' Title '
},
{
problemid:'0011',
problemname:' Title '
}
],
RCEproblemlist:[],
downloadproblemlist:[],
SSRFproblemlist:[],
heartproblemlist:[],
passwordproblemlist:[],
Unsafeproblemlist:[],
drawer:false,
}
},
After the user clicks the title , Jump to a new page

tips:
1. Design gradient background color
.honeypot {
/*background-image: linear-gradient(to bottom right, #000000, #483D8B);*/
background-image: linear-gradient(to bottom right, #F5F5F5, #808A87);
margin: 0px;
padding: 0px;
min-height: 100vh;
}
2. Design the background picture of the card
.problem-card{
/*background-image: linear-gradient(to bottom right, #000000, #483D8B);*/
background-image: url("../assets/img/7.jpg");
background-size:100% 100%;
padding:5px;
margin:20px;
width: 300px;
height: 200px;
border-color:#99a9bf;
border-width: 5px;
cursor: pointer;
}
Design backend
Want to achieve , Click each folding bar to display the corresponding topic information , Let's save something for the database first
surface problem:


And then at the back end springboot Write entity classes problem:
package com.sducsrp.csrp.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("problem")
public class Problem {
@TableId(type = IdType.AUTO)
private String problemid;
private String problemname;
private String problemcontent;
private String url;
private String kind;
private String flag;
}
stay controller Next create a problemcontroller, Define a method getinfobytype, It means through type To get problem Information , Our topic types are SQL Inject , Brute force cracking and so on ...
package com.sducsrp.csrp.controller;
import com.sducsrp.csrp.common.Result;
import com.sducsrp.csrp.entity.Problem;
import com.sducsrp.csrp.entity.User;
import com.sducsrp.csrp.mapper.ProblemMapper;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/problem")
public class ProblemController {
@Resource
ProblemMapper problemMapper;
@GetMapping("/getinfobytype")
public Result getinfobytype(@RequestParam() String problemtype){
System.out.println(problemtype);
List<Problem> a= problemMapper.SearchProbleminfo_bytype(problemtype);
return Result.success(a);
}
}
Write Mapper class :sql sentence :select * from problem where kind = #{kind}
package com.sducsrp.csrp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sducsrp.csrp.entity.Problem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ProblemMapper extends BaseMapper<Problem> {
@Select("select * from problem where kind = #{kind}")
List<Problem> SearchProbleminfo_bytype(String kind);
}
thus , The front end calls the back end /problem/getinfobytype Interface , You can get the title information returned by the database .
Back to the front : Click to bind an event to us getprobleminfo
methods:{
gotopro(problemid){
this.$router.push({
path:'/bugpage',query: {
id:problemid}})
},
getprobleminfo(type){
request.get("/problem/getinfobytype",{
params:{
problemtype:type
}
}).then(res =>{
var len=res.data.length;
for (let i = 0; i < len; i++) {
if(type=='sqli'){
this.SQLproblemlist[i]=res.data[i];
}else if(type=='rce'){
this.RCEproblemlist[i]=res.data[i];
}else if(type=='force'){
this.Forceproblemlist[i]=res.data[i];
}else if(type=='filedownload'){
this.downloadproblemlist[i]=res.data[i];
}
}
})
}
Use request.get, The returned information is then assigned to the corresponding type of problemlist
The effect picture after success is as follows : Click on SQL-inject You can see that the title information of the database has been obtained

版权声明
本文为[Chen Song]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231923279793.html
边栏推荐
- Hot reload debugging
- Kubernetes入门到精通-在 Kubernetes 上安装 OpenELB
- Efficient serial port cyclic buffer receiving processing idea and code 2
- [报告] Microsoft :Application of deep learning methods in speech enhancement
- @Mapperscan and @ mapper
- Core concepts of rest
- Some speculation about the decline of adults' language learning ability
- JS calculation time difference
- Modify the font size of hint in editext
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
猜你喜欢

MySQL syntax collation (4)

Unity创建超写实三维场景的一般步骤

Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)

OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!

【webrtc】Add x264 encoder for CEF/Chromium

Class loading process of JVM
![[报告] Microsoft :Application of deep learning methods in speech enhancement](/img/c1/7bffbcecababf8dabf86bd34ab1809.png)
[报告] Microsoft :Application of deep learning methods in speech enhancement
![[webrtc] add x264 encoder for CEF / Chromium](/img/3f/9bf73d6d2aec14ba94dfc6734eb6ac.png)
[webrtc] add x264 encoder for CEF / Chromium

山大网安靶场实验平台项目-个人记录(五)

Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
随机推荐
【webrtc】Add x264 encoder for CEF/Chromium
Go three ways to copy files
MySQL数据库 - 数据库和表的基本操作(二)
First experience of using fluent canvas
Hot reload debugging
Some ideas about time-consuming needs assessment
MySQL syntax collation (3)
对普通bean进行Autowired字段注入
Problems caused by flutter initialroute and home
命令-sudo
MFC获取本机IP(网络通讯时用得多)
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
A simple (redisson based) distributed synchronization tool class encapsulation
FFT物理意义: 1024点FFT就是1024个实数,实际进入fft的输入是1024个复数(虚部为0),输出也是1024个复数,有效的数据是前512个复数
Matlab 2019 installation of deep learning toolbox model for googlenet network
TI DSP的 FFT与IFFT库函数的使用测试
JVM的类加载过程
An idea of rendering pipeline based on FBO
Go recursively loops through folders
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies