首页
社区
课程
招聘
[原创]amateursCTF[pwn/Easy Shellcoding]
发表于: 2025-11-21 19:38 2579

[原创]amateursCTF[pwn/Easy Shellcoding]

2025-11-21 19:38
2579

First we can see the chal.py that we got.

easy shellcoding was abusing the ljmp instruction to switch to x64 and then you can just win lol!!!!!!

template.elf: ELF 32-bit LSB executable, Intel 80386, invalid version (SYSV), statically linked, no section header

Only these 10 instructions are allowed: Key system call instructions such as syscall, int 0x80, call, ret, etc. are excluded. All jumps must target valid instruction boundaries. This prevents jumping to the middle of instructions to execute hidden code. The initial execution environment is in 32-bit mode. The shellcode length cannot exceed 4096 bytes.

During checking: The shellcode is inspected using a 32-bit disassembler (CS_MODE_32)

During execution: The same bytecode is executed after switching to 64-bit mode via ljmp.

we first create the  some routine operations first, put '/bin/sh' on the stack

we can know ```it = cs.disasm(shellcode, 0x1337000)``` it will begin at 0x1337000, and then we count the number of bytes used when preparing before, 0x27, do not forget the ```b"\xbc\x00\x70\x76\x06"```.

for sure we use ljmp to escape that check for x86

and now come to another point, To make the program perceive our instructions as legitimate, we need to use whitelisted instructions. However, how can we make it appear as a new instruction after switching to x64 mode? We therefore thought of using dec, which can be interpreted both as dec and as movabs when the context changes.

we can looook at this 


传播安全知识、拓宽行业人脉——看雪讲师团队等你加入!

最后于 2025-11-21 19:40 被H1m编辑 ,原因:
收藏
免费 1
支持
分享
最新回复 (1)
雪    币: 2635
活跃值: (10715)
能力值: (RANK:438 )
在线值:
发帖
回帖
粉丝
2
Thanks for sharing. This article has clever ideas, and I'm looking forward to more detailed and in-depth PWN analyses from the author.
2025-11-21 19:56
0
游客
登录 | 注册 方可回帖
返回