
An updated collection of resources targeting browser-exploitation.
The world of Browsers is dominated by 4 major players:
The following is split into two parts:
Of course you can use you're own favorite setup to browse the sources. However, those repos are relatively large and I tried a couple different setups until I found something that worked for me. So if you don't have good setup already, here are a couple of my experiences that might help you:
Articles:
The JavaScript-Engine of Blink is V8.
Project | GitHub | Source | How2Build
Build (Ubuntu 18.04):
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=$PATH:./depot_tools
$ gclient
$ mkdir ./v8 && cd ./v8
$ fetch v8 && cd v8
$ git pull
$ gclient sync
$ ./build/install-build-deps.sh
$ tools/dev/gm.py x64.release
$ out/x64.release/d8
Useful flags:
--print-opt-code: code generated by optimizing compiler--print-byte-code: bytecode generated by interpreter--trace-ic: different object types a call site encouters--trace-opt and --trace-deopt: which functions are (de)optimized--trace-turbo: TurboFan traces for the Turbolizer visualizationArticles:
V8 provides a visualization for TurboFan called Turbolizer
Articles:
--trace-turbo: d8 --trace-turbo foo.jsturbo-foo-0.jsonv8/tools/turbolizer and install with npm as described in README.mdpython -m SimpleHTTPServer 8000localhost:8000 and open turbo-foo-0.jsonThe JavaScript-Engine of Gecko is Spidermonkey.
Build (Ubuntu 18.04):
$ wget -O bootstrap.py https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py
$ git clone https://github.com/mozilla/gecko-dev.git && cd gecko-dev
$ cd js/src
$ autoconf2.13
# This name should end with "_DBG.OBJ" to make the version control system ignore it.
$ mkdir build_DBG.OBJ
$ cd build_DBG.OBJ
$ ../configure --enable-debug --disable-optimize
# Use "mozmake" on Windows
$ make -j 6
$ js/src/js
Spidermonkey provides a visualization for IonMonkey called IonGraph
The JavaScript-Engine of Webkit is JavaScriptCore (JSC).
Articles:
# sudo apt install libicu-dev python ruby bison flex cmake build-essential ninja-build git gperf
$ git clone git://git.webkit.org/WebKit.git && cd WebKit
$ Tools/gtk/install-dependencies
$ Tools/Scripts/build-webkit --jsc-only --debug
$ cd WebKitBuild/Release
$ LD_LIBRARY_PATH=./lib bin/jsc
WebKit has a 4-Layer JIT-Compiler system, representing the tradeoff between overhead performance cost and performance benefit.
Articles:
Since Edge switched to Blink and the Chromium Project as its Rendering-Engine, Edge is using v8. Originally, Edge had is own Rendering-Engine called EdgeHTML, which used the ChakraCore JavaScript-Engine.
# To build ChakraCore on Linux: (requires Clang 3.7+ and Python 2)
$ apt-get install -y git build-essential cmake clang libicu-dev libunwind8-dev
$ git clone https://github.com/Microsoft/ChakraCore && cd ChakraCore
$ ./build.sh --cc=/usr/bin/clang-3.9 --cxx=/usr/bin/clang++-3.9 --arch=amd64 --debug
$ out/Debug/ch