当前位置:网站首页>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
边栏推荐
- 如何在BNB链上创建BEP-20通证
- [transfer] summary of new features of js-es6 (one picture)
- MFC获取本机IP(网络通讯时用得多)
- Why is the hexadecimal printf output of C language sometimes with 0xff and sometimes not
- IIS数据转换问题16bit转24bit
- Steps to build a deep learning environment GPU
- 深度学习环境搭建步骤—gpu
- Inject Autowired fields into ordinary beans
- Reflection on the performance of some OpenGL operations in the past
- An idea of rendering pipeline based on FBO
猜你喜欢
[report] Microsoft: application of deep learning methods in speech enhancement
The platinum library cannot search the debug process records of some projection devices
JVM的类加载过程
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
【webrtc】Add x264 encoder for CEF/Chromium
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
【webrtc】Add x264 encoder for CEF/Chromium
MySQL syntax collation (3)
White screen processing method of fulter startup page
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
随机推荐
Redis core technology and practice 1 - start with building a simple key value database simplekv
@Analysis of conditional on Web Application
Codeforces Round #783 (Div. 2) D题解
Zero base to build profit taking away CPS platform official account
Class loading process of JVM
Inject Autowired fields into ordinary beans
The flyer realizes page Jump through routing routes
坐标转换WGS-84 转 GCJ-02 和 GCJ-02转WGS-84
仓库管理数据库系统设计
Transaction processing of SQL Server database
Thoughts on the optimization of examination papers in the examination system
Speex Wiener filter and rewriting of hypergeometric distribution
How to select the third-party package of golang
[H264] hevc H264 parsing and frame rate setting of the old version of libvlc
JS calculation time difference
How to uninstall easyton
精简CUDA教程——CUDA Driver API
MySQL数据库 - 单表查询(一)
Kibana reports an error server is not ready yet. Possible causes
arcMap 发布切片服务