当前位置:网站首页>山大网安靶场实验平台项目-个人记录(五)
山大网安靶场实验平台项目-个人记录(五)
2022-04-23 19:23:00 【琛歌】
系列文章专栏地址:
本期内容:
- 靶场板块的跳转
- 开启靶机
一、靶场现阶段介绍
目前项目,我们做了几个靶机环境,比如sql注入,但是都没有部署到docker里
所以我们的靶机网页也是存在前端的views文件夹下,可以url访问,计划先实现这种形式的靶场,在几周后我们会部署到docker,这样才算最终版本,能被多个用户访问和攻击,开启和销毁容器防止服务器被损坏。
二、页面设计
1.靶场板块
点击题目SQL-Char进入题目详情页面

页面主要内容放在一个card里:
<!-- 卡片-->
<div>
<el-card style="width: 80%;height:65vh; margin: 150px; margin-top:110px; background-color: #0B1746;border-color: #1E90FF">
<h1 style="color: white;">{
{probleminfo.problemname}}</h1>
<div style="text-align: left;">
<h3 style="display:inline-block; color: white;">难度系数:</h3>
<el-rate style="display:inline-block;" v-model="probleminfo.problemratio" disabled/>
</div>
<div style="text-align: left;">
<h3 style="color: white;display:inline-block;">题目描述:</h3>
<p style="display:inline-block;color: #DCDCDC">{
{probleminfo.problemcontent}}</p>
</div>
<div style="text-align: left;height:150px;margin-top: 20px;">
<el-button style="background-color: #0B1746;color: white;width: 200px" @click="dialogVisible=true">
<h3>点击获取靶机场景</h3>
</el-button>
</div>
<div style="">
<el-input v-model="input" placeholder="flag{}" style="width:60%;display:block;margin-left: 20%" clearable />
<el-button style="width: 100px;margin-top: 20px" type="primary" :icon="Edit" circle>提交</el-button>
</div>
</el-card>
</div>
然后上面一个返回按钮
<div style="float: left;margin:30px; margin-left: 150px">
<el-button style="background-color: #0B1746;color: white;" @click="goback">返回</el-button>
</div>
我们的点击获取靶场场景按钮需要绑定一个事件,打开一个弹窗
我们先写好弹窗:
<el-dialog v-model="dialogVisible" width="300px">
<!-- v-loading="loading"-->
<h @click="gotopage" style="cursor: pointer;">https://xxx.xx.xx.x</h>
</el-dialog>
效果如下:弹出来一个小窗口,上面显示了一个地址,用户点击进入靶机环境做题

三、功能实现
3.1、带参跳转路由
我们要从数据库取出题目内容,题目标题(problemcontent,problemname)。问题在于如何知道题目id(主键)
我们需要实现将第一个页面的题目id传到第二个页面,然后再用这个id去查到所有信息。所以必须实现带参跳转路由。
1.点击触发方法gotopro

2.带参跳转路由就是在router.push后面加上一个query参数,传递。
gotopro(problemid){
this.$router.push({
path:'/bugpage',query: {
id:problemid}})
},
3.然后路由效果跳转如下:

3.2、渲染新页面
现在新页面已经接到了problemid。然后去后端接口/problem/getinfobyid查所有的题目信息,再赋值给前端变量:
getprobleminfo(){
request.get("/problem/getinfobyid",{
params:{
problemid:this.probleminfo.problemid
}
}).then(res =>{
this.probleminfo.problemname=res.data.problemname;
this.probleminfo.problemcontent=res.data.problemcontent;
})
}
效果如下:Name和content都加载出来了

3.3、打开靶机
我们的靶机路由是和problemid相关联的:
gotopage(){
let href='http://localhost:8080/#'+this.probleminfo.problemid;
window.open(href);
},

这样,点击网页链接(随便写的),就可以跳转到靶机页面。

下一次介绍靶机页面
版权声明
本文为[琛歌]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_50860232/article/details/124266565
边栏推荐
- Go recursively loops through folders
- Codeforces Round #783 (Div. 2) D题解
- The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
- Pit encountered using camera x_ When onpause, the camera is not released, resulting in a black screen when it comes back
- 为何PostgreSQL即将超越SQL Server?
- Tencent cloud GPU best practices - remote development training using jupyter pycharm
- Build intelligent garbage classification applet based on Zero
- The flyer realizes page Jump through routing routes
- Translation of audio signal processing and coding: Preface
- MySQL syntax collation
猜你喜欢

2021-2022-2 ACM training team weekly Programming Competition (8) problem solution

深度学习——特征工程小总结

Client interns of a large factory share their experience face to face

Wechat applet part of the mobile phone Preview PDF did not respond

Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
![[record] typeerror: this getOptions is not a function](/img/c9/0d92891b6beec3d6085bd3da516f00.png)
[record] typeerror: this getOptions is not a function

MySQL restores or rolls back data through binlog

Application of DCT transform

开关电源设计分享及电源设计技巧图解

FTP、ssh远程访问及控制
随机推荐
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
命令-sudo
C1000k TCP connection upper limit test
为何PostgreSQL即将超越SQL Server?
MySQL syntax collation (4)
Golang timer
该买什么设备,Keysight 给你挑好了
Data analysis learning directory
Strange problems in FrameLayout view hierarchy
MySQL syntax collation
js上传文件时控制文件类型和大小
開關電源設計分享及電源設計技巧圖解
Codeforces Round #784 (Div. 4)
The platinum library cannot search the debug process records of some projection devices
Some speculation about the decline of adults' language learning ability
浅谈c语言指针的强制转换
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
Summary of several relationships of UML class diagram
考试系统进入试卷优化思路
SQL of contention for system time plus time in ocrale database