zoukankan      html  css  js  c++  java
  • Natas22 Writeup(header重定向、burp截取抓包)

    Natas22:

     

    打开页面是一个空白页面,查看源码,看起来好像是需要我们在url中添加“revelio”参数即可,然而实验了之后发现浏览器跳转回了原来的页面。

    再次仔细审计源码,会看到页面开头有一个重定向。关键代码:

    if(array_key_exists("revelio", $_GET)) {
        // only admins can reveal the password
        if(!($_SESSION and array_key_exists("admin", $_SESSION) and $_SESSION["admin"] == 1)) {
        header("Location: /");
        }
    }
    

    header(“Location: /”)中,header函数表示发送一个原始 Http Header到客户端,指定Location是进行重定向,/表示本地,即刷新。

        if(array_key_exists("revelio", $_GET)) {
        print "You are an admin. The credentials for the next level are:<br>";
        print "<pre>Username: natas23
    ";
        print "Password: <censored></pre>";
        }
    

    如果get参数中包含revelio,则输出flag。

    总结思路,先在get参数中添加revelio,满足获取密码的条件,但要避免刷新,所以使用burp抓包,把第一次抓到的数据包放到Repeater中Go一下,这样可以避免第二次的跳转,在返回中看到了flag。

    flag:D0vlad33nQF0Hz2EP255TP5wSW9ZsRSE

    参考:

    https://www.cnblogs.com/ichunqiu/p/9554885.html
    https://blog.csdn.net/baidu_35297930/article/details/99732206?utm_source=distribute.pc_relevant.none-task
    https://blog.csdn.net/whklhhhh/article/details/77418201?utm_source=distribute.pc_relevant.none-task

  • 相关阅读:
    27. Remove Element
    26. Remove Duplicates from Sorted Array
    643. Maximum Average Subarray I
    674. Longest Continuous Increasing Subsequence
    1. Two Sum
    217. Contains Duplicate
    448. Find All Numbers Disappeared in an Array
    566. Reshape the Matrix
    628. Maximum Product of Three Numbers
    UVa 1349 Optimal Bus Route Design (最佳完美匹配)
  • 原文地址:https://www.cnblogs.com/zhengna/p/12341171.html
Copyright © 2011-2022 走看看