本文讲的是
使用libFuzzer fuzz Chrome V8入门指南,
什么是V8?
m.googlesource.com/chromium/tools/depot_tools.git
$ export PATH="$PATH:/path/to/depot_tools"
$ mkdir ~/chromium && cd ~/chromium
$ fetch --nohooks --no-history chromium
$ cd src
$ build/install-build-deps.sh
$ gclient runhooks
$ gn gen out/libfuzzer '--args=use_libfuzzer=true is_asan=true is_ubsan_security=true is_debug=false enable_nacl=false' --check
//components/json_schema:json_schema //components/json_schema:unit_tests //components/json_schema:unit_tests_bundle_data //components/ntp_tiles:json_unsafe_parser //components/safe_json:safe_json //components/safe_json:test_support //components/safe_json:unit_tests //components/safe_json/public/interfaces:interfaces //components/safe_json/public/interfaces:interfaces__check_deps_are_all_mojom //components/safe_json/public/interfaces:interfaces__generator //components/safe_json/public/interfaces:interfaces__is_mojom //components/safe_json/public/interfaces:interfaces__type_mappings //components/safe_json/public/interfaces:interfaces_blink //components/safe_json/public/interfaces:interfaces_blink__generator //components/safe_json/public/interfaces:interfaces_blink__type_mappings //components/safe_json/public/interfaces:interfaces_js //components/safe_json/public/interfaces:interfaces_js__generator //components/safe_json/public/interfaces:interfaces_js_data_deps //components/safe_json/public/interfaces:interfaces_shared //components/safe_json/public/interfaces:interfaces_shared__generator //components/safe_json/public/interfaces:interfaces_shared_cpp_sources //components/safe_json/utility:utility //content/browser/devtools:compressed_protocol_json //extensions/shell/common/api:shell_api_features_json_features //extensions/shell/common/api:shell_behavior_features_json_features //extensions/shell/common/api:shell_manifest_features_json_features //extensions/shell/common/api:shell_permission_features_json_features //extensions/test:test_api_features_json_features //extensions/test:test_behavior_features_json_features //extensions/test:test_manifest_features_json_features //extensions/test:test_permission_features_json_features //gpu/config:process_json //testing/libfuzzer/fuzzers:base_json_reader_fuzzer //testing/libfuzzer/fuzzers:v8_json_parser_fuzzer //testing/libfuzzer/fuzzers:v8_json_parser_fuzzer.options //testing/libfuzzer/fuzzers:v8_json_parser_fuzzer_dict_copy //third_party/WebKit/Source/platform:blink_json_parser_fuzzer //third_party/WebKit/Source/platform:blink_json_parser_fuzzer.options //third_party/WebKit/Source/platform:blink_json_parser_fuzzer_dict_copy //third_party/angle/src/vulkan_support:vulkan_gen_json_files //third_party/dom_distiller_js:json_values_converter_test_proto //third_party/dom_distiller_js:json_values_converter_test_proto_gen //third_party/dom_distiller_js:json_values_converter_tests //third_party/jsoncpp:jsoncpp //third_party/webrtc/base:rtc_json //third_party/webrtc/rtc_base:rtc_json //tools/json_schema_compiler:generated_api_util //tools/json_schema_compiler/test:api //tools/json_schema_compiler/test:api_schema_generator //tools/json_schema_compiler/test:features_compiler_test //tools/json_schema_compiler/test:features_compiler_test_json_features //tools/json_schema_compiler/test:unit_tests //v8:json_fuzzer //v8:v8_simple_json_fuzzer
$ ninja -C out/libfuzzer v8_json_parser_fuzzer
$ mkdir json_parser_corpus
{ "colorsArray":[{ "colorName":"red", "hexValue":"#f00" }, { "colorName":"green", "hexValue":"#0f0" }, { "colorName":"blue", "hexValue":"#00f" }, { "colorName":"cyan", "hexValue":"#0ff" }, { "colorName":"magenta", "hexValue":"#f0f" }, { "colorName":"yellow", "hexValue":"#ff0" }, { "colorName":"black", "hexValue":"#000" } ] }
$ ./v8_json_parser_fuzzer json_parser_corpus/ -dict=v8_json_parser_fuzzer.dict
$ ./v8_json_parser_fuzzer json_parser_corpus/ -dict=v8_json_parser_fuzzer.dict -jobs=X -workers=X
原文发布时间为:2017年7月26日
本文作者:鲁班七号
本文来自云栖社区合作伙伴嘶吼,了解相关信息可以关注嘶吼网站。