From 93f7338f73b12d452410f0981c51b96f19bc73e0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Dec 2023 16:23:08 +0000 Subject: [PATCH] Ready to be evaluated --- .gitignore | 1 - test/test | 3 +++ test/test.sh | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 test/test diff --git a/.gitignore b/.gitignore index 55565dd..6d43302 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,6 @@ war *.x86_64 *.hex -test !test/ # Debug files *.dSYM/ diff --git a/test/test b/test/test new file mode 100755 index 0000000..3131d67 --- /dev/null +++ b/test/test @@ -0,0 +1,3 @@ +#! /bin/bash + +sleep infinity \ No newline at end of file diff --git a/test/test.sh b/test/test.sh index c8dd6a4..daadc53 100755 --- a/test/test.sh +++ b/test/test.sh @@ -40,6 +40,7 @@ function test_folder_is_file(){ touch /tmp/test ./${NAME} echo_green OK + rm -rf /tmp/test } function test_hello_world(){ @@ -110,7 +111,7 @@ function test_antidebug(){ } function get_signatures(){ - for f in $(find /tmp/test/ -type f ); do + for f in $(find /tmp/test* -type f ); do strings $f | grep $LOGIN | cut -d '-' -f 3 | tr -s ' ' done } @@ -123,6 +124,14 @@ function test_war() { cp /bin/cp /tmp/test/3 cp /bin/cp /tmp/test/4 + find /bin/ -type f -exec sh -c ' + for file do + if file "$file" | grep -q "ELF 64-bit"; then + cp "$file" /tmp/test2/ + fi + done +' sh {} + + ./$NAME local signatures=$(get_signatures) local total=$(echo $signatures | tr ' ' '\n' | wc -l) @@ -131,6 +140,7 @@ function test_war() { echo_red KO else echo_green OK + echo $signatures | tr ' ' '\n' | uniq | wc -l fi }