chac88
V2EX  ›  PHP

一道 PHP 安全题,大家来玩坏他

  •  2
     
  •   chac88 · Oct 17, 2015 · 6416 views
    This topic created in 4035 days ago, the information mentioned may be changed or developed.

    要求输出$flag,实在没看出是什么鬼。大神勿喷

    传送门:http://202.120.7.133:8888/collision.php

    <?php
    //just break the md5 algorithm and make a collision ;)
    include('config.php');
    if(empty($_GET['md5'])) die(show_source(__FILE__));
    if($_GET['md5']!='400035577431' && md5($_GET['md5']) == md5('400035577431')) echo $flag;
    ?>
    1
    
    Supplement 1  ·  Oct 17, 2015

    第二题:

    传送门:http://202.120.7.134:8888/html/array.php

    <?php
    include('config.php');
    if(empty($_GET['user'])) die(show_source(__FILE__));
    $user = ['admin', (string)time()];
    if($_GET['user'] === $user && $_GET['user'][0] != 'admin'){echo $flag;}
    

    求$flag;

    24 replies  •  2015-10-19 11:32:30 +08:00
    menc
    menc
    Oct 17, 2015
    1
    人家说的不是很明白要给出 400035577431 的一个 md5 碰撞么
    virusdefender
    virusdefender
    Oct 17, 2015
    2
    php 弱类型吧,想办法绕过$_GET['md5']!='400035577431'
    raincious
    raincious
    Oct 17, 2015
    3
    http://202.120.7.133:8888/collision.php?md5=QNKCDZO

    看到了==比较符号猛然想到了这个帖子
    https://www.v2ex.com/t/188364
    zk8802
    zk8802
    Oct 17, 2015
    4
    注意 == 和 === 在 PHP 中的区别。
    newliu6
    newliu6
    Oct 17, 2015❤️1
    5
    ISG{not_OnlY_mD5_c0llisi0N_bUt_aLs0_proBl3m}
    POP
    POP
    Oct 17, 2015
    6
    @newliu6 你快把别人玩坏了。。。。。
    MrZephyrus
    MrZephyrus
    Oct 17, 2015
    7
    竟然在这儿问 ISG 的题...
    Scholer
    Scholer
    Oct 17, 2015
    8
    240610708
    chac88
    chac88
    OP
    Oct 17, 2015
    9
    @Scholer 这个是怎么计算出来的?
    wsy2220
    wsy2220
    Oct 17, 2015
    10
    看 ip 好熟悉,一查果然是交大的~
    chac88
    chac88
    OP
    Oct 17, 2015
    11
    @raincious 又更新了个,来围观下
    Scholer
    Scholer
    Oct 17, 2015❤️1
    12
    @ty0716 0e123 之类的字符串在 使用 == 判断时会被认为是 科学计数法表示的小数,直接转换为 0 。
    Scholer
    Scholer
    Oct 17, 2015
    13
    @ty0716 这个之前发过好多了

    类似的还有
    QNKCDZO
    aabg7XSs
    aabC9RqS
    rannnn
    rannnn
    Oct 17, 2015
    14
    @MrZephyrus ISG 是什么?
    xjx0524
    xjx0524
    Oct 17, 2015
    15
    刚去注册了下,登陆那个答题系统一直密码错误,难道这就开始是题目了?
    MrZephyrus
    MrZephyrus
    Oct 17, 2015
    17
    softbug
    softbug
    Oct 18, 2015
    18
    很想知道第二题 有悖常理啊
    raincious
    raincious
    Oct 18, 2015
    19
    @ty0716

    第二题比较难。我需要研究下 PHP 的源代码才能确定问题(如果问题真的存在的话)。
    CChin
    CChin
    Oct 18, 2015
    21
    @xiaoks 那请问这个 EXP 用出来这么不输出东西
    orzfly
    orzfly
    Oct 19, 2015
    22
    (避免有人看不懂 20 楼的微博链接)

    php > $a[4294967296]="admin";
    php > var_dump($a);
    array(1) {
    [4294967296]=>
    string(5) "admin"
    }
    php > var_dump($a === ["admin"]);
    bool(true)
    barbery
    barbery
    Oct 19, 2015
    23
    第二题有点意思,不错不错
    newliu6
    newliu6
    Oct 19, 2015
    24
    (string)time()这个怎么撞?时间一直在变吧。
    我尝试的方法是获取服务器时间,转成 timestamp ,然后加个 30 ,不断刷新去等。。。笨
    有好点儿的方法么。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3157 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 04:33 · PVG 12:33 · LAX 20:33 · JFK 23:33
    ♥ Do have faith in what you're doing.