Discussion Locked

ANS.1 Windows Vulnerability Released

0 helpful
20 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Ok, I am a little freaked out by this one. The more I read about it (and so far, that isn't a lot, but I'm still looking around), the more concerned I become.

This is for Microsoft Security Bulletin MS04-007, "ASN.1 Vulnerability Could Allow Code Execution (828028)"

First off, here is the Technet article on this, with links to get the patch:
http://tinyurl.com/24z6m

Ok, when you read this, it is listed as a Critical problem, and all Windows NT kernel OS's need to be patched now. The standard buzzwords -- buffer overflow, security vulnerability, execute code with system privileges, etc -- are all there. But, is it me, or does this one seem to be lacking in some of the detail that other articles have had. It is just a feeling here, that this new article is really glossing over the surface here.

Now, go to the eEye site, the very smart guys who found it, and you can read their 2 advisories on this:
http://www.eeye.com/html/

I have had personal dealings with a couple of the guys at the eEye, and I know they know their stuff! You can read some of the code syntax to perform this exploit. I personally think they may have provided TOO much information!

Anyway, then there is the Bugtraq thread on this:
http://tinyurl.com/3b73s

The 2nd post by Marc Maiffret, the Chief Hacking Officer from the eEye, states the following:
"For example we setup a totally IPSEC secured network and we broke into that network via our ASN bug which is called by the Kerberos. We also
have written exploits that take advantage of ASN via NTLMv2 authentication. And the list goes on... How about evil ASN SSL CERTs? Client or server? There is a menu a mile long for the avenues of attacks that this thing can be used for."

How did they compromise an IPSec-secured network with this??

Am I overly worried here, or is this one potentially destructive? Read up on this. I think this is gonna be bad.

20 replies

by joseph moore

So, I just spent the past couple of hours experimenting with this. I've been running
FILEMON, the file process usage utility from Sysinternals. This tool tells you what files
are accessed by other files. Very useful little tool to have. You can see exactly what
files are access by applications, including DLLs.

I started up my XP Pro laptop, and started monitoring it with FILEMON. I ran a filter,
just looking for MSASN1.DLL, which is the file with the problem that the eEye exploited
for this.

And boy howdy! Here is what I found.

In the Microsoft and eEye articles on this, they state that Internet Explorer, Outlook, and Outlook Express all call this file, so they could, in theory, all can be used as attack vectors. From my own testing, this is true. When you start up those programs, they ALL call MSASN1.DLL.

So, if a virus was sent via e-mail, then it could trigger this exploit. I can see that.

For example, I had IE open, then I opened a 2nd instance of IE, and the MSASN1.DLL file was called again. It looks like if multiple instances of IE are opened, then this file gets called multiple times.

Therefore, could someone make one of those "malformed URLs" to trigger this? Click the link on a webpage, and WHAMMO!!!???

MSN Messenger called the file when I started it; actually, when OE opened, it started MSN Mesenger (msmsgs.exe), which called the DLL. I did not chat with anyone to see if the file was called again after start, so I don't know if MSN Messenger uses it after you start it. But it did call it.

Our friend, SVCHOST.EXE, called the file a lot! This explains the port 139 and 445 references in the eEye notices. I was not able to test inbound port 139/445 functionality, though. But, since the Windows File and Print Sharing is ran by SVCHOST, that is probably why the eEye listed it. Also, other apps that use SVCHOST.EXE only listed the SVCHOST calling the DLL file, like MMC snap-ins. So, the snap-ins did not register a hit for themselves, just in SVCHOST.

I wonder, therefore, if RCP (port 135) could also be vulnerable, but I didn't try and test that functionality.

Other stuff I found that I have not seen listed anywhere so far:

WMIPRVSE.EXE called the file. This file is used by XP and Win2K3 to handle the WMI functionality (Windows Management Instrumentation, I believe). I ran into this one just by running TASKLIST.EXE, which uses WMI to work. It would be interesting to see on a Win2K box (which runs all WMI processes under the WINMGMT.EXE process only; XP now breaks them out into the 2 processes). So, since TASKLIST, which is a WMI process, caused WMIPRVSE.EXE to call the DLL, then I guess other WMI process/functions would do the same on XP and Win2K3. This worries me. What if the virus was in WMI script, and transmitted and ran on a target system. WMI script can be ran against remote machines that support WMI! So, you would not need to have the virus file physically on the machine. It could be a Blaster-type virus/worm them that used WMI to infect and propagate!

Also, when I ran .VBS scripts, my XP machine is set to run them under CSCRIPT.EXE, the default VP interpreter. Yes, CSCRIPT.EXE called the DLL. So, a .VBS file could also cause this exploit to happen (if they use CSCRIPT.EXE to run under), and VBS files can also be ran against remote targets.

