zoukankan      html  css  js  c++  java
  • pwnable.kr-random-Writeup

    MarkdownPad Document

    pwnable.kr-random-Writeup

    • 与前几题套路相同,ssh远程登录,ls -l查看文件及权限,cat获得C代码如下:
     1 #include <stdio.h>
     2 
     3 int main(){
     4     unsigned int random;
     5     random = rand();    // random value!
     6 
     7     unsigned int key=0;
     8     scanf("%d", &key);
     9 
    10     if( (key ^ random) == 0xdeadbeef ){
    11         printf("Good!
    ");
    12         system("/bin/cat flag");
    13         return 0;
    14     }
    15 
    16     printf("Wrong, maybe you should try 2^32 cases.
    ");
    17     return 0;
    18 }
    • 查看random()函数时有这样的描述:

    • 即该函数每次产生的随机值均为定值,自己写一个类似的程序可以得到此时产生的随机值为1804289383

    • 根据代码流程,1804289383 ^ 0xdeadbeef即可得到要输入的key值为3039230856,则可得到flag为 Mommy, I thought libc random is unpredictable...

    2017-2-7 22:01;32

  • 相关阅读:
    centos7.5部署mysql cluster NDB总结
    读《构建之法》13--17章有感
    读《构建之法》8--10章
    作业5.2
    作业5.1
    读《构建之法》6--7章读后感
    做汉堡,做汉堡
    《构建之法》1—5章读后感
    第二次作业
    1
  • 原文地址:https://www.cnblogs.com/WangAoBo/p/6376082.html
Copyright © 2011-2022 走看看