当前位置:网站首页>[BMZCTF-pwn] 12-csaw-ctf-2016-quals hungman
[BMZCTF-pwn] 12-csaw-ctf-2016-quals hungman
2022-07-06 10:43:00 【Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi】
Guess this question or 2.23 ( I'm not going to do it , None of the above questions has a remote environment , And these seem to have been done )
This is a silly word game. The data structure is like this :
- chunk0 Write the largest name you enter 0xf8( It can be small )
- Program record :4 Byte record ,4 Byte name length ,8 Byte name chunk0 The pointer to
- A random number as long as its name
Enter your name first , Then line it into random numbers , Then wait for characters , If there is the same score , altogether 26 How can it be the same if you lose all , When the maximum record is exceeded, the name can be modified ( There is an overflow )
puts("High score! change name?");
__isoc99_scanf(" %c", &v3);
if ( v3 == 121 )
{
s = malloc(0xF8uLL);
memset(s, 0, 0xF8uLL);
v8 = read(0, s, 0xF8uLL);
*(_DWORD *)(a1 + 4) = v8;
v14 = strchr((const char *)s, 10);
if ( v14 )
*v14 = 0;
memcpy(*(void **)(a1 + 8), s, v8); // Name length is less than F8 when , You can enter F8 Overflow to record
free(s);
It's easy to control the overflow to the pointer
Overflow first, write the pointer as got An address of the table , The following output will output the value , So you get libc Address .
The question is which to write , According to the later function call, you can use snprintf and strchr, After looking at the original one, I used libc_start_main
strchr Just use it here once , Let's start with the leak libc Change it to system, Enter next time /bin/sh
Write libc_start_main Then there is gmon_start and memcpy Write here /bin/sh\0,0,system In fact, it uses system cover memcpy In execution memcpy The inner parameter is exactly /bin/sh( This is a coincidence )
If you use snprintf You can also restore the whole got Watch then turn /bin/sh writes 602100
printf Words , Didn't try to write one_gadget Maybe it's ok
边栏推荐
- What is the difference between TCP and UDP?
- Use JUnit unit test & transaction usage
- 基于Pytorch的LSTM实战160万条评论情感分类
- Emotional classification of 1.6 million comments on LSTM based on pytoch
- API learning of OpenGL (2002) smooth flat of glsl
- Global and Chinese market of operational amplifier 2022-2028: Research Report on technology, participants, trends, market size and share
- [programmers' English growth path] English learning serial one (verb general tense)
- A necessary soft skill for Software Test Engineers: structured thinking
- Mysql27 - Optimisation des index et des requêtes
- MySQL底层的逻辑架构
猜你喜欢

Security design verification of API interface: ticket, signature, timestamp

Navicat 导出表生成PDM文件

Complete web login process through filter

Nanny hand-in-hand teaches you to write Gobang in C language

Mysql22 logical architecture

基于Pytorch肺部感染识别案例(采用ResNet网络结构)

C language advanced pointer Full Version (array pointer, pointer array discrimination, function pointer)

Mysql21 - gestion des utilisateurs et des droits

MySQL18-MySQL8其它新特性

CSDN问答模块标题推荐任务(一) —— 基本框架的搭建
随机推荐
Pytorch RNN actual combat case_ MNIST handwriting font recognition
Super detailed steps for pushing wechat official account H5 messages
Typescript入门教程(B站黑马程序员)
Opencv uses freetype to display Chinese
MySQL flush operation
@controller,@service,@repository,@component区别
MySQL26-性能分析工具的使用
Windchill配置远程Oracle数据库连接
ByteTrack: Multi-Object Tracking by Associating Every Detection Box 论文阅读笔记()
导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
Time complexity (see which sentence is executed the most times)
Copy constructor template and copy assignment operator template
text 文本数据增强方法 data argumentation
Timestamp with implicit default value is deprecated error in MySQL 5.6
Super detailed steps to implement Wechat public number H5 Message push
Valentine's Day is coming, are you still worried about eating dog food? Teach you to make a confession wall hand in hand. Express your love to the person you want
数据库中间件_Mycat总结
MySQL27-索引優化與查詢優化
Solve the problem of remote connection to MySQL under Linux in Windows
C language advanced pointer Full Version (array pointer, pointer array discrimination, function pointer)