当前位置:网站首页>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
边栏推荐
- JS controls the file type and size when uploading files
- JVM的类加载过程
- Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
- Translation of audio signal processing and coding: Preface
- OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
- OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- Codeworks round 783 (Div. 2) d problem solution
- Codeforces Round #783 (Div. 2) D题解
- ESP8266-入门第一篇
猜你喜欢
【webrtc】Add x264 encoder for CEF/Chromium
MySQL syntax collation (2)
【webrtc】Add x264 encoder for CEF/Chromium
JVM的类加载过程
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
优先使用组合而不使用继承
C6748 软件仿真和硬件测试 ---附详细FFT硬件测量时间
Decompile and get the source code of any wechat applet - just read this (latest)
指针数组与数组指针的区分
Zero cost, zero foundation, build profitable film and television applet
随机推荐
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
Openharmony open source developer growth plan, looking for new open source forces that change the world!
ArcGIS JS API dojoconfig configuration
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
A simple (redisson based) distributed synchronization tool class encapsulation
MySQL syntax collation (2)
MySQL数据库 - 单表查询(三)
坐标转换WGS-84 转 GCJ-02 和 GCJ-02转WGS-84
Common SQL commands
ArcMap publishing slicing service
Command - sudo
5 minutes to achieve wechat cloud applet payment function (including source code)
Gossip: on greed
[report] Microsoft: application of deep learning methods in speech enhancement
优先使用组合而不使用继承
Regular expressions for judging positive integers
uIP1.0 主动发送的问题理解
Kubernetes入门到精通-裸机LoadBalence 80 443 端口暴露注意事项
All table queries and comment description queries of SQL Server
Strange passion