diff --git a/code/.gitignore b/code/.gitignore new file mode 100644 index 0000000..6b6d840 --- /dev/null +++ b/code/.gitignore @@ -0,0 +1,5 @@ +gcc-9.2.0.tar.xz +gcc-9.2.0.tar.xz.sig +llvm-project.181ab91efc9.tar.xz +clang.181ab91efc9 +gcc-9.2 diff --git a/code/build_clang.sh b/code/build_clang.sh new file mode 100755 index 0000000..64ffad2 --- /dev/null +++ b/code/build_clang.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +mkdir build \ + && cd build \ + && cmake -DLLVM_ENABLE_PROJECTS=clang \ + -DCMAKE_BUILD_TYPE=Release \ + -G "Unix Makefiles" ../llvm \ + && make -j8 diff --git a/code/build_gcc.sh b/code/build_gcc.sh new file mode 100755 index 0000000..ce49f2b --- /dev/null +++ b/code/build_gcc.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +mkdir objdir \ + && cd objdir \ + && ../configure \ + --build=x86_64-linux-gnu \ + --host=x86_64-linux-gnu \ + --target=x86_64-linux-gnu \ + --disable-multilib \ + && make -j8 diff --git a/code/checksec_result_clang.json b/code/checksec_result_clang.json new file mode 100644 index 0000000..7294318 --- /dev/null +++ b/code/checksec_result_clang.json @@ -0,0 +1 @@ +{ "vuln.clang": { "relro":"partial","canary":"no","nx":"yes","pie":"no","rpath":"no","runpath":"no","symbols":"yes","fortify_source":"no","fortified":"0","fortify-able":"0" } } \ No newline at end of file diff --git a/code/checksec_result_gcc.json b/code/checksec_result_gcc.json new file mode 100644 index 0000000..9677fce --- /dev/null +++ b/code/checksec_result_gcc.json @@ -0,0 +1 @@ +{ "vuln.gcc": { "relro":"partial","canary":"no","nx":"yes","pie":"no","rpath":"no","runpath":"no","symbols":"yes","fortify_source":"no","fortified":"0","fortify-able":"0" } } \ No newline at end of file diff --git a/code/vuln.c b/code/vuln.c new file mode 100644 index 0000000..85bd047 --- /dev/null +++ b/code/vuln.c @@ -0,0 +1,13 @@ +#include +void vuln(char *input) { + char buf[50]; + size_t len = strlen(input); + for (size_t i = 0; i < len; i++) { + buf[i] = input[i]; + } +} +int main(int argc, char **argv) { + vuln(argv[1]); + return 0; +} + diff --git a/code/vuln.clang b/code/vuln.clang new file mode 100755 index 0000000..c9deea3 Binary files /dev/null and b/code/vuln.clang differ diff --git a/code/vuln.gcc b/code/vuln.gcc new file mode 100755 index 0000000..4fe86ee Binary files /dev/null and b/code/vuln.gcc differ