当前位置:网站首页>山大网安靶场实验平台项目-个人记录(五)
山大网安靶场实验平台项目-个人记录(五)
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
边栏推荐
- RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
- 2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
- Virtual machine performance monitoring and fault handling tools
- C1000k TCP connection upper limit test 1
- Openlayers 5.0 two centering methods
- 为何PostgreSQL即将超越SQL Server?
- SQL of contention for system time plus time in ocrale database
- The usage of slice and the difference between slice and array
- openlayers 5.0 两种居中方式
- Zero cost, zero foundation, build profitable film and television applet
猜你喜欢
The difference between ordinary inner class and static inner class
[报告] Microsoft :Application of deep learning methods in speech enhancement
Class loading mechanism
The platinum library cannot search the debug process records of some projection devices
Build intelligent garbage classification applet based on Zero
FTP, SSH Remote Access and control
Decompile and get the source code of any wechat applet - just read this (latest)
优先使用组合而不使用继承
Oracle配置st_geometry
Keysight has chosen what equipment to buy for you
随机推荐
Codeforces Round #783 (Div. 2) D题解
数据分析学习目录
Steps to build a deep learning environment GPU
8266 obtain 18b20 temperature
Core concepts of rest
点云数据集常用处理
Prefer composition to inheritance
Openlayers 5.0 two centering methods
js获取本机ip地址
Zero cost, zero foundation, build profitable film and television applet
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Redis optimization series (III) solve common problems after master-slave configuration
MySQL restores or rolls back data through binlog
Solve the problem of invalid listview Click
PostgreSQL
Common SQL commands
ArcGIS JS API dojoconfig configuration
[transfer] summary of new features of js-es6 (one picture)
SSDB foundation 2