The Bliss screensaver for XP, which you can get from the Microsoft website, called the file (BLISS.SCR). Really! A screen saver file! This was the only one I had that did that.

One that tripped me out was IPCONFIG.EXE! Yep! Do an IPCONFIG, and it will actually call this DLL file! Why, I don't want to figure out why, but it did every time for me.

Now, a few non-Windows apps. First, there was Real One Player! One of its processes is "realsched.exe" which is the process that can always run and give you those annoying popups every once in a while when there is a new news notice from the Real company. You know, those obnoxious little popup windows that says to upgrade Real One to a new version, or there is some new content for the Real ONe Player. Well, "realsched.exe" calls "realevent.exe", which calls this DLL. So, if Real One Player loads, these two EXE files are loaded, which calls the DLL. So, it seems then that if someone sent a file that caused Real One Player to load, it could trigger this exploit!

Symantec Antivirus Corporate Edition 8.0 client did not call the DLL, but when I opened the Symante LiveUpdate applet in the Control Panel, that did call it (from LUCOMS~1.exe). So, LiveUpdate needs the DLL, and I guess could, in some way, help spread the exploit. I have the latest LiveUpdate installed (Symantec just updated it in January 2004).

And one that might not be anything to worry about is ZoneAlarm. My copy of ZA had a single hit for the DLL. The info column reads "FileBothDirectoryInformation: MSASN1.DLL" for ZAPRO.EXE, which is ZoneAlarm. Now, I am not sure if the DLL tried to access the Internet, and ZA recorded just this one file access, or what exactly. I did not see any other ZA hits for the file, but I only ran ZA for about 5 minutes. So, I am not sure if this is important or not. Interesting, though.

Lastly, Ad-aware hit the DLL file when I did a system scan, but I think it was only CHECKING the file to see if it had been replaced by a spyware file.

So, that is all I found. Some things I tried that did not call the DLL file surprised me. I could not get IE to hit the DLL file when I went to SSL-secured web pages. Windows Media Player (with protected content .WMV files) did not call it, nor did Winamp5. No Office 2000 products (other than Outlook) triggered the DLL. Quicktime player was safe. Lotus Notes client did not call the DLL. Quicken 2002 was good! Citrix ICA client was clean.

Now, this is by no means any type of scientific list. I just ran FILEMON for a couple of hours and opened everything I could think of, and just read through the file list. Other people should look into this, and see what they get. There are a lot of programs out there that I don't have, that others do, and we should see what calls this file and what doesn't.

I did all this tonight, because I am really worried about this. The notices said that if something calls MSASN1.DLL, then it can be used to exploit MSASN1.DLL with a buffer overflow, which could then let the attacker do whatever they want (ala Blaster). But with this one, there isn't just one port that could be attacked. Multiple ways of doing this, with multiple applications that can be attacked. Different scripting types. The articles do mention that SSL can be used to attack (in theory).

To me, this one seems to be worse IN THEORY then Blaster's attack.

I am testing the patch out on a few machines Wednesday, just to make sure it is a good patch. I plan on getting my DMZ machines on with the patch on Friday, then other machines the following week. It will probably take a while before the virus/worm is released to attack this one. Blaster took 3 weeks to hit, from patch release to virus release. I am hoping for a similar timeframe on this.

Just wanted to post this to let everyone know. It's past 1AM now. Time to call it a day.

One last thing: I am not a programmer. Keep this in mind. But I like to think I know a few things on how Windows works!

by joseph moore

