The Spanner logo
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    The Spanner logo

    The Spanner
    Web security blog

    Made by Gareth Heyes
    Follow me on Twitter: @garethheyes

    Javascript for hackers!

    Hackvertor logo
    Shazzer logo
    My Github account
    Recent posts
    Introducing Feedworm: A Privacy-First RSS Reader That Lives in DevToolsSpeedy RSVP extensionAutoVaderHackvertor history and tag finderShadow Repeater v1.2.3 releaseBurp Hackvertor v2.1.24 releaseHacking roomsXSSing TypeErrors in SafarivalueOf: Another way to get thisMaking the Unexploitable Exploitable with X-Mixed-Replace on FirefoxThe curious case of the evt parameterCSS-Only Tic Tac Toe ChallengeRewriting relative urls with the base tag in SafariBypassing DOMPurify with mXSSNew IE mutation vectorHow I smashed MentalJSMentalJS DOM bypassAnother XSS auditor bypassXSS Auditor bypassBypassing the IE XSS filterUnbreakable filterMentalJS bypassesmXSSJava SerializationBypassing the XSS filter using function reassignmentRPOSandboxed jQueryX-Domain scroll detection on IE using focusEpic fail IEnew operatorDecoding complex non-alphanumeric JavaScriptHacking FirefoxDOM ClobberingBypassing XSS AuditorThe evolution of codeNon-Alpha PHP in 6-7 charsetTweetable PHP-Non AlphaMentalJS for PHPOpera x domain with video tutorialSandboxing and parsing jQuery in 100ms

    Astalanumerator baby

    By Gareth Heyes (@hackvertor)

    Published 17 years ago • Last updated March 22, 2025 • ⏱️ 2 min read

    ← Back to articles

    I wanted to map all properties in javascript and inspect them regardless if they were objects or not. IE doesn't support for(i in..) for native properties like constructor etc. So I decided to write a cross platform enumerator that could map everything. I decided to call it "Astalanumerator" as a silly reference to terminator combined with enumerator.

    It works using a list of js properties stored within an array, you pass an object to it and it checks each of the properties using the array and attempts to navigate through it. Originally I had it enumerating until it reached null but this caused every browser to lock up as some objects went on forever, so I put some limits in place.

    I use timeouts to prevent browser lockups and I use list elements to indent each of the objects, this is nice because I can delay the result and continue the loop while the object has finished enumerating. The third parameter of the inspect function handles this by storing the target element so each of the objects can be linked together.

    Limits

    The limits in place help stop browser crashes here is how they work:-

    1. Number of properties to enum: This is the limit of valid properties of the object, it will only evaluate 10 per object by default.
    2. Number of inner properties to enum: The inner properties limit is the amount of child properties to enumerate.
    3. Only enum objects?: This option allows you to enum all properties even numbers, by default it is restricted to objects only.

    Astalanumerator demo

    ← Back to articles