Sunday, July 25, 2010

Microsoft Shortcut LNK Autoexecution Vulnerability

Microsoft Shortcut LNK Autoexecution Vulnerability

This is a new USB infection vector using LNK (shortuct) vulnerability on ALL Windows platform.

The interesting thing of this vulnearbility is that you no longer need AutoPlay enabled but you still can run the specified program ;) See the demo below.

Before we proceed, lets see the LNK file format which is the culprit:

Starting from the GREEN region, that is SHELL_ITEM_LIST which is documented in MSDN. The file location is defined after SHITEMID structure.Notice that the shell CLSID for My Computer & Control Panel in GREEN region:

My Computer: {20d04fe0-3aea-1069-a2d8-08002b30309d}
Control Panel: {21ec2o2o-3aea-1o69-a2dd-08002b30309d}

These shells are defined so that it will be handled by shell32.dll which is the caused of autoexecution. For more technical information on how autoexecution happened, there is a nice debug screenshot from ivanlef0u who is the first person posted this exploit publicly ;) Check this out:

Microsoft's workaround on this 0-day vulnearbility:

Demo Video

This demo is a simple one and mostly based on ivanlef0u's one with some minor modification. The dll is simple enough which I include the source code in the attachment section. Have fun :)


Executable files: Bin
Simple DLL & LNK file: Src


[1] -- Microsoft Advisory CVE-2010-2568

[2] -- Shorcut LNK File Format

[3] -- SHITEMID Structure

[4] -- Symantec Stuxnet Technical Info - Part I
[5] -- Symantec Stuxnet Technical Info - Part II 

[6] -- F-Secure Stuxnet Description

Signing off @x9090


Anonymous said...

This is a nice project and example. Question, how do you compile your sample code? thank you!

x9090 said...


Thanks for the comment.

I would rather answer your question here together with the one you sent to my email so that other would see how to do that.

> To compile the source code
This is simple, you only need any c/c++ compiler. I used Visual Studio 2008 but you can use the free one like MinGW, Dev-C++ and etc

> To rename dll to something
> else.. will i have to change
> anything in the LNK file
Yes, you need to customize the LNK file in this case either from the sample LNK file that I provided or you can create your own. There are complete documentation about LNK file format beside the one I provided.

Good luck!

Signing off

Luke said...

I am having an issue compiling your code. I have Microsoft Visual C++ 2010 and it wont let me open your project. When I try to copy and paste your code over it doesnt work. Am I missing something?

x9090 said...

Hi Luke,

It would be helpful if you could show me the error message you got.

Signing off