Heap spraying

Heap spraying

In computer security, heap spraying is a technique used in exploits to facilitate arbitrary code execution. The term is also used to describe the part of the source code of an exploit that implements this technique. In general, code that "sprays the heap" attempts to put a certain sequence of bytes at a predetermined location in the memory of a target process by having it allocate (large) blocks on the process' heap and fill the bytes in these blocks with the right values. They commonly take advantage from the fact that these heap blocks will roughly be in the location everytime the heap spray is run.

History

Heap sprays have been used occasionally in exploits since at least 2001 [ [http://research.eeye.com/html/advisories/published/AD20010618.html eEye Digital Security - Research ] ] , but the technique started to see widespread used in exploits for web browsers soon after the release a series of exploits that used it that exploited a wide range of bugs in Internet Explorer [ [http://skypher.com/wiki/index.php?title=Www.edup.tudelft.nl/~bjwever/advisory_iframe.html.php Internet Explorer IFRAME src&name parameter BoF remote compromise] ] [ [http://skypher.com/wiki/index.php?title=Www.edup.tudelft.nl/~bjwever/details_msie_ani.html.php Internet Exploiter 3: Technical details] ] [ [http://skypher.com/wiki/index.php?title=Www.edup.tudelft.nl/~bjwever/advisory_msie_R6025.html.php Microsoft Internet Explorer DHTML Object handling vulnerabilities (MS05-20)] ] [ [http://www.frsirt.com/english/advisories/2005/0935 FrSIRT - Microsoft Internet Explorer javaprxy.dll COM Object Vulnerability / Exploit (Security Advisories) ] ] [ [http://www.frsirt.com/english/advisories/2005/1450 FrSIRT - Microsoft Internet Explorer "Msdds.dll" Remote Code Execution / Exploit (Security Advisories) ] ] . The heap sprays used in all these exploits was very similar, which showed its versatility and ease of use without need for major modifications between exploits. It proved simple enough to understand and use to allow novice hackers to quickly write reliable exploits for many types of vulnerabilities in web browsers and web browser plug-ins. Many web browser exploits that use heap spraying consist only of a heap spray that is copy-pasted from a previous exploit combined with a small piece of script or HTML that triggers the vulnerability.

Even though the technique was proven to work on other web browsers [ [http://www.milw0rm.com/id.php?id=1224 Mozilla Browsers 0xAD (HOST:) Remote Heap Buffer Overrun Exploit (v2) ] ] , it has not seem the same widespread use as seen for Internet Explorer.

Implementation

JavaScript

Heap sprays for web browsers are commonly implemented in JavaScript and spray the heap by creating large Unicode strings with the same character repeated many times by starting with a string of one character and concatenating it with itself over and over. This causes the length of the string to grow exponentially up to the maximum length allowed by the scripting engine. When the maximum length (or an arbitrary lower length) is reached, the heap spraying code starts to make copies of the long string and stores these in an array, up to the point where enough memory has been sprayed. VBScript is sometimes (though very rarely) used to create strings as well because it is made easy by the "String" function.

Images

Though it has been proven that heap-spraying can be done through other means, for instance by loading image files into the process [ [http://www.blackhat.com/html/bh-usa-06/bh-usa-06-speakers.html#Sutton Michael Sutton & Greg MacManus: Punk Ode—Hiding Shellcode in Plain Sight] ] , this has not seen widespread use (as of August 2008).

References

See also

* NOP slide, a technique which is complementary to heap spraying


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Cross-site request forgery — Cross site request forgery, also known as a one click attack or session riding and abbreviated as CSRF (pronounced sea surf[1]) or XSRF, is a type of malicious exploit of a website whereby unauthorized commands are transmitted from a user that… …   Wikipedia

  • Client honeypot — Honeypots are security devices whose value lie in being probed and compromised. Traditional honeypots are servers (or devices that expose server services) that wait passively to be attacked. Client Honeypots are active security devices in search… …   Wikipedia

  • NOP slide — In computer CPUs, a NOP slide, NOP sled or NOP ramp is a sequence of NOP (no operation) instructions (on Intel x86, this is the opcode 0x90) meant to slide the CPU s instruction execution flow to its final, desired, destination. Generally a NOP… …   Wikipedia

  • ASLR — Address Space Layout Randomization (ASLR) ist eine Technik, die die Ausnutzung von Sicherheitslücken in Computersystemen erschwert. ASLR vergibt den Programmen zufällig die Adressbereiche, somit ist das System praktisch nicht mehr deterministisch …   Deutsch Wikipedia

  • Ant — For other uses, see Ant (disambiguation). Ants Temporal range: 130–0 Ma …   Wikipedia

  • 3-2-1 — 3–2–1 Format Game Show Created by Narciso Ibáñez Serrador Starring Ted Rogers Country of origin United Kingdom No. of series …   Wikipedia

  • Agricultural wastewater treatment — relates to the treatment of wastewaters produced in the course of agricultural activities.As agriculture is a highly intensified industry in many parts of the world, the range of wastewaters requiring treatment can encompass at least the… …   Wikipedia

  • Bowser and Blitz — are cartoon characters in the C.O.P.S. (Central Organization of Police Specialists) animated series from Hasbro which ran from 1988 1989.Character ProfilesBowserBowser (Real name: Officer Rex Pointer, former member of the Chicago PD K 9 Unit) is… …   Wikipedia

  • Return of Techno-Destructo — Infobox music DVD Name = Return of Techno Destructo Type = VHS Artist = GWAR Released = 1996 Recorded = Genre = Thrash metal, punk rock Length = 90 min Label = Slave Pit, Inc. Producer = Reviews = Last DVD = Skulhedface (1994) This DVD = Return… …   Wikipedia

  • The Road Warrior (The O.C. episode) — Infobox Television episode Colour = #ffaa44 Series = The O.C. Title = The Road Warrior Season = 3 (2005 2006) Caption = Ryan and Sadie Episode = 16 Airdate = March 9, 2006 (FOX) Writer = Mike Kelley Director = Michael Fresco Production = 2T6266… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”