Pwnable-random
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的更多相关文章
- 【pwnable.kr】random
pwnable从入门到放弃第七题. ssh random@pwnable.kr -p2222 (pw:guest) 目前为止做的最快的一道题... #include <stdio.h> i ...
- pwnable.kr random 之 write up
---恢复内容开始--- 首先看源代码: #include <stdio.h> int main(){ unsigned int random; random = rand(); // r ...
- pwnable之random
这题只要多调试几次就会发现其产生的随机数是固定的一个值,那么就可以通过这个随机值和0xdeadbeef反推出我们要输入的数据, 最后附上这题的flag:flag:Mommy, I thought li ...
- pwnable.kr详细通关秘籍(二)
i春秋作家:W1ngs 原文来自:pwnable.kr详细通关秘籍(二) 0x00 input 首先看一下代码: 可以看到程序总共有五步,全部都满足了才可以得到flag,那我们就一步一步来看 这道题考 ...
- pwnable.kr-balckjack-Writeup
MarkdownPad Document *:first-child { margin-top: 0 !important; } body>*:last-child { margin-botto ...
- pwnable.kr-random-Writeup
MarkdownPad Document *:first-child { margin-top: 0 !important; } body>*:last-child { margin-botto ...
- 【pwnable.kr】 codemap
pwnable新的一题. download: http://pwnable.kr/bin/codemap.exe ssh codemap@pwnable.kr -p2222 (pw:guest) 这道 ...
- 【pwnable.kr】lotto
pwnable.好像最近的几道题都不需要看汇编. ssh lotto@pwnable.kr -p2222 (pw:guest) 直接down下来源码 #include <stdio.h> ...
- Chrome V8引擎系列随笔 (1):Math.Random()函数概览
先让大家来看一幅图,这幅图是V8引擎4.7版本和4.9版本Math.Random()函数的值的分布图,我可以这么理解 .从下图中,也许你会认为这是个二维码?其实这幅图告诉我们一个道理,第二张图的点的分 ...
- Math.random()
Math.random() 日期时间函数(需要用变量调用):var b = new Date(); //获取当前时间b.getTime() //获取时间戳b.getFullYear() //获取年份b ...
随机推荐
- jira添加工作流
- Shadow Map -- 点阴影(全方位)
昨晚终于把点阴影(深度CubeMap)程序调通了,思想不难,基本就是在上节定向光阴影基础上稍作修改,但是CG程序不太方便Debug,需要输出中间效果图进行判断,耽搁了一会儿. 过程如下: 1.将深度渲 ...
- 【Oracle】常用的SQL语句
抄自:https://www.cnblogs.com/qiu18359243869/p/9474515.html 提示:dual是一个虚拟表,用来构成select的语法规则,oracle保证dual里 ...
- Codechef October Challenge 2019 Division 1
Preface 这次CC难度较上两场升高了许多,后面两题都只能借着曲明姐姐和jz姐姐的仙气来做 值得一提的是原来的F大概需要大力分类讨论,结果我写了一大半题目就因为原题被ban了233 最后勉强涨了近 ...
- 大话设计模式Python实现-单例模式
单例模式(Singleton Pattern):保证类仅有一个实例,并提供一个访问它的全局访问点. 下面是单例模式的demo: #!/usr/bin/env python # -*- coding:u ...
- appium 使用name 定位报错 Locator Strategy 'name' is not supported for this session【appium-desktop】
RF中使用 name定位 报错提示: Locator Strategy 'name' is not supported for this session 解决: 1.打开本地文件 driver.js ...
- 易飞审核员调用DEMO-DELPHI
作用:我已在其他文章里提过.直接调用易飞审核员程序,易飞9全版本全模块通用. 亮点:错误直接返回错误信息,并非错误代码. 最全.最优的易飞审核员接口开发,支持个案审核员接口开发.有需要的联系本人. 唯 ...
- 关于ScriptManager.RegisterStartupScript 摘录
//ScriptManager.RegisterStartupScript 方法 (Control, Type, String, String, Boolean) public static void ...
- File操作,访问文件或目录的属性信息
package seday03; import java.io.File;//记得导入File /** * File的每一个实例用于表示文件系统中的一个文件或目录 * 使用File可以: * 1:访 ...
- DataGridView中实现点击单元格Cell动态添加自定义控件
场景 鼠标点击DataGridView的某个单元格时,此单元格添加一个自定义的控件,这里以 添加下拉框为例 效果 注: 博客主页: https://blog.csdn.net/badao_liuman ...