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. 不相交集ADT 你是和谁是一类人?

    //不相交集ADT (抽象数据类型) //一般用于集合运算 //用树,这种结构组成,有多个树(=森林) //属于同一颗数的元素,表示处于同一个集合中 //主要支持2个操作. //1. Find操作,找 ...

  2. WINDOWS代理服务器搭建 - Apache httpd

    1.检查电脑系统类型 检查电脑版本是为 32位操作系统 还是 64位操作系统 2.下载安装Apache Httpd 下载地址:https://www.apachehaus.com/cgi-bin/do ...

  3. 集成Hive和HBase

    1. MapReduce 用MapReduce将数据从本地文件系统导入到HBase的表中, 比如从HBase中读取一些原始数据后使用MapReduce做数据分析. 结合计算型框架进行计算统计查看HBa ...

  4. autojump--懒人利器

    只有打开过的目录 autojump 才会记录,所以使用时间越长,autojump 才会越智能. 可以使用 autojump 命令,或者使用短命令 j. 跳转到指定目录 j directoryName ...

  5. node 连接 mysql 数据库三种方法------笔记

    一.mysql库 文档:https://github.com/mysqljs/mysql mysql有三种创建连接方式 1.createConnection 使用时需要对连接的创建.断开进行管理 2. ...

  6. 现代C++实现多种print

    目录 Print Version1 Print Version2 Print Version3 Print Version4 容器的Print tuple容器的print 结语 学习C++的朋友会遇到 ...

  7. 【CF1172E】Nauuo and ODT(Link-Cut Tree)

    [CF1172E]Nauuo and ODT(Link-Cut Tree) 题面 CF 给你一棵树,每个节点有一个颜色. 定义一条路径的权值为路径上不同颜色的数量.求所有有向路径的权值和. 有\(m\ ...

  8. Apache ActiveMQ序列化漏洞(CVE-2015-5254)复现

    Apache ActiveMQ序列化漏洞(CVE-2015-5254)复现 一.漏洞描述 该漏洞源于程序没有限制可在代理中序列化的类.远程攻击者可借助特制的序列化的java消息服务(JMS)Objec ...

  9. ABAP对象-面向对象(转)

    转自:https://www.jianshu.com/p/f847c8f71438 1 面向对象基础 不多赘述何为对象与类.简单回顾一下在面向对象特性. 封装 限定内部资源的可见性 多态 相同名称的方 ...

  10. wpf 当DataGrid列模版是ComboBox时,显示信息

    ​ 实际工作中,有时DataGrid控件某一列显示数据是从Enum集合里面选择出来的,那这时候设置列模版为ComboBox就能满足需求.而关于显示的实际内容,直接是Enum的string()返回值可能 ...