当前位置:网站首页>山大网安靶场实验平台项目-个人记录(五)
山大网安靶场实验平台项目-个人记录(五)
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
边栏推荐
- Some speculation about the decline of adults' language learning ability
- Machine learning catalog
- Using 8266 as serial port debugging tool
- 命令-sudo
- Customize the non slidable viewpage and how to use it
- ArcMap connecting ArcGIS Server
- SSDB foundation 1
- Redis core technology and practice 1 - start with building a simple key value database simplekv
- Is it safe to open an account in Bohai futures.
- binlog2sql 工具安装使用及问题汇总
猜你喜欢
Build intelligent garbage classification applet based on Zero
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
First experience of using fluent canvas
Oracle configuration st_ geometry
MySQL syntax collation (2)
Keysight has chosen what equipment to buy for you
该买什么设备,Keysight 给你挑好了
ArcMap publishing slicing service
网络协议之:sctp流控制传输协议
浅谈c语言指针的强制转换
随机推荐
Transaction processing of SQL Server database
arcgis js api dojoConfig配置
First experience of using fluent canvas
Installation, use and problem summary of binlog2sql tool
Openlayers 5.0 thermal diagram
HTTP cache - HTTP authoritative guide Chapter VII
Parsing headless jsonarray arrays
JS to get the local IP address
@Analysis of conditional on Web Application
Some records used by VS2010
2021-2022-2 ACM集训队每周程序设计竞赛(8)题解
SQL常用的命令
Client interns of a large factory share their experience face to face
Codeworks round 783 (Div. 2) d problem solution
The difference between ordinary inner class and static inner class
Core concepts of rest
Openharmony open source developer growth plan, looking for new open source forces that change the world!
Using 8266 as serial port debugging tool
What is a message queue
Application of DCT transform