Ok, I thought about this last night (didn't sleep well, due to this new problem), and I realized that Real One Player is probably safe. Since REALPLAY.EXE is the application that is launched when you start Real One Player, and that exe calls REALSCHED.EXE, which then calls REALEVENT.EXE (which is the app that calls the DLL with the problem), then I really don't think a "malformed" Real Audio file could trigger an exploit. I was afraid a .RAM file could pass the buffer overflow to REALEVENT.EXE (which would send it to the DLL, which would trigger the exploit), but I don't think that is possible.
Since there is no direct link to REALEVENT.EXE from REALPLAY.EXE, how could a bad .RAM file exploit this? I can't see how.
Am I visualizing this incorrectly, or what? What do you all think?

by voldar

Although I found this .dll in two places under a W2K Pro system, and in one place under W2K Server system, when I tryed to make the same thing you did (use filemon.exe and then check for this specified dll using filters) guess what? IE did not use this dll, nor Outlook Express or Outlook.
Strange, or ... what?
I have Service Pack 4 installed, and I don't have the last updates. Anyway, I will check further more.

by voldar

I think you are right, after starting Ad-Aware I found an entry record about this DLL, but I don't think is more than you suspect. I have a "system8: IRP_MJ_CLOSE c:\winnt\servicepacks\i386\msasn1.dll" record. And that's all I have.

by maxwell edison

.
This is some great information, Joseph. Thanks for posting it. You're always right on top of these Windows security issues.

By the way, it's interesting that there are so few replies to this. Perhaps if the title of the thread was, "George Bush Caused Windows Security Problem", it would generate more interest.

by joseph moore

Max, I was wondering about that, why the lack of notice on this.
I am worried about this one. I've seen a post by the guys from F-Secure, saying not to freak out on this. Well, sorry, but I specialize in freaking out!
I'm worried. Really.

by guruofdos

I looked for the dll and found 3 copies on my XP Pro system. Just for gag value, I renamed them all to msasn1.bak and guess what...

I rebooted the computer...and it made no difference!!! IE still works, OE still works, Office still works, Winamp, WMP and everything still works. No problems, no errors, no nothing!

So....rename it and no problems!! When Microsoft actually TELL us what the DLL is for, mebbe I'll rename it back again!

by guruofdos

I looked for the dll and found 3 copies on my XP Pro system. Just for gag value, I renamed them all to msasn1.bak and guess what...

I rebooted the computer...and it made no difference!!! IE still works, OE still works, Office still works, Winamp, WMP and everything still works. No problems, no errors, no nothing!

So....rename it and no problems!! When Microsoft actually TELL us what the DLL is for, mebbe I'll rename it back again!

by joseph moore

Hmm. Interesting. SFC did not restore the file when you rebooted? Interesting.
Later tonight, I will try that myself, and I'll run FILEMON and see what it reports.
Good idea, GuruOfDos!

by guruofdos

No. I have that sevice turned off!! I only ever run it as a manual command from the cmd prompt. I myself 'tweak' system files (I AM a programmer!!) and am a firm believer that half the so-called critical system files are just redundant bloatware. What do half these DLL's actually DO?!!

I run a suite of program called WLCHECK and WFNCHECK from Karrisoft, which traces calls to and from DLL's. It not only shows calls and dependencies, but enumerates actual functions within the dlls too. Almost a quarter of the windows\system folder can actually be deleted without making a blind bit of difference.

I found this as a result of getting involved with Internet Exploder...a project to entirely remove IE from Windows 98SE, leaving a very compact OS only requiring 48Mb of disk space. When building stand-alone simulators, you don't NEED or WANT a browser!!! It also comes in handy for adding 'third party' functions to VB or VC++ programs!!

by joseph moore

So, someone illegally release some of the source code for Win2K.
I found a couple different places with a list of the files (not the files themselves, just a DIR listing of what is available).
I went over it, looking for the MSASN1 file, or some reference to it. My fear, when I heard that the source was out, was that the source to make this DLL with the big problem would be in the list. With the source, then the evil hackers out there could examine it, and find the problem in no time at all.

Here are some things I can tell from the DIR list:

Task Manager is there. The source for it is.
Also, Device Manager snap-in is there.

A bunch of stuff under the heading /windows/shell/security is there. That worries me.

RUNDLL32 is there.

Regedit is there.

Progman, the old Program Manager, is there.

Solitaire is there!

EFS is there, the encrypting file system.

There is just a lot there. Way too much to keep mentioning. Now, I really want to know is if the source code for NSANS1.DLL is there, the bad DLL! I did not see NSANS1 listed specifically, nor could I find ANS.1 or anything similar. But, there is the GINA, and WINLOGON are there. Plus, one that does look bad, is a NTCRYPTO heading.
I think that that could be it.
There is a file called "des_key.h" that is probably not good to have available!

You know, I have to stop looking at this.

by joseph moore

Ok, so I didn't stop looking at the file list.
If I read this right, the certificates from the CA, like from Verisign, Entrust, Thawte, RSA, they are all in there, .CER files.
Now, I still don't really understand public/private key structure very well, but isn't there a copy of the private key included with Windows, so a public key issued from Verisign (for example) and put as SSL on a website matches up with the private key installed?
So, would these .CER files I am seeing in the file list be the private keys?

Isn't this REALLY bad????

by guruofdos

I think personally that this is potentially causing as big a scare as the Y2K issue. And what happened then? Not much! The world did NOT end. Life as we know it continued completely uninterrupted!

Every day I get countless emails warning me that some security issue or other is about to ruin my day. Some hole or other in some programme had been exploited and my computer and network WILL be targeted. In fact, I subscribe to Symantec Security alerts and Trend Micro's newsletter, so when something really nasty is out there, I like to know about it.

In my experience, and that of many other people I deal with, most of these alerts are simply scare stories. That is not to say I don't worry about security. I do, and as SysAdmin for the entire IT infrastructure at work I have to be on top of anything which could conceivably compromise our systems. I could spend all my time chasing up security risks and trying to find fixes, but then I wouldn't get any REAL work done.

I fail to understand why so many 'big businesses' are brought to their knees by security exploit issues or virii like MSBlaster. They employ vast numbers people in IT departments to prevent such things happening and they still get hit. Me, I'm an electronics engineer. I head up R&D, Production and Field Service as well as assist Sales and Marketing and I'm the only person in the company who looks after IT. My time spent on the IT infrastructure is minimal and the percentage of time spent dealing with security issues can be measured in minutes a week rather than hours.

Driving in to work this morning, a news radio show had a feature about the Windows Source Code being publicly available. It has been for a very long time! It's only just been publicised! A spokesman from ZDNet was hyping this up to be the biggest 'disaster' since 9-11.

I for one will believe it when it happens...and I don't think it will happen. At least not to the extent that some people are trying to make out.

by maxwell edison

.
I'm not a Windows source code expert by any stretch of the imagination, so my ignorance in that regard can be blamed for, what might be, a very stupid question. If, on one hand, it's a bad thing for the Windows source code to become public information, which I think it probably is, but on the other hand Microsoft is always accused of being a monopoly because they won't share their source code, another bad thing (or so "they" say), what's a respectable software vendor to do? It seems like it's a lose-lose situation. Moreover, it seems like it would have been only a matter of time before it did finally get out, which it now apparently has, as most "secrets" eventually do (Except for the proof of extraterrestrials, of course). And doesn't this illustrate a flaw in the "open-source" software movement? What am I missing here?

by voldar

is out of this post, but I want just to mention the following: Last year Microsoft "bought" (i use quotes because I don't know what was really happening, but what I know is that the product is not on sale anymore) a Romanian company product called RAV Antivirus, made by GECAD Software. What was a sign to me about this move, is the fact that, even though RAV for Windows is a good product, RAV for Linux was the best product I ever use, and I start asking myself "in what purpose?". It seams useless to mention that most of the web/mail machines were based on linux in Romania, even if the whole other network servers were based on W2K (seeing the price for an ISA server product).
So, my thought is that in a few years we'll have a new product, maybe "open-source", with an antivirus integrated. And that, I will like to see.

by joseph moore

OK, I was just too tired last night when I went over the file list of the accidentally released Win2K source code. I missed a few things.
In the private\ispu\pkitrust\wintrust directory of the released source code, there are three files that worry me:
wtasn.asn
wtasn.c
wtasn.h

I found a contact online who has found the source code, and has politely answered a few questions about it I have sent him. He has written me that these files do indicate that they are "ASN.1 definitions for Indirect data contents"
Now, this is bad. THIS is what I was stressing out about Thursday night.
My total guess, based off what my contact has sent me, is that these files are the ASN.1 functionality source code in Windows, that has just been patched by Microsoft Security Bulletin MS04-007.
Great.... Just great....I don't know if I can handle much more of this....

by voldar

I forgot to mention: I have service pack 4 on my W2K Pro machine. As the eEye states in his document about "Microsoft ASN.1 Library Length Overflow Heap Corruption", the W2K systems affected are SP3 and below.

by joseph moore

The French site k-otik has a proof-of-concept exploit code that uses the ASN.1 vulnerability to trigger a shutdown of Windows.
It does an overflow in LSASS.EXE which causes it to shutdown.
AND when that happens, you get the 60 second shutdown timer that people saw with Blaster hittting RPC.

Here is what LSASS.EXE does:

Process File: lsass or lsass.exe
Process Name: Local Security Authority Service
Description: Windows Local Security Authority Server Process handles Windows security mechanisms. It verifies the validity of user logons to your computer or server. Technically, the software generates the process that is responsible for authenticating users for the Winlogon service.

"Windows security mechanisms" and that involves the DLL, MSASN1.DLL. So, this code triggers the DLL, which causes LSASS.EXE to crash, which shuts down your Windows box.
And remember this should work on NT/2K/XP/2K3.

I read a discussion thread on this code. It is said to work on TCP port 139 and 445. Plus, there is apparently room in the code to insert extra commands to run on the target system.

Great. Just great.

Hope everyone is patched.

by lesdabney67

http://www.microsoft.com/technet/treeview/?url=/technet/security/bulletin/MS04-007.asp

This is all Bush's fault of course.

This discussion is closed to new replies.