ssh连接,输入密码查看目录下的文件

看看random.c的源码

#include <stdio.h>

int main(){
unsigned int random;
random = rand(); // random value! unsigned int key=;
scanf("%d", &key); if( (key ^ random) == 0xdeadbeef ){
printf("Good!\n");
system("/bin/cat flag");
return ;
} printf("Wrong, maybe you should try 2^32 cases.\n");
return ;
}

我们要将key异或random==0xdeadbeef才能获得flag,但是rand函数没有设置随机数种子(srand),所以rand()在调用时会自动设随机数种子为1,导致随机数都是相同值,我们用gdb调试一下,看看随机值

先把文件下载下来

scp -P  -r random@pwnable.kr:/home/random/ /home/你的下载地址

用gdb在rand后面断点,慢慢调试(n)

之后,发现执行完寄存器rax的值为0x6b8b4567,即rand的值,之后获得结果

把答案提交即可

Mommy, I thought libc random is unpredictable...

Pwnable-random的更多相关文章

  1. 【pwnable.kr】random

    pwnable从入门到放弃第七题. ssh random@pwnable.kr -p2222 (pw:guest) 目前为止做的最快的一道题... #include <stdio.h> i ...

  2. pwnable.kr random 之 write up

    ---恢复内容开始--- 首先看源代码: #include <stdio.h> int main(){ unsigned int random; random = rand(); // r ...

  3. pwnable之random

    这题只要多调试几次就会发现其产生的随机数是固定的一个值,那么就可以通过这个随机值和0xdeadbeef反推出我们要输入的数据, 最后附上这题的flag:flag:Mommy, I thought li ...

  4. pwnable.kr详细通关秘籍(二)

    i春秋作家:W1ngs 原文来自:pwnable.kr详细通关秘籍(二) 0x00 input 首先看一下代码: 可以看到程序总共有五步,全部都满足了才可以得到flag,那我们就一步一步来看 这道题考 ...

  5. pwnable.kr-balckjack-Writeup

    MarkdownPad Document *:first-child { margin-top: 0 !important; } body>*:last-child { margin-botto ...

  6. pwnable.kr-random-Writeup

    MarkdownPad Document *:first-child { margin-top: 0 !important; } body>*:last-child { margin-botto ...

  7. 【pwnable.kr】 codemap

    pwnable新的一题. download: http://pwnable.kr/bin/codemap.exe ssh codemap@pwnable.kr -p2222 (pw:guest) 这道 ...

  8. 【pwnable.kr】lotto

    pwnable.好像最近的几道题都不需要看汇编. ssh lotto@pwnable.kr -p2222 (pw:guest) 直接down下来源码 #include <stdio.h> ...

  9. Chrome V8引擎系列随笔 (1):Math.Random()函数概览

    先让大家来看一幅图,这幅图是V8引擎4.7版本和4.9版本Math.Random()函数的值的分布图,我可以这么理解 .从下图中,也许你会认为这是个二维码?其实这幅图告诉我们一个道理,第二张图的点的分 ...

  10. Math.random()

    Math.random() 日期时间函数(需要用变量调用):var b = new Date(); //获取当前时间b.getTime() //获取时间戳b.getFullYear() //获取年份b ...

随机推荐

  1. Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init method failed;

    我报的错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSes ...

  2. DWR服务器推送技术

    参考博客:https://blog.csdn.net/Marksinoberg/article/details/55505423 下载Dwr.jar文件 到官网http://directwebremo ...

  3. LeetCode解题笔记 - 3. Longest Substring Without Repeating Characters

    Given a string, find the length of the longest substring without repeating characters. Examples: Giv ...

  4. 设计模式-Template(行为模式) 采用 继承的方式 将算法封装在抽象基类中,在子类中实现细节。利用面向对象中的多态实现算法实现细节和高层接口的松耦合。

    以下代码来源: 设计模式精解-GoF 23种设计模式解析附C++实现源码 //Template.h class AbstractClass { public: virtual ~AbstractCla ...

  5. 设计模式-Adapter(结构型模式)针对第三方库 函数 接口不匹配的问题,分为类模式 与 对象模式 两种

    以下代码来源: 设计模式精解-GoF 23种设计模式解析附C++实现源码 //****************************类模式的Adaptr*********************** ...

  6. hdu6464 线段树

    http://acm.hdu.edu.cn/showproblem.php?pid=6464 题意 一个空序列,q次操作,一种是往序列后插入x个y,另一种是查询序列中第x小到第y小的数字之和 题解 线 ...

  7. .NET Core NuGet 多项目套餐打包的正确姿势

    NuGet 默认只支持一个菜一个菜打包,不支持套餐打包.当对一个 csproj 项目进行 nuget 打包时(比如使用 dotnet pack 命令),只会将当前项目 build 出来的 dll 程序 ...

  8. dotnetcore实现Aop

    dotnetcore实现Aop Aop大家都不陌生,然而今天给大家不将讲官方的filter,今天给大家分享一个轻量级的Aop解决方案(AspectCore) 什么是AspectCore AspectC ...

  9. Linux war包部署jenkins

    一.介绍Jenkins 1.Jenkins概念 Jenkins是一个功能强大的应用程序,允许持续集成和持续交付项目,无论用的是什么平台.这是一个免费的源代码,可以处理任何类型的构建或持续集成.集成Je ...

  10. php使用inotify扩展监控文件或目录的变化

    一.安装inotify扩展 1.下载inotify扩展源码 https://pecl.php.net/package/inotify 对于php7以上版本,请下载 inotify-2.0.0.tgz. ...