Swing'Blog 浮生若梦 Swing'Blog 浮生若梦
  • Home
  • |
  • About
  • |
  • Articles
  • |
  • RSS
  • |
  • Categories
  • |
  • Links

RWCTF-3rd JunkAV writeup

2021-01-11 Updated on 2026-02-11 Writeup

Table of Contents

  1. Details
  2. Exploit
  3. Reference
I made a challenge name JunkAV for RWCTF 3rd . This is an oob write vulnerability caused by a upx processing PE program. Congratulations to CodeR00t and 217 who solved it during the game.

Thank @leommxj for contributing to this challenge

Details

Vulnerability is in the PeFile::rebuildRelocs function of pefile.cpp in upx 3.96 .

When calling the unoptimizeReloc function

  1. The size of the relocn can be controlled by the user, so the allocation size can be controlled.
  2. The 1024-1033 guild will flip the data.
  3. When the data is flipped later, the jc variable on line 1021 becomes controllable, and finally the oob write is completed on line 1023

Exploit

  • generated upx compressed program :

    ​ http://bestwing.me/attachments/rwctf-3rd/JunkAV/gen_exploit_bin.py

  • ibuf_mod :

    ​ http://bestwing.me/attachments/rwctf-3rd/JunkAV/ibuf_mod

  • IO script:

    ​ http://bestwing.me/attachments/rwctf-3rd/JunkAV/exploit.py

Reference

https://landave.io/2020/11/bitdefender-upx-unpacking-featuring-ten-memory-corruptions/

分类: Writeup
标签: pwn
← Prev CVE-2021-3156 sudo heap-overflow 漏洞分析
Next → CVE-2020-15257 Docker 逃逸漏洞分析

Comments

© 2015 - 2026 Swing
Powered by Hexo Hexo Theme Bloom