Defeating XP SP2 Heap Protection
hobo2k writes "XP SP2 included canary values and hardware-implemented execution protection in order to avoid exploitable buffer overruns. Now Positive Technologies has released an article describing one way that protection could be bypassed. To solve the problem, they provide a program which disables the small allocation heap as described here. CNET reports that SP2 has been foiled."
surprises anyone?
The higher the technology, the sharper that two-edged sword.
firefox
forst porsts.
fr0st p1ss
Exploit Of The Day
i wonder if Nick McGrath is eating a nice hot plate of crow right about now...
Now Positive Technologies has released an article describing one way that protection could be bypassed.
A security problem in Windows? no way...
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Protection? What protection?
Microsoft and security?
Chalk and cheese?
http://www.vorck.com/remove-ie.htmlm sfn.org/nlite.html
http://nuhi.
C'mon, this has been known for a while ;)
Error 407 - No creative sig found
should bugs or exploits in windows still be frontpagenews ?
Welcome to TrollDot.
Now we're trying to crash it? Isn't that, like, four steps forward for Windows?
vicious, untreated political sewage...niche entertainment for the spiritually unattractive...worshipless pap
XP SP2 included canary values and hardware-implemented execution protection in order to avoid exploitable buffer overruns.
;-). Software and hardware implementations differ in that software is executed sequential, while hardware executes concurrently.
Gosh, every day I learn something new on Slashdot
StefanoB
-- com'along, let's go womanizing (Mr. Burns needs a chick)
I read the .PDF pretty carefully, but I still don't understand how DEP (data execution protection via the NX bit in the page tables) fails to prevent this exploit. The 1016 bytes of memory is on the heap, isn't it? So how is any code you put there going to be executed?
Netcraft confirms it, it's official
All your Sybase are belong to us.
Slightly unrelated: What about NX under Linux on the amd64 architecture. Anyone know if/when it is supported?
Get your own free personal location tracker
Is that link that says 'here' to microsoft.com correct? It points to something for Windows NT4.0 w/SP4
"Published 28th January 2005."
And
"In October 2004 it was discovered by MaxPatrol team that it is possible to defeat Microsoft® Windows® XP SP2 Heap protection and Data Execution Prevention mechanism."
This is too much time to fix something. I can agree with some delayed disclosure but not anything above a month.
It takes a man to suffer ignorance and smile
Be yourself no matter what they say
Is it just me or is relying on hardware to protect your application heaps seem to be a bad idea. Not just because its non-portable (not that this matters for windows) but it basically offloads the work on HW that may or may not be up to the task.
We know that unix, its variants and progeny, have memory protection. How many of these rely on the hardware to protect them? Certainly 'legacy' *nixes didnt run on HW that had these features.
I guess what im saying is i dont like it as a long term strategy.
T.J. Schmitz - the man, the myth, the legend - o
I've never though of why my Windows with *all* patches and a positive Microsoft Windows Baseline Security Analyzer check doesn't produce those annoying "are you sure" questions. Can't say that I miss them though because I know my system is up to date :)
I wonder what Nick McGrath's opinion on this is, and who is HE holding accountable?
at which time company Chairman Bill Gates called the update "a significant step in delivering on our goal to help customers make their PCs better isolated and more resilient in the face of increasingly sophisticated attacks."
;-( ) it was referred too as "unpredicted", not actually "sophisticated"!
The increasingly sophisticated attacks just threw me over the edge! It sounds so much like a Big Brother representative would sound when informing the world of a successful (real) attack, and even in the last time it happened (9/11
Do not you think it is appropriate for Bill a) not to use anti-terrorism language and b) remember that buffer-overflow attacks were in the books, when, like 1969? (AFAIR, Morrisson's warm used that).
Paul B.
Perhaps Nick McGrath was misquoted he was actually saying "Windows security is highly exaggerated"
Hey look no pointless curley braces or semicolons... just like Python
When asked about the problem Steve Ballmer said that Linux sucks.
CNET reports that SP2 has been foiled.
Shouldn't that read tin-foiled? C'mon, slashdot, standards?
All the attacker has to do is set the evil bit, and it overrides NX.
www.apple.com/switch :)
...probably Nick McGrath ;o)
...Rob
The American Dream isn't an SUV and a house in the suburbs; it's Don't Tread On Me.
Linux is not invulnerable to this type of problem either. Hell, does Linux even have executable stack protection AT ALL?
It's time for linux fags to come out yapping. I guess they're probably done jerking off to the earlier GPL article.
Windows XP Service Pack 2 has only 1 problem (for me) beyond those of regular XP.
My celphone can no longer be used as a cerial divice, aka; Dialup modem.
Yes, The same hardware works on Linux (Dell Inspiron 8200, Sony Erricson T220 on a USB cable) and removing the pack got it working in Windows again.
--= Isn't it surprising how badly I spell ?
When Are they going to blame them?
When will they bother to fix this?Place bets NOW
is itA: Hackers, right away
B: Hackers, from the Open Source community, when they make something better than them (Eg Someone failing asleep on there keyboard)C: Themselves (Odds at 1 to 10^67^687^3945^Pi for this)
"I may be full of crap about this game, and I may be wrong, and that's fine." -Jack Thompson
Just curious exactly where, though Microsoft's guys have said things like this a lot.
That said, I can't wait for NX flags and other hardware measures to go mainstream. Unless you have a hardware firewall (or Linux?) software like Windows can still be teh flimsy, though in SP2 I have seen VERY few 0xC0000005 errors or STOP bluescreens. (But that's just my eXPerience(TM) with XP(TM).)
BTW, if you dont like adware, don't go to just-free-games.com; their "freeware" games use Gator et al. to pay their bills.
You can hold down the "B" button for continuous firing.
Heap protection has been broken virtually everytime it has been implemented. The reason for this is, you still have system libraries from which have execution powers that can still be used for writing shellcode.
The patch may be quick. It will still take a long time to deploy.
Anyway you have to wonder about this kind of technical oversight. If you are implementing an NX heap, you obviously need to NX the WHOLE heap for it to be useful.
Basically it looks like Microsoft is incapable of secure development at the core OS layer. I find that absolutely mind boggling given their resources.
I don't think Windows users should lose too much sleep over this. How is an exploit supposed to unprotect the heap segment in order to execute the buffer overrun code -- before such code has been executed?
This is probably a good thing, because it proves that even with stackguarding, etc.. Treating your system as if they dont exist is the best thing you can do. Microsoft unfortunately chooses to use stackguarding as a first line of defence to allow them to take their time patching software, which is a terrible idea.
So basically, nothing has changed in the security world in the past year. The only thing is that the attitude of programmers have in some cases, become slacker because of technologies like this, believing they can get away with it now.
If you ask me though personally, I'm betting Microsoft didn't run major tests on the security of DEP anyway, only simpler ones
http://shit.slashdot.org/article.pl?sid=05/01/29/2 038207
I did blog on another way using only a stack overflow on my blog. My way was more "all existing exploits work as-is after just a little extra step" than "exploits still exist that get around DEP" though.
My way was to just slap DEP in the face by using a ret2libc with a constructed stack frame that gave the shellcode a nice, clean, executable area of memory to execute in, then copied the memory there, then returned to it. This is done by 1) Return to VirtualAlloc(), 2) Return to memcpy(), 3) return to shellcode.
They noticed this in October; it took me until January and I'm not a security expert.
Support my political activism on Patreon.
You even mentioned non-portability as an argument. Yours ranks among the stupidest posts I have seen in a long time.
... the juicy bits are here. Scroll down to the bottom for the appendices where there are C code examples on how to bypass these measures.
Beware: In C++, your friends can see your privates!
Since MS claims Linux companies can't be held responsible for Linux security, will MS claim responsibility for this?
I'd rather have someone respond than be modded up.
Plowing for several large companies, I'd always done my work on Windows. Recently however, a top online investment firm asked us to do some work using FreedBSD. The concept of having access to source code was very appealing to us, as we'd be able to modify the kernel to meet our exacting standards which we're unable to do with Microsoft's products.
Although we met several fertilization challenges along the way (specifically, FreedBSD's lack of Token Ring support and the fact that we were unable to defrag its ext2 file system), all in all the process went smoothly. Everyone was very pleased with FreedBSD, and we were considering using it for a great deal of future internal projects.
So you can imagine our suprise when we were informed by a labourer that we would be required to publish our source code for others to use. It was brought to our attention that FreedBSD is copyrighted under something called the GPL, or the GNU Preventive License. Part of this license states that any changes to the seed are to be made freely available. Unfortunately for us, this meant that the great deal of time and money we spent "touching up" FreedBSD to work for this investment firm would now be available at no cost to our competitors.
Furthermore, after reviewing this GPL our labourers advised us that any products compiled with GPL'ed tools - such as gcc - would also have to its source code released. This was simply unacceptable.
Although we had planned for no one outside of this company to ever use, let alone see the source code, we were now put in a difficult position. We could either give away our hard work, or come up with another solution. Although it was tought to do, there really was no option: We had to rewrite the code, from scratch, for Windows 2000.
I think the biggest thing keeping FreedBSD from being truly competitive with Microsoft is this GPL. Its mercurial requirements virtually guarentee that no business will ever be able to use it. After my experience with FreedBSD, I won't be recommending it to any of my associates. I may reconsider if FreedBSD switches its license to something a little more fair, such as Microsoft's "Shared Source". Until then its attempts to socialize the software market will insure it remains only a bit player.
I welcome you for your time.
This would be an excellent time for a re-hash of another article posted just today
/ 1511218&tid=109&tid=172&tid=106
http://linux.slashdot.org/article.pl?sid=05/01/29
Tired of bullshit Slashdot comments? Browse at +3!
And no one would ever see your posts.
Well Laaa-Deee-Daaa, "Netcraft confirms it" you say. Is that one of your Linsux companies? If you didn't hear it from us, then it's not official.
Steve Ballmer
"I did blog"?
Okay worm, you owe it to us to conjugate blog.
Now!
Err... Anyone else notice something funny here?
During the first execution this program shows the list of applications which already have this flag set.
I have DEP set to protect "essential Windows programs and services only"...
Yet, running this util, the list of programs looks nothing like a list of "essential" Windows programs. In fact, I honestly don't recognize any of the programs listed, and I say that as someone that knows what a normal Windows XP SP2 install "should" have running, even down to the device-driver level.
So what gives? Has Microsoft pulled the DRM-wool over us all in the form of DEP, and it has nothing to do with "security" at all? Okay, call me paranoid, but, something looks not quite right here (and I don't even mean the possibility of an exploit, I mean the uses of DEP itself, working or not).
...doesn't the processor need to support NX for the XP PS2 protection mechanism to work as it was intended? Until that time, this is a feature that can't be fully utilized.
So Windows could be exploited by this but how does Linux not get hit by this. My memory on os design and assembly programming isn't what it use to be, especialy since I do mostly web apps these days and avoid lower level things like the plauge.
What does Linux have in the way of heap protection? The NX bit is on AMD 64 and Itanium chips only (as far as I remember), so what's to stop this from working on any x86 based OS?
On a sidenote, I've always wondered how Linux protects, or doesn't protect, it's exception and interup handlers. After briefly dabbleing in User Mode Linux I've had this sinking feeling that my box never could be secure from this sort of attack.
Linux is really boring from an os standpoint. Now Plan 9......
I suppose that the real merit is not how to defeat it, but how fix it, maybe the article should have been titled "Fixing the XP SP2 Heap Protection",
Okay, so in order to disable the heap protection either the user has to execute arbitrary code while running under the context of a user with sufficient permissions, or be enticed to follow a fairly obscure set of instructions to edit the registry.
How the shit is this a vulnerability exactly? The only way to exploit it is to have already 0wned the machine so there would be no need to disable memory protection at any scope.
Also, as mentioned, this doesn't work correctly on hardware that supports NX. There is no pure software method to carry out NX and all existing measures, such as DEP, can be defeated through complex means. Microsoft makes no claims to the methodology being 100% secure, but it will help stop 60% of buffer overrun scenarios which account for the vast majority of said vulnerabilities. But that is the only way to carry it out in code without imposing huge amounts of overhead, which would still be defeatable without hardware support. Developers practically have to go out of their way in order to embed such vulnerabilities. These proofs of concept are irrelevant; they are not representative of the forms of vulnerabilities accidentally introduced into software.
In other words, another non-story from the shit-eaters at Snatchrot.
Let's see:
Thanks, my computer works too.
This might have been an argument against PC's with Windows a few years ago, but not so much now. I won't even mention Linux, of course.
Wou grate!!!11!!!
This one really turns me on too...
Maybe they could stop repeating themselves... BTW, the best programs to produce music and multimedia content exist for PC too, and the quantity of plugins is much greater on the PC.
On this section they say:
Consider this: Can your PC laptop go coast to coast with just one battery? Can you put the system to sleep just by closing the lid? Does it wake up instantly? Can your PC laptop automatically switch between Ethernet, dial-up and wireless connections on the fly? Without a restart? Ours can.
Yep, my PC can do all that too...
Fact is, most of our customers are up-and-surfing within 15 minutes.
I can do that easily too. So maybe this would only be valid for people who know nothing about computers. Even then, I doubt it's much easier to configure an internet connection than in a PC in most cases. Prove me wrong.
OK, so this section tells me that some of the programs I use on the PC are also available for the MAC. This is hardly a reason for me to switch.
See previous answer.
11- Fuck That.
The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
Please do not compare Linux to murder; it only makes conservative organizations buy products from a convicted monopolist. Please do not compare viruses to children if doing so makes you compare Linux to murder.
Press up, up, down, down, left, right, left, right, B, A, B, A, START in succession to disable the NX protection.
The support the NX bit where it's available. However, many CPUs don't support that. In those cases stackguarding is the only thing that they can do.
Using Knoppix to have a go that C:boot is the go - DEP is optional.
/fastdetect /NoExecute=AlwaysOff
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=" Windows XP Unprofessional"
That's okay; we planned to release this version to those owning the pirated version of XP anyway. Next question.
He compared it to the morning after pill. The morning after pill doesn't "abort" anything -- it simply causes the egg to fail to implant itself in the uterus. This is EXACTLY what IUDs and "The Pill" do, and what happens in 90% of all fertilizations anyway. The morning after pill is just interventive birth-control. It has absolutely nothing to do with abortions.
Hmmm, let me check what is says in my copy of the Windows EULA...
The Intel 386 processor implements protection bits in their segment descriptors. The OS can use this to mark a segment for read, write, execute or any combination, thereof. Windows, like a lot of Unix implementations, does not leverage the benefits of proper segmentation on the i386.
Each process is given 1 segment that is logically segregated into executable space and heap space. Since each process has a different segment, one cannot overwrite another -- voila! better inter-process separation and reliability (first seen in winnt for Windows).
To prevent a buffer overflow that results in the execution of malicious code, we need to separate the data and the executable code within a process. In order to implement this correctly, MS would have had to use more than one NON-overlapping segment. The code segments would have to be marked for execution/read only, while multiple data segments would have to be marked for read/write only. If this were done, the processor would raise an exception when a non-executable segment descriptor was loaded into the CS (code segment register). If the application/malign software tried to read/write to a code segment, which was did not have the read/write bits set, the processor would raise an exception. If the code and data segments pointed to non-overlapping regions in memory, code segments could be setup to prevent write access. The use of properly marked segments gives you tremendous power over what can be executed and what can be changed.
Windows uses virtual pages extensively and has separate pages for code and data. I bet that the NX bit that is mentioned in previous comments is a modifier for the page register. The i386 does not support execution protection at the page level. The i386 expects the OS to use segments properly to partition the logical address space (4GB most of which does not map to physical hardware), and page registers to implement virtual memory in limited physical memory.
Windows does not wield the power of segmentation correctly. We should not blame intel for it.
(Note: I am not in any way affiliated with Intel, though I did look for a job there when I got out of college.)
The method of attack for most stack buffer-overflows is to write enough data into a stack-allocated object to clobber the return pointer, which is allocated above it.
So why not make the stack grow upwards instead of downwards?
I hereby place the above post in the public domain.
How can a software (SP2) implement something in hardware? Does it activate hardware-implemented (but unused prior SP2) protection? Or does someone not know the difference between hard/soft-ware, but keeps posting anyway?
Please stop producing horrible versions of windows. Please stop continually patching the code. It is just a pile of band-aids now. Trash and renew, THEN you will have a good product.
Until then, penguins will haunt your dreams.
Warning, knife is sharp. Please keep out of children.
...use to be... used to be
...especialy... especially
...plauge... plague
...it's exception... its (it's = 'it is')
...interup handlers... interrupt
...dabbleing... dabbling
You can build things and link to libraries that are GPL and not GPL them.
Whoopsie daysie, that's not true. From gnu.org:
If a library is released under the GPL (not the LGPL), does that mean that any program which uses it has to be under the GPL?
Yes, because the program as it is actually run includes the library.
You can link non-GPL programs only with LGPL libraries.
Life is Reality
Microsoft and the hackers are just playing CoreWars, for real, on our systems. Isn't that great?
In fact, Windows XP's heap boundary checking sounds like little more than the old RADAR-X REDCODE program...
$#!^ happens, but why does it always have to happen to me???
Unfortunately, I don't see how this is a security risk.
All my users run under "limited" accounts, not administrator accounts, in other words...
Have no access to write such things in that part of the registry.
Much like linux's magical root, which can override all.
Change is certain; progress is not obligatory.
They could patch the security holes themselves rather than relying on stack protection to make them not exploitable. There are many unpatched security holes in Windows because MS is relying on SP2's stack protection rather than patching the buggy code itself.
No, I don't think I will.
The whole idea of spelling is a somewhat new development. Why should I be forced to conform to a completely imaginary set of rules that do nothing but to stop us from worrying about the content of our writing and instead worry about if the style conforms to the somewhat arbitrary standards set by bitter old english teachers? You may wish to be bound by such things but I do not.
Linux is really boring from an os standpoint. Now Plan 9......
A better way to defeat this class of attack is to move the metadata (in this case the link table) elsewhere to another, noncontiguous page. You could still induce a buffer overflow, but such an overflow would not corrupt the whole allocation mechanism.
For extra security you could put it in kernel space and give the library a new system call to do memory allocation, but that would increase memory allocation overhead, likely unacceptably.
Analysis and solution depend heavily on what attack you wish to defend against.
I would like to tell people who comment without having knowledge of the topic that, there is no software which can be declared "Hack Proof". And buffer overflows are bound to happen in most of the software. You cannot have code to prevent buffer overflows in all the step of the procedure the simple reason is because the software will start to crawl. If you want to get more info on how buffer overflows happen exactly, you can search in alstalavista.com for 'buffer overflow video'. You will get man video download links. Download a 7 min avi video and you will get very clearly how this happens (to learn this you dont have to be albert einsteins, its a very simple video)
...making it a footrace between crackers and the kernel team at MS, but only one of those parties entered the race with their shoes tied together and you don't need three guesses to figure out which.