Skip to content

Instantly share code, notes, and snippets.

@ubdussamad
Last active March 2, 2023 01:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ubdussamad/c4b81a0ecd5a409e82dd28ae6d5cad5f to your computer and use it in GitHub Desktop.
#!/bin/bash
PREFIX="${PREFIX:-/usr/local/apache_clean}"
CC="afl-clang-fast"
CXX="afl-clang-fast++"
echo -e " \e[32mAPR"
echo
echo "Running apr with: c-compiler:$CC $CFLAGS c++-compiler:$CXX $CXXFLAGS"
sleep 2
cd apr-1.7.2 && CC="$CC" CXX="$CXX" ./configure --prefix="$PREFIX" && apr=$(pwd) && make clean && make -j35 && make install && cd ..
echo -e " \e[33mAPRUTIL"
echo
echo "Running aprutil with: c-compiler:$CC $CFLAGS c++-compiler:$CXX $CXXFLAGS"
sleep 2
cd apr-util-1.6.3 && CC="$CC" CXX="$CXX" ./configure --prefix="$PREFIX" --with-apr=$apr && aprutil=$(pwd) && make clean && make -j35 && make install && cd ..
echo -e " \e[34mPCRE"
echo
echo "Running pcre with: c-compiler:$CC $CFLAGS c++-compiler:$CXX $CXXFLAGS"
sleep 2
cd pcre-8.45 && CC="$CC" CXX="$CXX" ./configure --disable-cpp --prefix="$PREFIX" && pcre=$(pwd) && make clean && make -j35 && make install && make install && cd ..
echo -e " \e[35mNGHTTP"
echo
echo "Running nghttp with: c-compiler:$CC $CFLAGS c++-compiler:$CXX $CXXFLAGS"
sleep 2
cd nghttp2-1.51.0 && CC="$CC" CXX="$CXX" ./configure --prefix="$PREFIX" && nghttp=$(pwd) && make clean && make -j35 && make install && cd ..
if [[ -z "$apr" || -z "$aprutil" || -z "$nghttp" || -z "$pcre" ]]; then
echo "\e[0m[-] Dependencies compilation failed."
echo APR: $apr
echo APR-Util: $aprutil
echo nghttp: $nghttp
echo PCRE8: $pcre
return 1;
fi
echo -e "\e[0m[+] Using the following paths"
echo $apr
echo $aprutil
echo $nghttp
echo $pcre
sleep 4
cd httpd-2.4.54
LIBS="-L$apr/.libs -L$aprutil/.libs -L$pcre/.libs -L$nghttp/lib/" CFLAGS=" $CFLAGS -I$nghttp/lib/includes -march=skylake -g -ggdb -fno-builtin -fno-inline" LDFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" ./configure --enable-unixd --disable-pie --enable-mods-static=few --prefix="$PREFIX" --with-mpm=event --enable-http2 --with-apr=$apr --with-apr-util=$aprutil --with-nghttp2=$nghttp --enable-nghttp2-staticlib-deps --with-pcre=$pcre/pcre-config && make clean && make -j35 && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment