Created
January 22, 2018 11:31
-
-
Save l4wio/d5d3e2e110a2dfe1193ba4802f4d4016 to your computer and use it in GitHub Desktop.
libFuzzer @tradahacking stuffs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dirty way to compile curl tool_main with libFuzzer | |
# clean | |
rm curl | |
rm curl-tool_main.o | |
# modify tool_main.c | |
# remove main() in tool_main | |
# define function LLVMFuzzerTestOneInput at tool_urlglob.c | |
# make | |
# make curl will be failed, cause there is no "main" function | |
make | |
echo Build own source with fuzzer lib | |
# now link it with libFuzzer | |
# must be linked with clang++ | |
echo " CCLD " curl;/bin/bash ../libtool --silent --tag=CC --mode=link clang++ -fsanitize-coverage=trace-pc-guard -fsanitize=address -Qunused-arguments -Os -o curl curl-slist_wc.o curl-tool_binmode.o curl-tool_bname.o curl-tool_cb_dbg.o curl-tool_cb_hdr.o curl-tool_cb_prg.o curl-tool_cb_rea.o curl-tool_cb_see.o curl-tool_cb_wrt.o curl-tool_cfgable.o curl-tool_convert.o curl-tool_dirhie.o curl-tool_doswin.o curl-tool_easysrc.o curl-tool_formparse.o curl-tool_getparam.o curl-tool_getpass.o curl-tool_help.o curl-tool_helpers.o curl-tool_homedir.o curl-tool_hugehelp.o curl-tool_libinfo.o curl-tool_main.o curl-tool_metalink.o curl-tool_msgs.o curl-tool_operate.o curl-tool_operhlp.o curl-tool_panykey.o curl-tool_paramhlp.o curl-tool_parsecfg.o curl-tool_strdup.o curl-tool_setopt.o curl-tool_sleep.o curl-tool_urlglob.o curl-tool_util.o curl-tool_vms.o curl-tool_writeout.o curl-tool_xattr.o ../lib/curl-strtoofft.o ../lib/curl-nonblock.o ../lib/curl-warnless.o ../lib/libcurl.la -lssl -lcrypto -lz /root/trada/libFuzzer.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/curl/curl/commit/fbb5f1aa0326d485d5a7ac643b48481897ca667f#diff-15005d4c0ee02cf36f6ff576dbb7239c | |
git checkout 584d0121c353ed855115c39f6cbc009854018029 -- ./src/tool_urlglob.c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment