From 3f63c93b6b3d785283561cf21c8d578f996a0a51 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:04:52 +0200 Subject: [PATCH 001/211] adding fuzz info --- .vscode/settings.json | 3 + CMakeLists - Copia.txt | 42 +++++++++++ CMakeLists.txt | 3 +- cifuzz.yaml | 46 ++++++++++++ test/my_fuzz_test.cpp | 155 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 CMakeLists - Copia.txt create mode 100644 cifuzz.yaml create mode 100644 test/my_fuzz_test.cpp diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0db5873 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cmake.configureOnOpen": true +} \ No newline at end of file diff --git a/CMakeLists - Copia.txt b/CMakeLists - Copia.txt new file mode 100644 index 0000000..6795e26 --- /dev/null +++ b/CMakeLists - Copia.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.8.1) +project(tcp_client_server) + +find_package (Threads) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") + +add_library(${PROJECT_NAME} + src/tcp_client.cpp + src/tcp_server.cpp + src/client.cpp + src/pipe_ret_t.cpp + src/common.cpp) + +option(SERVER_EXAMPLE "Build SERVER" ON) + +if(SERVER_EXAMPLE) + + add_definitions( + -DSERVER_EXAMPLE + ) + + add_executable(tcp_server examples/server_example.cpp) + + target_link_libraries (tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + +endif() + +option(CLIENT_EXAMPLE "Build CLIENT" ON) + +if(CLIENT_EXAMPLE) + + add_definitions( + -DCLIENT_EXAMPLE + ) + + add_executable(tcp_client examples/client_example.cpp) + + target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 6795e26..3a87d8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) -find_package (Threads) +find_package(cifuzz) +enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") diff --git a/cifuzz.yaml b/cifuzz.yaml new file mode 100644 index 0000000..4464473 --- /dev/null +++ b/cifuzz.yaml @@ -0,0 +1,46 @@ +## Configuration for a CI Fuzz project +## Generated on 2023-05-31 + +## The build system used to build this project. If not set, cifuzz tries +## to detect the build system automatically. +## Valid values: "bazel", "cmake", "maven", "gradle", "other". +#build-system: cmake + +## If the build system type is "other", this command is used by +## `cifuzz run` to build the fuzz test. +#build-command: "make my_fuzz_test" + +## Directories containing sample inputs for the code under test. +## See https://llvm.org/docs/LibFuzzer.html#corpus +#seed-corpus-dirs: +# - path/to/seed-corpus + +## A file containing input language keywords or other interesting byte +## sequences. +## See https://llvm.org/docs/LibFuzzer.html#dictionaries +#dict: path/to/dictionary.dct + +## Command-line arguments to pass to libFuzzer. +## See https://llvm.org/docs/LibFuzzer.html#options +#engine-args: +# - -rss_limit_mb=4096 + +## Maximum time to run fuzz tests. The default is to run indefinitely. +#timeout: 30m + +## By default, fuzz tests are executed in a sandbox to prevent accidental +## damage to the system. Set to false to run fuzz tests unsandboxed. +## Only supported on Linux. +#use-sandbox: false + +## Set to true to print output of the `cifuzz run` command as JSON. +#print-json: true + +## Set to true to disable desktop notifications +#no-notifications: true + +## Set URL of the CI App +#server: https://app.code-intelligence.com + +## Set the project name on the CI App +#project: my-project-1a2b3c4d diff --git a/test/my_fuzz_test.cpp b/test/my_fuzz_test.cpp new file mode 100644 index 0000000..13fc581 --- /dev/null +++ b/test/my_fuzz_test.cpp @@ -0,0 +1,155 @@ +#ifdef SERVER_EXAMPLE + +#include +#include +#include +#include + +#include "../include/tcp_server.h" + +// declare the server +TcpServer server; + +// declare a server observer which will receive incomingPacketHandler messages. +// the server supports multiple observers +server_observer_t observer; + +bool shouldSaveMsg = false; +char msgBuffer[10] = {0}; + +std::mutex mtx; +std::condition_variable server_ready; +bool canAcceptNextClient = true; + +// observer callback. will be called for every new message received by clients +// with the requested IP address +void onIncomingMsg(const std::string &clientIP, const char *msg, size_t size) { + std::string msgStr = msg; + if (msgStr == "S") { + shouldSaveMsg = true; + } else if (shouldSaveMsg) { + if (strncmp(msgStr.c_str(), "M", 1) == 0) { + memcpy(msgBuffer, msg, size); + } + shouldSaveMsg = false; + } + // print client message + std::cout << "Observer1 got client msg: " << msgStr << "\n"; +} + +// observer callback. will be called when client disconnects +void onClientDisconnected(const std::string &ip, const std::string &msg) { + std::cout << "Client: " << ip << " disconnected. Reason: " << msg << "\n"; + { + std::lock_guard lock(mtx); + canAcceptNextClient = true; + server_ready.notify_one(); + } +} + +int main() { + // start server on port 65123 + pipe_ret_t startRet = server.start(65123); + if (startRet.isSuccessful()) { + std::cout << "Server setup succeeded\n"; + } else { + std::cout << "Server setup failed: " << startRet.message() << "\n"; + return EXIT_FAILURE; + } + + // configure and register observer + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onClientDisconnected; + observer.wantedIP = "127.0.0.1"; + server.subscribe(observer); + + while (true) { + acceptClient(); + { + std::lock_guard lock(mtx); + canAcceptNextClient = false; + } + std::unique_lock lock(mtx); + server_ready.wait(lock, [] { return canAcceptNextClient; }); + } + + return 0; +} + +#endif +/////////////////////////////////////////////////////////// +/////////////////////CLIENT EXAMPLE//////////////////////// +/////////////////////////////////////////////////////////// + +#ifdef CLIENT_EXAMPLE + +#include +#include +#include "../include/tcp_client.h" + +TcpClient client; + +// on sig_exit, close client +void sig_exit(int s) { + std::cout << "Closing client...\n"; + pipe_ret_t finishRet = client.close(); + if (finishRet.isSuccessful()) { + std::cout << "Client closed.\n"; + } else { + std::cout << "Failed to close client.\n"; + } + exit(0); +} + +// observer callback. will be called for every new message received by the server +void onIncomingMsg(const char *msg, size_t size) { + std::cout << "Got msg from server: " << msg << "\n"; +} + +// observer callback. will be called when server disconnects +void onDisconnection(const pipe_ret_t &ret) { + std::cout << "Server disconnected: " << ret.message() << "\n"; +} + +int main() { + // register to SIGINT to close client when user press ctrl+c + signal(SIGINT, sig_exit); + + // configure and register observer + client_observer_t observer; + observer.wantedIP = "127.0.0.1"; + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onDisconnection; + client.subscribe(observer); + + // connect client to an open server + bool connected = false; + while (!connected) { + pipe_ret_t connectRet = client.connectTo("127.0.0.1", 65123); + connected = connectRet.isSuccessful(); + if (connected) { + std::cout << "Client connected successfully\n"; + } else { + std::cout << "Client failed to connect: " << connectRet.message() << "\n" + << "Make sure the server is open and listening\n\n"; + sleep(2); + std::cout << "Retrying to connect...\n"; + } + } + + // send messages to server + while (true) { + // Fuzzed input for sending a message to the server + std::string message = /* fuzzed message */; + pipe_ret_t sendRet = client.sendMsg(message.c_str(), message.size()); + if (!sendRet.isSuccessful()) { + std::cout << "Failed to send message: " << sendRet.message() << "\n"; + } else { + std::cout << "Message was sent successfully\n"; + } + } + + return 0; +} + +#endif From eaa971c9779fddbb7529922adcfcd4d9172c57cb Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:18:57 +0200 Subject: [PATCH 002/211] findings --- .cifuzz-build/logs/build-my_fuzz_test.log | 0 CMakeLists - Copia.txt => CMakeLists - backup.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .cifuzz-build/logs/build-my_fuzz_test.log rename CMakeLists - Copia.txt => CMakeLists - backup.txt (100%) diff --git a/.cifuzz-build/logs/build-my_fuzz_test.log b/.cifuzz-build/logs/build-my_fuzz_test.log new file mode 100644 index 0000000..e69de29 diff --git a/CMakeLists - Copia.txt b/CMakeLists - backup.txt similarity index 100% rename from CMakeLists - Copia.txt rename to CMakeLists - backup.txt From 16cbf546c02e5a349f3ac44b3a1df13735fc335e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:40:44 +0200 Subject: [PATCH 003/211] Create manual.yml --- .github/workflows/manual.yml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..8625079 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,82 @@ +name: CI Fuzz +# Set an action secret called "CI_FUZZ_API_TOKEN" with an API token +# generated in CI Fuzz web interface. + +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + # The fuzzing server gRPC URL. + FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 + # The fuzzing server HTTP URL. + WEB_APP_ADDRESS: https://app.code-intelligence.com + # Directory in which the repository will be cloned. + CHECKOUT_DIR: checkout-dir/ + CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" + CIFUZZ_INSTALL_DIR: ./cifuzz + FUZZING_ARTIFACT: fuzzing-artifact.tar.gz +jobs: + fuzz_tests: + runs-on: ubuntu-latest + # Configure your build environment here + # container: example/docker_image + steps: + - id: checkout + name: Checkout Repository + uses: actions/checkout@v2 + with: + path: ${{ env.CHECKOUT_DIR }} + - id: install-cifuzz + name: Install cifuzz + run: | + curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" + chmod u+x cifuzz_installer + ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + - id: build-fuzzers + name: Build Fuzzers + run: | + export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" + cd $CHECKOUT_DIR/ + $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ + --commit $GITHUB_SHA \ + --branch $GITHUB_REF_NAME \ + --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT + shell: "bash" + - id: start-fuzzing + name: Start Fuzzing + uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} + checkout_directory: ${{ env.CHECKOUT_DIR }} + - id: monitor-fuzzing + name: Fuzzing + uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v5 + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + dashboard_address: ${{ env.WEB_APP_ADDRESS }} + - id: save-results + name: Save Fuzz Test Results + uses: CodeIntelligenceTesting/github-actions/save-results@v5 + if: ${{ success() || failure() }} + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + dashboard_address: ${{ env.WEB_APP_ADDRESS }} + - id: upload-artifact + uses: actions/upload-artifact@v2 + if: ${{ (success() || failure()) }} + with: + name: ci_fuzz_results + path: | + findings.json + coverage.json + web_app_address.txt From 827657d5f9a4200601dfca546074c76fa6f633f0 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:45:55 +0200 Subject: [PATCH 004/211] Update manual.yml --- .github/workflows/manual.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 8625079..05d95a8 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -39,6 +39,7 @@ jobs: - id: build-fuzzers name: Build Fuzzers run: | + fuzz init export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" cd $CHECKOUT_DIR/ $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ From 84fe2708030185aa294de22deac47a56380d2a13 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:50:26 +0200 Subject: [PATCH 005/211] Update manual.yml --- .github/workflows/manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 05d95a8..0c06fa3 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -39,7 +39,7 @@ jobs: - id: build-fuzzers name: Build Fuzzers run: | - fuzz init + export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" cd $CHECKOUT_DIR/ $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ From ac3d6a6351002c5cb3bc234329165a8db20601f1 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:56:48 +0200 Subject: [PATCH 006/211] addingID --- .github/workflows/manual.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 0c06fa3..26e1b99 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -36,10 +36,12 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + - id: initialize-fuzzer + run: | + cifuzz init - id: build-fuzzers name: Build Fuzzers run: | - export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" cd $CHECKOUT_DIR/ $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ From 374059c4bc29356263c53d71d72e0a484aa3073e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:06:11 +0200 Subject: [PATCH 007/211] Create _cmake.yml --- .github/workflows/cmake.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..cf8e1ce --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,37 @@ +name: CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + From cb052371dbda01cb028012badf0140dae69f165b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:08:41 +0200 Subject: [PATCH 008/211] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..8625079 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,82 @@ +name: CI Fuzz +# Set an action secret called "CI_FUZZ_API_TOKEN" with an API token +# generated in CI Fuzz web interface. + +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + # The fuzzing server gRPC URL. + FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 + # The fuzzing server HTTP URL. + WEB_APP_ADDRESS: https://app.code-intelligence.com + # Directory in which the repository will be cloned. + CHECKOUT_DIR: checkout-dir/ + CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" + CIFUZZ_INSTALL_DIR: ./cifuzz + FUZZING_ARTIFACT: fuzzing-artifact.tar.gz +jobs: + fuzz_tests: + runs-on: ubuntu-latest + # Configure your build environment here + # container: example/docker_image + steps: + - id: checkout + name: Checkout Repository + uses: actions/checkout@v2 + with: + path: ${{ env.CHECKOUT_DIR }} + - id: install-cifuzz + name: Install cifuzz + run: | + curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" + chmod u+x cifuzz_installer + ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + - id: build-fuzzers + name: Build Fuzzers + run: | + export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" + cd $CHECKOUT_DIR/ + $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ + --commit $GITHUB_SHA \ + --branch $GITHUB_REF_NAME \ + --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT + shell: "bash" + - id: start-fuzzing + name: Start Fuzzing + uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} + checkout_directory: ${{ env.CHECKOUT_DIR }} + - id: monitor-fuzzing + name: Fuzzing + uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v5 + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + dashboard_address: ${{ env.WEB_APP_ADDRESS }} + - id: save-results + name: Save Fuzz Test Results + uses: CodeIntelligenceTesting/github-actions/save-results@v5 + if: ${{ success() || failure() }} + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + dashboard_address: ${{ env.WEB_APP_ADDRESS }} + - id: upload-artifact + uses: actions/upload-artifact@v2 + if: ${{ (success() || failure()) }} + with: + name: ci_fuzz_results + path: | + findings.json + coverage.json + web_app_address.txt From bce7a1c3e14d3e6040a5ba4eb7b59d0adf1ad898 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:10:48 +0200 Subject: [PATCH 009/211] Rename c-cpp.yml to c-c.yml --- .github/workflows/{c-cpp.yml => c-c.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{c-cpp.yml => c-c.yml} (100%) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-c.yml similarity index 100% rename from .github/workflows/c-cpp.yml rename to .github/workflows/c-c.yml From 4ea644e17618f9e8bec4a8d7e0e0aaa9e17ef15e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:15:11 +0200 Subject: [PATCH 010/211] Update c-c.yml --- .github/workflows/c-c.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-c.yml b/.github/workflows/c-c.yml index 8625079..67ef370 100644 --- a/.github/workflows/c-c.yml +++ b/.github/workflows/c-c.yml @@ -39,7 +39,7 @@ jobs: - id: build-fuzzers name: Build Fuzzers run: | - export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" + export cifuzz_DIR="$D:\fuzztest\TcpServer\.cifuzz-build\logs" cd $CHECKOUT_DIR/ $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ --commit $GITHUB_SHA \ From e7b9a0844d6d26f86049130a39f9eebb9dcd8ba8 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:16:45 +0200 Subject: [PATCH 011/211] cheg --- CMakeUserPresets.json | 100 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 CMakeUserPresets.json diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..e507671 --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,100 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 20, + "patch": 0 + }, + "configurePresets": [ + { + "name": "cifuzz (Coverage)", + "displayName": "cifuzz (Coverage)", + "binaryDir": "${sourceDir}/.cifuzz-build/replayer/gcov", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "replayer", + "CIFUZZ_SANITIZERS": "gcov", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + } + }, + { + "name": "cifuzz (Fuzzing)", + "displayName": "cifuzz (Fuzzing)", + "binaryDir": "${sourceDir}/.cifuzz-build/libfuzzer/address+undefined", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "libfuzzer", + "CIFUZZ_SANITIZERS": "address;undefined", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + }, + "environment": { + "CC": "clang", + "CXX": "clang++" + } + }, + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "binaryDir": "${sourceDir}/.cifuzz-build/replayer/address+undefined", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "replayer", + "CIFUZZ_SANITIZERS": "address;undefined", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + } + } + ], + "buildPresets": [ + { + "name": "cifuzz (Coverage)", + "displayName": "cifuzz (Coverage)", + "configurePreset": "cifuzz (Coverage)", + "configuration": "RelWithDebInfo" + }, + { + "name": "cifuzz (Fuzzing)", + "displayName": "cifuzz (Fuzzing)", + "configurePreset": "cifuzz (Fuzzing)", + "configuration": "RelWithDebInfo" + }, + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "configurePreset": "cifuzz (Regression Test)", + "configuration": "RelWithDebInfo" + } + ], + "testPresets": [ + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "configurePreset": "cifuzz (Regression Test)", + "filter": { + "include": { + "label": "^cifuzz_regression_test$" + } + } + } + ] +} From 3c5888a5bbad13c946a4af0ecf46d9f48292c01b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:19:11 +0200 Subject: [PATCH 012/211] output --- .cifuzz-build/logs/build-my_fuzz_test.log | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.cifuzz-build/logs/build-my_fuzz_test.log b/.cifuzz-build/logs/build-my_fuzz_test.log index e69de29..3d17c87 100644 --- a/.cifuzz-build/logs/build-my_fuzz_test.log +++ b/.cifuzz-build/logs/build-my_fuzz_test.log @@ -0,0 +1,6 @@ + + ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000d95838 at pc 0x000000523dea bp 0x7fff5cf6f100 sp 0x7fff5cf6e8c8 + WRITE of size 9 at 0x602000d95838 thread T0 + #0 0x523de9 in __asan_memcpy (/home/demo/repos/quick-start/c_cpp/cmake/.cifuzz-build/libfuzzer/address+undefined/my_fuzz_test+0x523de9) + #1 0x559763 in exploreMe(int, int, std::__cxx11::basic_string, std::allocator >) /home/demo/repos/quick-start/c_cpp/cmake/src/explore_me.cpp:14:11 + \ No newline at end of file From f5a4781ab8a90b8b13940c176fd31d671185f282 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:23:17 +0200 Subject: [PATCH 013/211] Update manual.yml --- .github/workflows/manual.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 26e1b99..fa9696c 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -36,9 +36,7 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: initialize-fuzzer - run: | - cifuzz init + - id: build-fuzzers name: Build Fuzzers run: | From 282333e9cf41f0c2888b91220e773b18c07a4fc6 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:24:55 +0200 Subject: [PATCH 014/211] deliting cmkea --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a87d8f..6a5bc31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,5 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) + target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From abd00a24edfab2c8cbb985df11ad945074aa1cfd Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:25:40 +0200 Subject: [PATCH 015/211] del --- .github/workflows/cmake.yml | 37 ---------------- .github/workflows/manual.yml | 85 ------------------------------------ 2 files changed, 122 deletions(-) delete mode 100644 .github/workflows/cmake.yml delete mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index cf8e1ce..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CMake - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml deleted file mode 100644 index 26e1b99..0000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: CI Fuzz -# Set an action secret called "CI_FUZZ_API_TOKEN" with an API token -# generated in CI Fuzz web interface. - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # The fuzzing server gRPC URL. - FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL. - WEB_APP_ADDRESS: https://app.code-intelligence.com - # Directory in which the repository will be cloned. - CHECKOUT_DIR: checkout-dir/ - CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" - CIFUZZ_INSTALL_DIR: ./cifuzz - FUZZING_ARTIFACT: fuzzing-artifact.tar.gz -jobs: - fuzz_tests: - runs-on: ubuntu-latest - # Configure your build environment here - # container: example/docker_image - steps: - - id: checkout - name: Checkout Repository - uses: actions/checkout@v2 - with: - path: ${{ env.CHECKOUT_DIR }} - - id: install-cifuzz - name: Install cifuzz - run: | - curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" - chmod u+x cifuzz_installer - ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: initialize-fuzzer - run: | - cifuzz init - - id: build-fuzzers - name: Build Fuzzers - run: | - export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" - cd $CHECKOUT_DIR/ - $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ - --commit $GITHUB_SHA \ - --branch $GITHUB_REF_NAME \ - --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - shell: "bash" - - id: start-fuzzing - name: Start Fuzzing - uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} - checkout_directory: ${{ env.CHECKOUT_DIR }} - - id: monitor-fuzzing - name: Fuzzing - uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: save-results - name: Save Fuzz Test Results - uses: CodeIntelligenceTesting/github-actions/save-results@v5 - if: ${{ success() || failure() }} - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: upload-artifact - uses: actions/upload-artifact@v2 - if: ${{ (success() || failure()) }} - with: - name: ci_fuzz_results - path: | - findings.json - coverage.json - web_app_address.txt From e0a9b5c5e52625949e97e9b98e4a72339802d6ed Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:29:22 +0200 Subject: [PATCH 016/211] adding actions fuzz --- .../workflows/{c-c.yml => fuzzActions.yml} | 0 .github/workflows/manual.yml | 83 ------------------- 2 files changed, 83 deletions(-) rename .github/workflows/{c-c.yml => fuzzActions.yml} (100%) delete mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/c-c.yml b/.github/workflows/fuzzActions.yml similarity index 100% rename from .github/workflows/c-c.yml rename to .github/workflows/fuzzActions.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml deleted file mode 100644 index fa9696c..0000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: CI Fuzz -# Set an action secret called "CI_FUZZ_API_TOKEN" with an API token -# generated in CI Fuzz web interface. - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # The fuzzing server gRPC URL. - FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL. - WEB_APP_ADDRESS: https://app.code-intelligence.com - # Directory in which the repository will be cloned. - CHECKOUT_DIR: checkout-dir/ - CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" - CIFUZZ_INSTALL_DIR: ./cifuzz - FUZZING_ARTIFACT: fuzzing-artifact.tar.gz -jobs: - fuzz_tests: - runs-on: ubuntu-latest - # Configure your build environment here - # container: example/docker_image - steps: - - id: checkout - name: Checkout Repository - uses: actions/checkout@v2 - with: - path: ${{ env.CHECKOUT_DIR }} - - id: install-cifuzz - name: Install cifuzz - run: | - curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" - chmod u+x cifuzz_installer - ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - - id: build-fuzzers - name: Build Fuzzers - run: | - export cifuzz_DIR="$GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/share/cmake" - cd $CHECKOUT_DIR/ - $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ - --commit $GITHUB_SHA \ - --branch $GITHUB_REF_NAME \ - --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - shell: "bash" - - id: start-fuzzing - name: Start Fuzzing - uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} - checkout_directory: ${{ env.CHECKOUT_DIR }} - - id: monitor-fuzzing - name: Fuzzing - uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: save-results - name: Save Fuzz Test Results - uses: CodeIntelligenceTesting/github-actions/save-results@v5 - if: ${{ success() || failure() }} - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: upload-artifact - uses: actions/upload-artifact@v2 - if: ${{ (success() || failure()) }} - with: - name: ci_fuzz_results - path: | - findings.json - coverage.json - web_app_address.txt From fcf2467c5f73781714f11ea4bc790d40e44e9283 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:32:41 +0200 Subject: [PATCH 017/211] adding buit my fuzz --- .github/workflows/fuzzActions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 67ef370..7b7188e 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -36,7 +36,7 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: build-fuzzers + - id: build-myfuzzers name: Build Fuzzers run: | export cifuzz_DIR="$D:\fuzztest\TcpServer\.cifuzz-build\logs" From ab238abbaba0ea30313d32055e02e074a69596aa Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:35:03 +0200 Subject: [PATCH 018/211] del --- .github/workflows/fuzzActions.yml | 46 ++----------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 7b7188e..e3309f6 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -36,47 +36,5 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: build-myfuzzers - name: Build Fuzzers - run: | - export cifuzz_DIR="$D:\fuzztest\TcpServer\.cifuzz-build\logs" - cd $CHECKOUT_DIR/ - $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ - --commit $GITHUB_SHA \ - --branch $GITHUB_REF_NAME \ - --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - shell: "bash" - - id: start-fuzzing - name: Start Fuzzing - uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} - checkout_directory: ${{ env.CHECKOUT_DIR }} - - id: monitor-fuzzing - name: Fuzzing - uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: save-results - name: Save Fuzz Test Results - uses: CodeIntelligenceTesting/github-actions/save-results@v5 - if: ${{ success() || failure() }} - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - dashboard_address: ${{ env.WEB_APP_ADDRESS }} - - id: upload-artifact - uses: actions/upload-artifact@v2 - if: ${{ (success() || failure()) }} - with: - name: ci_fuzz_results - path: | - findings.json - coverage.json - web_app_address.txt + + \ No newline at end of file From 4c7ef4c273b2c17f2861b9266cfbca510826e363 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:36:44 +0200 Subject: [PATCH 019/211] add --- .github/workflows/fuzzActions.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index e3309f6..7c9494f 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -36,5 +36,14 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - + - id: build-myfuzzers + name: Build Fuzzers + run: | + export cifuzz_DIR="$D:\fuzztest\TcpServer\.cifuzz-build\logs" + cd $CHECKOUT_DIR/ + $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ + --commit $GITHUB_SHA \ + --branch $GITHUB_REF_NAME \ + --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT + shell: "bash" \ No newline at end of file From b57c51269cb5ed0928799206875b98da20f788d6 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:37:55 +0200 Subject: [PATCH 020/211] t --- .github/workflows/fuzzActions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 7c9494f..1ff7fb7 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -45,5 +45,5 @@ jobs: --commit $GITHUB_SHA \ --branch $GITHUB_REF_NAME \ --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - shell: "bash" + \ No newline at end of file From 9af6f240689acb71dfcab27fa9eff6661b6f1443 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:47:07 +0200 Subject: [PATCH 021/211] adding_start --- .github/workflows/fuzzActions.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 1ff7fb7..d656c86 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -45,5 +45,12 @@ jobs: --commit $GITHUB_SHA \ --branch $GITHUB_REF_NAME \ --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - + - id: start-fuzzing + name: Start Fuzzing + uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 + with: + ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} + fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} + fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} + checkout_directory: ${{ env.CHECKOUT_DIR }} \ No newline at end of file From beac315223fc055c2ec369c6ed814cd8e21b2dad Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:50:43 +0200 Subject: [PATCH 022/211] adding yml --- .github/workflows/fuzzActions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index d656c86..54ede16 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -39,7 +39,7 @@ jobs: - id: build-myfuzzers name: Build Fuzzers run: | - export cifuzz_DIR="$D:\fuzztest\TcpServer\.cifuzz-build\logs" + export cifuzz_DIR="$D:\fuzztest\TcpServer\cifuzz.yaml" cd $CHECKOUT_DIR/ $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ --commit $GITHUB_SHA \ From 4842fd2f986592c0a2459349e2a8623a558759e4 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 22:54:37 +0200 Subject: [PATCH 023/211] adding Integrator --- .github/workflows/fuzzActions.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 54ede16..30c0901 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -36,6 +36,11 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + + - id: integratormake + name: create Integrator + run: | + cifuzz integrate cmake - id: build-myfuzzers name: Build Fuzzers run: | From e1884a50fe31c0319f9b0608626c0966e4ee4acf Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:00:05 +0200 Subject: [PATCH 024/211] run1 --- .github/workflows/fuzzActions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 30c0901..17b1628 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -40,7 +40,7 @@ jobs: - id: integratormake name: create Integrator run: | - cifuzz integrate cmake + cifuzz create cpp -o "$D:\fuzztest\TcpServer\test\my_fuzz_test.cpp" - id: build-myfuzzers name: Build Fuzzers run: | From 4c1f79f92e177948f371439093c0272d198a28b1 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:02:11 +0200 Subject: [PATCH 025/211] cc --- .github/workflows/fuzzActions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 17b1628..5261169 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -40,7 +40,7 @@ jobs: - id: integratormake name: create Integrator run: | - cifuzz create cpp -o "$D:\fuzztest\TcpServer\test\my_fuzz_test.cpp" + cpp -o "$D:\fuzztest\TcpServer\test\my_fuzz_test.cpp" - id: build-myfuzzers name: Build Fuzzers run: | From 1db36699108f881499f73b771fc4619265958f95 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:08:34 +0200 Subject: [PATCH 026/211] err --- .cifuzz-build/logs/build-my_fuzz_test.log | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.cifuzz-build/logs/build-my_fuzz_test.log b/.cifuzz-build/logs/build-my_fuzz_test.log index 3d17c87..e69de29 100644 --- a/.cifuzz-build/logs/build-my_fuzz_test.log +++ b/.cifuzz-build/logs/build-my_fuzz_test.log @@ -1,6 +0,0 @@ - - ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000d95838 at pc 0x000000523dea bp 0x7fff5cf6f100 sp 0x7fff5cf6e8c8 - WRITE of size 9 at 0x602000d95838 thread T0 - #0 0x523de9 in __asan_memcpy (/home/demo/repos/quick-start/c_cpp/cmake/.cifuzz-build/libfuzzer/address+undefined/my_fuzz_test+0x523de9) - #1 0x559763 in exploreMe(int, int, std::__cxx11::basic_string, std::allocator >) /home/demo/repos/quick-start/c_cpp/cmake/src/explore_me.cpp:14:11 - \ No newline at end of file From 0c464bc48b13553396c9817b7eb8da18cf876229 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:10:28 +0200 Subject: [PATCH 027/211] ren --- .github/workflows/fuzzActions.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index 5261169..e7eecd9 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -41,21 +41,5 @@ jobs: name: create Integrator run: | cpp -o "$D:\fuzztest\TcpServer\test\my_fuzz_test.cpp" - - id: build-myfuzzers - name: Build Fuzzers - run: | - export cifuzz_DIR="$D:\fuzztest\TcpServer\cifuzz.yaml" - cd $CHECKOUT_DIR/ - $GITHUB_WORKSPACE/$CIFUZZ_INSTALL_DIR/bin/cifuzz bundle \ - --commit $GITHUB_SHA \ - --branch $GITHUB_REF_NAME \ - --output $GITHUB_WORKSPACE/$CHECKOUT_DIR/$FUZZING_ARTIFACT - - id: start-fuzzing - name: Start Fuzzing - uses: CodeIntelligenceTesting/github-actions/start-fuzzing@v5 - with: - ci_fuzz_api_token: ${{ secrets.CI_FUZZ_API_TOKEN }} - fuzzing_server_address: ${{ env.FUZZING_SERVER_ADDRESS }} - fuzzing_artifact: ${{ env.CHECKOUT_DIR }}/${{ env.FUZZING_ARTIFACT }} - checkout_directory: ${{ env.CHECKOUT_DIR }} + - \ No newline at end of file From a10447dab8e4bad7c570302f64f9693107ab17b8 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:12:29 +0200 Subject: [PATCH 028/211] ch --- .github/workflows/fuzzActions.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index e7eecd9..dd5d7c2 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -37,9 +37,4 @@ jobs: chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: integratormake - name: create Integrator - run: | - cpp -o "$D:\fuzztest\TcpServer\test\my_fuzz_test.cpp" - - - \ No newline at end of file + \ No newline at end of file From 0baaea6b63867950b8af80186ca4695fbc0e1c54 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:12:39 +0200 Subject: [PATCH 029/211] chaing --- .github/workflows/fuzzActions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml index dd5d7c2..6a20c6e 100644 --- a/.github/workflows/fuzzActions.yml +++ b/.github/workflows/fuzzActions.yml @@ -36,5 +36,7 @@ jobs: curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + + \ No newline at end of file From 6c888286237a4d544999629f6617aa6b430ea74d Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:41:54 +0200 Subject: [PATCH 030/211] newActions --- .github/workflows/Vulnerability.yml | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/Vulnerability.yml diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml new file mode 100644 index 0000000..9d3d30a --- /dev/null +++ b/.github/workflows/Vulnerability.yml @@ -0,0 +1,89 @@ +name: Vulnerability Assessment + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: [ main ] + +env: + # The fuzzing server gRPC URL. + FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 + # The fuzzing server HTTP URL. + WEB_APP_ADDRESS: https://app.code-intelligence.com + # Directory in which the repository will be cloned. + CHECKOUT_DIR: checkout-dir/ + CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" + CIFUZZ_INSTALL_DIR: ./cifuzz + FUZZING_ARTIFACT: fuzzing-artifact.tar.gz + +jobs: + fuzz-test: + runs-on: ubuntu-latest + + steps: + - id: Checkout-Repo + name: Checkout Repository + uses: actions/checkout@v2 + with: + path: ${{ env.CHECKOUT_DIR }} + - id: install-cifuzz + name: Install cifuzz + run: | + curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" + chmod u+x cifuzz_installer + ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + + - id: Envs + name: Setup Environment + run: | + # Set up the necessary dependencies and environment for the fuzz test + # Install any required packages or tools + # Example commands: + # - sudo apt-get update + # - sudo apt-get install + + - name: Build Server + run: | + # Build the server application + # Replace the command with the actual build command for your server application + # Example command: + # - g++ server.cpp -o server + + - name: Build Client + run: | + # Build the client application + # Replace the command with the actual build command for your client application + # Example command: + # - g++ client.cpp -o client + + - name: Start Server + run: | + # Start the server before running the fuzz test + # Replace the command with the actual command to start the server + # Example command: + # - ./server + + - name: Run Fuzz Test + run: | + # Run the fuzz test on the client application + # Replace the command with the actual fuzz test command for your client application + # Example command: + # - ./client + + - name: Save Fuzz Test Results + if: always() + run: | + # Save the fuzz test results to an artifact or a file for further analysis + # Replace the command with the necessary steps to save the results + # Example command: + # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt + + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: + name: Fuzz Test Results + path: # Replace with the actual path to the fuzz test results From 797e33a6f7e47c1637c5c9e4cc07cdc7c86b8115 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:42:06 +0200 Subject: [PATCH 031/211] DelFuzz --- .github/workflows/fuzzActions.yml | 42 ------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/fuzzActions.yml diff --git a/.github/workflows/fuzzActions.yml b/.github/workflows/fuzzActions.yml deleted file mode 100644 index 6a20c6e..0000000 --- a/.github/workflows/fuzzActions.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: CI Fuzz -# Set an action secret called "CI_FUZZ_API_TOKEN" with an API token -# generated in CI Fuzz web interface. - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # The fuzzing server gRPC URL. - FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL. - WEB_APP_ADDRESS: https://app.code-intelligence.com - # Directory in which the repository will be cloned. - CHECKOUT_DIR: checkout-dir/ - CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" - CIFUZZ_INSTALL_DIR: ./cifuzz - FUZZING_ARTIFACT: fuzzing-artifact.tar.gz -jobs: - fuzz_tests: - runs-on: ubuntu-latest - # Configure your build environment here - # container: example/docker_image - steps: - - id: checkout - name: Checkout Repository - uses: actions/checkout@v2 - with: - path: ${{ env.CHECKOUT_DIR }} - - id: install-cifuzz - name: Install cifuzz - run: | - curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" - chmod u+x cifuzz_installer - ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - - - \ No newline at end of file From 0920b1d69f0ca4ad407a4d2bfd3fe3cc26b1fb87 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:44:08 +0200 Subject: [PATCH 032/211] mod --- .github/workflows/Vulnerability.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9d3d30a..57290c1 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -44,9 +44,9 @@ jobs: # Example commands: # - sudo apt-get update # - sudo apt-get install - - - name: Build Server - run: | + - id: Build + name: Build Server + run: | # Build the server application # Replace the command with the actual build command for your server application # Example command: From 159f60b259d104def220de760a2098e931e5cb63 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:49:27 +0200 Subject: [PATCH 033/211] Create cmake.yml --- .github/workflows/cmake.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..cf8e1ce --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,37 @@ +name: CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + From 69713329f5a420a66c74af410ef8810feac95872 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:57:10 +0200 Subject: [PATCH 034/211] addng --- .github/workflows/Vulnerability.yml | 19 +++++++++++++++ .github/workflows/cmake.yml | 37 ----------------------------- 2 files changed, 19 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 57290c1..5454e9c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -18,6 +18,7 @@ env: CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" CIFUZZ_INSTALL_DIR: ./cifuzz FUZZING_ARTIFACT: fuzzing-artifact.tar.gz + BUILD_TYPE: Release jobs: fuzz-test: @@ -29,6 +30,24 @@ jobs: uses: actions/checkout@v2 with: path: ${{ env.CHECKOUT_DIR }} + + - id: CmakeConfig + name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + - id: BuilCmake + name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - id: TesCmake + name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + - id: install-cifuzz name: Install cifuzz run: | diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index cf8e1ce..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CMake - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - From 2432b1cf3702e7e73b2cf11454a83210cfbf29f5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 23:58:54 +0200 Subject: [PATCH 035/211] t --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5454e9c..5755043 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -24,7 +24,7 @@ jobs: fuzz-test: runs-on: ubuntu-latest - steps: +steps: - id: Checkout-Repo name: Checkout Repository uses: actions/checkout@v2 From 253b969829738178819ef454b4b8aff426b03f2e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:00:49 +0200 Subject: [PATCH 036/211] test --- .github/workflows/Vulnerability.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5755043..b5241c9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -23,8 +23,7 @@ env: jobs: fuzz-test: runs-on: ubuntu-latest - -steps: + steps: - id: Checkout-Repo name: Checkout Repository uses: actions/checkout@v2 From d3b4e86ec8214ee4155084ede81cda0a6218b14b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:04:08 +0200 Subject: [PATCH 037/211] sum --- .github/workflows/Vulnerability.yml | 38 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index b5241c9..f5dc885 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -32,19 +32,20 @@ jobs: - id: CmakeConfig name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + - id: BuilCmake name: Build - # Build your program with the given configuration + # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - id: TesCmake name: Test working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{env.BUILD_TYPE}} - id: install-cifuzz @@ -62,6 +63,7 @@ jobs: # Example commands: # - sudo apt-get update # - sudo apt-get install + - id: Build name: Build Server run: | @@ -70,38 +72,38 @@ jobs: # Example command: # - g++ server.cpp -o server - - name: Build Client - run: | + - name: Build Client + run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: # - g++ client.cpp -o client - - name: Start Server - run: | + - name: Start Server + run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: # - ./server - - name: Run Fuzz Test - run: | + - name: Run Fuzz Test + run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application # Example command: # - ./client - - name: Save Fuzz Test Results - if: always() - run: | + - name: Save Fuzz Test Results + if: always() + run: | # Save the fuzz test results to an artifact or a file for further analysis # Replace the command with the necessary steps to save the results # Example command: # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt - - name: Upload Fuzz Test Results - if: always() - uses: actions/upload-artifact@v2 - with: + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: name: Fuzz Test Results path: # Replace with the actual path to the fuzz test results From d45b251d198cb4ef2535b0fddf4b9dc99d0e0a39 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:20:19 +0200 Subject: [PATCH 038/211] cpcommand --- .github/workflows/Vulnerability.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f5dc885..ab2bbaa 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -34,13 +34,19 @@ jobs: name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - id: BuilCmake name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - + + - id: CopyCmake + name: Copy CMakeLists.txt + run: | + cp TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt + - id: TesCmake name: Test working-directory: ${{github.workspace}}/build From 0d4a6a4e00b6ad5f52f8b49b61f6c0c11afc617d Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:21:47 +0200 Subject: [PATCH 039/211] inde --- .github/workflows/Vulnerability.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index ab2bbaa..5ac7ffe 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -29,7 +29,12 @@ jobs: uses: actions/checkout@v2 with: path: ${{ env.CHECKOUT_DIR }} - + + - id: CopyCmake + name: Copy CMakeLists.txt + run: | + cp TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt + - id: CmakeConfig name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. @@ -42,11 +47,7 @@ jobs: # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - id: CopyCmake - name: Copy CMakeLists.txt - run: | - cp TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt - + - id: TesCmake name: Test working-directory: ${{github.workspace}}/build From f93ffec8da2c3ba3a7512f4b7f83bc0ab379e681 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:24:05 +0200 Subject: [PATCH 040/211] tcp --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5ac7ffe..e780b5c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -33,7 +33,7 @@ jobs: - id: CopyCmake name: Copy CMakeLists.txt run: | - cp TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt + cp https://github.com/gladzeka/TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt - id: CmakeConfig name: Configure CMake From 09afeced7b34bc0ff5dc5ab4784b1f58fa4a071f Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:30:01 +0200 Subject: [PATCH 041/211] usage --- .github/workflows/Vulnerability.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index e780b5c..f61b9b0 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -30,11 +30,20 @@ jobs: with: path: ${{ env.CHECKOUT_DIR }} - - id: CopyCmake - name: Copy CMakeLists.txt + + + - id: DownloadCmake + name: Download CMakeLists.txt run: | - cp https://github.com/gladzeka/TcpServer/CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt - + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - id: Destinat + name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/TcpServer + - id: Copy + name: Copy CMakeLists.txt + run: cp CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt + - id: CmakeConfig name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From d016786c43c1b0ec6aedaa7e2761a7d5c48da640 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:31:52 +0200 Subject: [PATCH 042/211] rmv --- .github/workflows/Vulnerability.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f61b9b0..6cdce2f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -40,10 +40,8 @@ jobs: - id: Destinat name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/TcpServer - - id: Copy - name: Copy CMakeLists.txt - run: cp CMakeLists.txt /home/runner/work/TcpServer/TcpServer/CMakeLists.txt - + + - id: CmakeConfig name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From a302236d2cef364a40f3028181c3c60a04489409 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:38:22 +0200 Subject: [PATCH 043/211] tt --- .github/workflows/Vulnerability.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6cdce2f..b07034e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -29,8 +29,10 @@ jobs: uses: actions/checkout@v2 with: path: ${{ env.CHECKOUT_DIR }} - - + - id: SetupCmake + name: Setup Cmake + run: | + sudo apt-get install -y cmake - id: DownloadCmake name: Download CMakeLists.txt From af6791614b1a567b90a24cbe756448f32a47adae Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:40:30 +0200 Subject: [PATCH 044/211] w --- .github/workflows/Vulnerability.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index b07034e..63a1eb2 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -43,19 +43,7 @@ jobs: name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/TcpServer - - - id: CmakeConfig - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - id: BuilCmake - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - + - id: TesCmake name: Test From 7576aec727ece834675e9c9a515647fbee4ffecc Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:41:53 +0200 Subject: [PATCH 045/211] e --- .github/workflows/Vulnerability.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 63a1eb2..f0d5b15 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -44,13 +44,7 @@ jobs: run: mkdir -p /home/runner/work/TcpServer/TcpServer - - - id: TesCmake - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + - id: install-cifuzz name: Install cifuzz From 2a54f5f8a6b32ae0301e68f6dccf7aa44759db2a Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:43:13 +0200 Subject: [PATCH 046/211] cod --- .github/workflows/Vulnerability.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f0d5b15..acbfd62 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -59,8 +59,8 @@ jobs: # Set up the necessary dependencies and environment for the fuzz test # Install any required packages or tools # Example commands: - # - sudo apt-get update - # - sudo apt-get install + - sudo apt-get update + - sudo apt-get install - id: Build name: Build Server @@ -68,28 +68,28 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - # - g++ server.cpp -o server + - g++ server.cpp -o server - name: Build Client run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - # - g++ client.cpp -o client + - g++ client.cpp -o client - name: Start Server run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - # - ./server + - ./server - name: Run Fuzz Test run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application # Example command: - # - ./client + - ./client - name: Save Fuzz Test Results if: always() From 94e94699f948baaafd0f5e2dc5309637d324e858 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:44:08 +0200 Subject: [PATCH 047/211] en --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index acbfd62..23f2917 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,7 @@ jobs: # Build the client application # Replace the command with the actual build command for your client application # Example command: - - g++ client.cpp -o client + - g++ client.cpp -o client - name: Start Server run: | From 798b9b0340d9fcfb6dfd176d8dfcb3d021e6ac22 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:45:04 +0200 Subject: [PATCH 048/211] car --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 23f2917..a617f04 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,7 @@ jobs: # Build the client application # Replace the command with the actual build command for your client application # Example command: - - g++ client.cpp -o client + # - g++ client.cpp -o client - name: Start Server run: | From 0b57f8e8ff13e546df6e0e20f816845279b75a0c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:46:15 +0200 Subject: [PATCH 049/211] rnn --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index a617f04..328a2cd 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -82,7 +82,7 @@ jobs: # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - - ./server + ./server - name: Run Fuzz Test run: | From 258610ebe6795f8796b78ef2de624cf6a4657cb0 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:47:04 +0200 Subject: [PATCH 050/211] beeeeg --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 328a2cd..814e3c1 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,7 @@ jobs: # Build the client application # Replace the command with the actual build command for your client application # Example command: - # - g++ client.cpp -o client + #- g++ client.cpp -o client - name: Start Server run: | From 498c6e5979992fdd0aba395e1804180ef764237a Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:48:23 +0200 Subject: [PATCH 051/211] sudo --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 814e3c1..20ff674 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -59,8 +59,8 @@ jobs: # Set up the necessary dependencies and environment for the fuzz test # Install any required packages or tools # Example commands: - - sudo apt-get update - - sudo apt-get install + sudo apt-get update + sudo apt-get install - id: Build name: Build Server From 5d42b7a28ae10dc66273ed62674d9b9e37e1e368 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:50:41 +0200 Subject: [PATCH 052/211] py --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 20ff674..bf67f69 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -60,7 +60,7 @@ jobs: # Install any required packages or tools # Example commands: sudo apt-get update - sudo apt-get install + sudo apt-get install cmake - id: Build name: Build Server From b43bc8f42b8b80585dad110ab202e931fcfdfb0d Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:51:03 +0200 Subject: [PATCH 053/211] removepy --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index bf67f69..40c25f9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -60,7 +60,7 @@ jobs: # Install any required packages or tools # Example commands: sudo apt-get update - sudo apt-get install cmake + - id: Build name: Build Server From 676af9f76cb71dde87370f3b87ff946f833a6bf5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:52:29 +0200 Subject: [PATCH 054/211] many --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 40c25f9..079fb78 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,14 +68,14 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - - g++ server.cpp -o server + g++ server.cpp -o server - name: Build Client run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - #- g++ client.cpp -o client + g++ client.cpp -o client - name: Start Server run: | From d160b0d766f382fcc96bc81b43582d02a630e7e5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 00:57:58 +0200 Subject: [PATCH 055/211] more_ --- .github/workflows/Vulnerability.yml | 6 +++--- .vscode/settings.json | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 079fb78..8f755ca 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,21 +68,21 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ server.cpp -o server + g++ ${{ env.CHECKOUT_DIR }}/server.cpp -o ${{ env.CHECKOUT_DIR }}/server - name: Build Client run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - g++ client.cpp -o client + g++ ${{ env.CHECKOUT_DIR }}/client.cpp -o ${{ env.CHECKOUT_DIR }}/client - name: Start Server run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - ./server + ${{ env.CHECKOUT_DIR }}/server - name: Run Fuzz Test run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 0db5873..e804c3c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,9 @@ { - "cmake.configureOnOpen": true + "cmake.configureOnOpen": true, + "files.associations": { + "*.yml": "cpp", + "chrono": "cpp", + "system_error": "cpp", + "xlocale": "cpp" + } } \ No newline at end of file From 6c3a2a97642f6560e3ad49ee616c32cd040de94a Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:01:15 +0200 Subject: [PATCH 056/211] tcp --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8f755ca..bc624ee 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,7 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ ${{ env.CHECKOUT_DIR }}/server.cpp -o ${{ env.CHECKOUT_DIR }}/server + g++ ${{ env.CHECKOUT_DIR }}TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/server - name: Build Client run: | From d2221fea69aae83efb59da4ae8f9720cf8cbaf03 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:04:05 +0200 Subject: [PATCH 057/211] tudo --- .github/workflows/Vulnerability.yml | 94 +++++++++++++---------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index bc624ee..53f36ff 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ -name: Vulnerability Assessment + name: Vulnerability Assessment on: workflow_dispatch: @@ -6,7 +6,8 @@ on: branches: - main pull_request: - branches: [ main ] + branches: + - main env: # The fuzzing server gRPC URL. @@ -23,85 +24,76 @@ env: jobs: fuzz-test: runs-on: ubuntu-latest + steps: - - id: Checkout-Repo - name: Checkout Repository - uses: actions/checkout@v2 - with: + - name: Checkout Repository + uses: actions/checkout@v2 + with: path: ${{ env.CHECKOUT_DIR }} - - id: SetupCmake - name: Setup Cmake - run: | - sudo apt-get install -y cmake - - id: DownloadCmake - name: Download CMakeLists.txt - run: | - curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - - - id: Destinat - name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/TcpServer + - name: Setup Cmake + run: | + sudo apt-get install -y cmake - - + - name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - - id: install-cifuzz - name: Install cifuzz - run: | + - name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/TcpServer + + - name: Install cifuzz + run: | curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer - ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - - id: Envs - name: Setup Environment - run: | + ./cifuzz_installer --install-dir ${{ env.CIFUZZ_INSTALL_DIR }} + + - name: Setup Environment + run: | # Set up the necessary dependencies and environment for the fuzz test # Install any required packages or tools # Example commands: - sudo apt-get update - - - - id: Build - name: Build Server - run: | + # sudo apt-get update + + - name: Build Server + run: | # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ ${{ env.CHECKOUT_DIR }}TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/server + g++ ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server - - name: Build Client - run: | + - name: Build Client + run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - g++ ${{ env.CHECKOUT_DIR }}/client.cpp -o ${{ env.CHECKOUT_DIR }}/client + g++ ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client - - name: Start Server - run: | + - name: Start Server + run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - ${{ env.CHECKOUT_DIR }}/server + ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server - - name: Run Fuzz Test - run: | + - name: Run Fuzz Test + run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application # Example command: - - ./client + ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client - - name: Save Fuzz Test Results - if: always() - run: | + - name: Save Fuzz Test Results + if: always() + run: | # Save the fuzz test results to an artifact or a file for further analysis # Replace the command with the necessary steps to save the results # Example command: # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt - - name: Upload Fuzz Test Results - if: always() - uses: actions/upload-artifact@v2 - with: + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: name: Fuzz Test Results path: # Replace with the actual path to the fuzz test results From d90fdb67bd8b45a7d941a3b1960fe0f838e1330a Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:05:06 +0200 Subject: [PATCH 058/211] ggg --- .github/workflows/Vulnerability.yml | 92 ++++++++++++++++------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 53f36ff..81cfe42 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -6,8 +6,7 @@ on: branches: - main pull_request: - branches: - - main + branches: [ main ] env: # The fuzzing server gRPC URL. @@ -24,76 +23,85 @@ env: jobs: fuzz-test: runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: + - id: Checkout-Repo + name: Checkout Repository + uses: actions/checkout@v2 + with: path: ${{ env.CHECKOUT_DIR }} + - id: SetupCmake + name: Setup Cmake + run: | + sudo apt-get install -y cmake - - name: Setup Cmake - run: | - sudo apt-get install -y cmake + - id: DownloadCmake + name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - id: Destinat + name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/TcpServer - - name: Download CMakeLists.txt - run: | - curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - - name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/TcpServer - - - name: Install cifuzz - run: | + - id: install-cifuzz + name: Install cifuzz + run: | curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer - ./cifuzz_installer --install-dir ${{ env.CIFUZZ_INSTALL_DIR }} - - - name: Setup Environment - run: | + ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + + - id: Envs + name: Setup Environment + run: | # Set up the necessary dependencies and environment for the fuzz test # Install any required packages or tools # Example commands: - # sudo apt-get update - - - name: Build Server - run: | + sudo apt-get update + + + - id: Build + name: Build Server + run: | # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server + g++ ${{ env.CHECKOUT_DIR }}TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/server - - name: Build Client - run: | + - name: Build Client + run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - g++ ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client + g++ ${{ env.CHECKOUT_DIR }}/client.cpp -o ${{ env.CHECKOUT_DIR }}/client - - name: Start Server - run: | + - name: Start Server + run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/server + ${{ env.CHECKOUT_DIR }}/server - - name: Run Fuzz Test - run: | + - name: Run Fuzz Test + run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application # Example command: - ${{ env.CHECKOUT_DIR }}TcpServer/TcpServer/client + - ./client - - name: Save Fuzz Test Results - if: always() - run: | + - name: Save Fuzz Test Results + if: always() + run: | # Save the fuzz test results to an artifact or a file for further analysis # Replace the command with the necessary steps to save the results # Example command: # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt - - name: Upload Fuzz Test Results - if: always() - uses: actions/upload-artifact@v2 - with: + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: name: Fuzz Test Results path: # Replace with the actual path to the fuzz test results From 2bca4480dde9a2010a3d6512272c987b52e02174 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:06:18 +0200 Subject: [PATCH 059/211] ss --- .github/workflows/Vulnerability.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 81cfe42..5489b05 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ - name: Vulnerability Assessment +name: Vulnerability Assessment on: workflow_dispatch: @@ -68,21 +68,21 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ ${{ env.CHECKOUT_DIR }}TcpServer/server.cpp -o ${{ env.CHECKOUT_DIR }}TcpServer/server + g++ ${{ env.CHECKOUT_DIR }}/server.cpp -o ${{ env.CHECKOUT_DIR }}/server - name: Build Client run: | # Build the client application # Replace the command with the actual build command for your client application # Example command: - g++ ${{ env.CHECKOUT_DIR }}/client.cpp -o ${{ env.CHECKOUT_DIR }}/client + g++ client.cpp -o client - name: Start Server run: | # Start the server before running the fuzz test # Replace the command with the actual command to start the server # Example command: - ${{ env.CHECKOUT_DIR }}/server + ./server - name: Run Fuzz Test run: | From 1b5542c2d7115988e971d714b5eb0205aa077aef Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:08:59 +0200 Subject: [PATCH 060/211] cd --- .github/workflows/Vulnerability.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5489b05..83d9691 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,9 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - g++ ${{ env.CHECKOUT_DIR }}/server.cpp -o ${{ env.CHECKOUT_DIR }}/server + cd ${{ env.CHECKOUT_DIR }}/TcpServer/TcpServer + cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build --config ${{ env.BUILD_TYPE }} - name: Build Client run: | From 278dedb79bc394b5b2088511509b32674ea3bca3 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:19:23 +0200 Subject: [PATCH 061/211] bb --- .github/workflows/Vulnerability.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 83d9691..3e89c90 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,10 +68,12 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }}/TcpServer/TcpServer + cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh + ./build.sh cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} + - name: Build Client run: | # Build the client application From 46eaf623cdcdef9dd323a92cea80ef617fa9d64c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:20:44 +0200 Subject: [PATCH 062/211] # --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 3e89c90..cdaf596 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,7 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh + # cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh ./build.sh cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From 7f9d048add0939e2a9399d73b56c5b80f6c96b53 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:22:30 +0200 Subject: [PATCH 063/211] dubbio --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index cdaf596..848ebef 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -41,7 +41,7 @@ jobs: - id: Destinat name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/TcpServer + run: mkdir -p /home/runner/work/TcpServer/ From c8f458220a8af3fc687178525e363b82d47ef7d1 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:23:43 +0200 Subject: [PATCH 064/211] quindiiiiiiiiii --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 848ebef..d118697 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,8 +68,8 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - # cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh - ./build.sh + cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh + cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From 05ec0973526facb31abf84feee1ce1e62652523f Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Thu, 1 Jun 2023 01:25:47 +0200 Subject: [PATCH 065/211] zzz --- .github/workflows/Vulnerability.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index d118697..23dac00 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,8 +68,7 @@ jobs: # Build the server application # Replace the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }}/TcpServer/build.sh - + cd ${{ env.CHECKOUT_DIR }}/server cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From e74f95bf204ecb7a078e5edef50c97b98d6374d7 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Fri, 2 Jun 2023 15:25:46 +0200 Subject: [PATCH 066/211] many changes --- .cifuzz-build/logs/build-my_fuzz_test.log | 0 .github/workflows/Vulnerability.yml | 110 +++++++++++++++ .vscode/tasks.json | 28 ++++ CMakeLists.txt | 5 +- CMakeUserPresets.json | 100 ++++++++++++++ build.sh | 0 cifuzz.yaml | 46 +++++++ examples/client_example.cpp | 4 +- examples/myfuzztest.cpp | 155 ++++++++++++++++++++++ test/my_fuzz_test.cpp | 155 ++++++++++++++++++++++ 10 files changed, 601 insertions(+), 2 deletions(-) create mode 100644 .cifuzz-build/logs/build-my_fuzz_test.log create mode 100644 .github/workflows/Vulnerability.yml create mode 100644 .vscode/tasks.json create mode 100644 CMakeUserPresets.json mode change 100755 => 100644 build.sh create mode 100644 cifuzz.yaml create mode 100644 examples/myfuzztest.cpp create mode 100644 test/my_fuzz_test.cpp diff --git a/.cifuzz-build/logs/build-my_fuzz_test.log b/.cifuzz-build/logs/build-my_fuzz_test.log new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml new file mode 100644 index 0000000..23dac00 --- /dev/null +++ b/.github/workflows/Vulnerability.yml @@ -0,0 +1,110 @@ +name: Vulnerability Assessment + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: [ main ] + +env: + # The fuzzing server gRPC URL. + FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 + # The fuzzing server HTTP URL. + WEB_APP_ADDRESS: https://app.code-intelligence.com + # Directory in which the repository will be cloned. + CHECKOUT_DIR: checkout-dir/ + CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" + CIFUZZ_INSTALL_DIR: ./cifuzz + FUZZING_ARTIFACT: fuzzing-artifact.tar.gz + BUILD_TYPE: Release + +jobs: + fuzz-test: + runs-on: ubuntu-latest + steps: + - id: Checkout-Repo + name: Checkout Repository + uses: actions/checkout@v2 + with: + path: ${{ env.CHECKOUT_DIR }} + - id: SetupCmake + name: Setup Cmake + run: | + sudo apt-get install -y cmake + + - id: DownloadCmake + name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - id: Destinat + name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/ + + + + + - id: install-cifuzz + name: Install cifuzz + run: | + curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" + chmod u+x cifuzz_installer + ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR + + - id: Envs + name: Setup Environment + run: | + # Set up the necessary dependencies and environment for the fuzz test + # Install any required packages or tools + # Example commands: + sudo apt-get update + + + - id: Build + name: Build Server + run: | + # Build the server application + # Replace the command with the actual build command for your server application + # Example command: + cd ${{ env.CHECKOUT_DIR }}/server + cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build --config ${{ env.BUILD_TYPE }} + + + - name: Build Client + run: | + # Build the client application + # Replace the command with the actual build command for your client application + # Example command: + g++ client.cpp -o client + + - name: Start Server + run: | + # Start the server before running the fuzz test + # Replace the command with the actual command to start the server + # Example command: + ./server + + - name: Run Fuzz Test + run: | + # Run the fuzz test on the client application + # Replace the command with the actual fuzz test command for your client application + # Example command: + - ./client + + - name: Save Fuzz Test Results + if: always() + run: | + # Save the fuzz test results to an artifact or a file for further analysis + # Replace the command with the necessary steps to save the results + # Example command: + # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt + + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: + name: Fuzz Test Results + path: # Replace with the actual path to the fuzz test results diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..05054c5 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,28 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: g++ build active file", + "command": "/usr/bin/g++", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "Task generated by Debugger." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6795e26..6a5bc31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) -find_package (Threads) +find_package(cifuzz) +enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") @@ -38,5 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) + target_link_libraries(my_fuzz_test PRIVATE server_example) endif() diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..e507671 --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,100 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 20, + "patch": 0 + }, + "configurePresets": [ + { + "name": "cifuzz (Coverage)", + "displayName": "cifuzz (Coverage)", + "binaryDir": "${sourceDir}/.cifuzz-build/replayer/gcov", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "replayer", + "CIFUZZ_SANITIZERS": "gcov", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + } + }, + { + "name": "cifuzz (Fuzzing)", + "displayName": "cifuzz (Fuzzing)", + "binaryDir": "${sourceDir}/.cifuzz-build/libfuzzer/address+undefined", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "libfuzzer", + "CIFUZZ_SANITIZERS": "address;undefined", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + }, + "environment": { + "CC": "clang", + "CXX": "clang++" + } + }, + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "binaryDir": "${sourceDir}/.cifuzz-build/replayer/address+undefined", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CIFUZZ_ENGINE": "replayer", + "CIFUZZ_SANITIZERS": "address;undefined", + "CIFUZZ_TESTING": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_BUILD_RPATH_USE_ORIGIN": { + "type": "BOOL", + "value": "ON" + } + } + } + ], + "buildPresets": [ + { + "name": "cifuzz (Coverage)", + "displayName": "cifuzz (Coverage)", + "configurePreset": "cifuzz (Coverage)", + "configuration": "RelWithDebInfo" + }, + { + "name": "cifuzz (Fuzzing)", + "displayName": "cifuzz (Fuzzing)", + "configurePreset": "cifuzz (Fuzzing)", + "configuration": "RelWithDebInfo" + }, + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "configurePreset": "cifuzz (Regression Test)", + "configuration": "RelWithDebInfo" + } + ], + "testPresets": [ + { + "name": "cifuzz (Regression Test)", + "displayName": "cifuzz (Regression Test)", + "configurePreset": "cifuzz (Regression Test)", + "filter": { + "include": { + "label": "^cifuzz_regression_test$" + } + } + } + ] +} diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 diff --git a/cifuzz.yaml b/cifuzz.yaml new file mode 100644 index 0000000..4464473 --- /dev/null +++ b/cifuzz.yaml @@ -0,0 +1,46 @@ +## Configuration for a CI Fuzz project +## Generated on 2023-05-31 + +## The build system used to build this project. If not set, cifuzz tries +## to detect the build system automatically. +## Valid values: "bazel", "cmake", "maven", "gradle", "other". +#build-system: cmake + +## If the build system type is "other", this command is used by +## `cifuzz run` to build the fuzz test. +#build-command: "make my_fuzz_test" + +## Directories containing sample inputs for the code under test. +## See https://llvm.org/docs/LibFuzzer.html#corpus +#seed-corpus-dirs: +# - path/to/seed-corpus + +## A file containing input language keywords or other interesting byte +## sequences. +## See https://llvm.org/docs/LibFuzzer.html#dictionaries +#dict: path/to/dictionary.dct + +## Command-line arguments to pass to libFuzzer. +## See https://llvm.org/docs/LibFuzzer.html#options +#engine-args: +# - -rss_limit_mb=4096 + +## Maximum time to run fuzz tests. The default is to run indefinitely. +#timeout: 30m + +## By default, fuzz tests are executed in a sandbox to prevent accidental +## damage to the system. Set to false to run fuzz tests unsandboxed. +## Only supported on Linux. +#use-sandbox: false + +## Set to true to print output of the `cifuzz run` command as JSON. +#print-json: true + +## Set to true to disable desktop notifications +#no-notifications: true + +## Set URL of the CI App +#server: https://app.code-intelligence.com + +## Set the project name on the CI App +#project: my-project-1a2b3c4d diff --git a/examples/client_example.cpp b/examples/client_example.cpp index 64f4ea6..d6d48cb 100644 --- a/examples/client_example.cpp +++ b/examples/client_example.cpp @@ -2,7 +2,9 @@ /////////////////////CLIENT EXAMPLE//////////////////////// /////////////////////////////////////////////////////////// -#ifdef CLIENT_EXAMPLE +std::string message; +std::cin >> message; + #include #include diff --git a/examples/myfuzztest.cpp b/examples/myfuzztest.cpp new file mode 100644 index 0000000..13fc581 --- /dev/null +++ b/examples/myfuzztest.cpp @@ -0,0 +1,155 @@ +#ifdef SERVER_EXAMPLE + +#include +#include +#include +#include + +#include "../include/tcp_server.h" + +// declare the server +TcpServer server; + +// declare a server observer which will receive incomingPacketHandler messages. +// the server supports multiple observers +server_observer_t observer; + +bool shouldSaveMsg = false; +char msgBuffer[10] = {0}; + +std::mutex mtx; +std::condition_variable server_ready; +bool canAcceptNextClient = true; + +// observer callback. will be called for every new message received by clients +// with the requested IP address +void onIncomingMsg(const std::string &clientIP, const char *msg, size_t size) { + std::string msgStr = msg; + if (msgStr == "S") { + shouldSaveMsg = true; + } else if (shouldSaveMsg) { + if (strncmp(msgStr.c_str(), "M", 1) == 0) { + memcpy(msgBuffer, msg, size); + } + shouldSaveMsg = false; + } + // print client message + std::cout << "Observer1 got client msg: " << msgStr << "\n"; +} + +// observer callback. will be called when client disconnects +void onClientDisconnected(const std::string &ip, const std::string &msg) { + std::cout << "Client: " << ip << " disconnected. Reason: " << msg << "\n"; + { + std::lock_guard lock(mtx); + canAcceptNextClient = true; + server_ready.notify_one(); + } +} + +int main() { + // start server on port 65123 + pipe_ret_t startRet = server.start(65123); + if (startRet.isSuccessful()) { + std::cout << "Server setup succeeded\n"; + } else { + std::cout << "Server setup failed: " << startRet.message() << "\n"; + return EXIT_FAILURE; + } + + // configure and register observer + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onClientDisconnected; + observer.wantedIP = "127.0.0.1"; + server.subscribe(observer); + + while (true) { + acceptClient(); + { + std::lock_guard lock(mtx); + canAcceptNextClient = false; + } + std::unique_lock lock(mtx); + server_ready.wait(lock, [] { return canAcceptNextClient; }); + } + + return 0; +} + +#endif +/////////////////////////////////////////////////////////// +/////////////////////CLIENT EXAMPLE//////////////////////// +/////////////////////////////////////////////////////////// + +#ifdef CLIENT_EXAMPLE + +#include +#include +#include "../include/tcp_client.h" + +TcpClient client; + +// on sig_exit, close client +void sig_exit(int s) { + std::cout << "Closing client...\n"; + pipe_ret_t finishRet = client.close(); + if (finishRet.isSuccessful()) { + std::cout << "Client closed.\n"; + } else { + std::cout << "Failed to close client.\n"; + } + exit(0); +} + +// observer callback. will be called for every new message received by the server +void onIncomingMsg(const char *msg, size_t size) { + std::cout << "Got msg from server: " << msg << "\n"; +} + +// observer callback. will be called when server disconnects +void onDisconnection(const pipe_ret_t &ret) { + std::cout << "Server disconnected: " << ret.message() << "\n"; +} + +int main() { + // register to SIGINT to close client when user press ctrl+c + signal(SIGINT, sig_exit); + + // configure and register observer + client_observer_t observer; + observer.wantedIP = "127.0.0.1"; + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onDisconnection; + client.subscribe(observer); + + // connect client to an open server + bool connected = false; + while (!connected) { + pipe_ret_t connectRet = client.connectTo("127.0.0.1", 65123); + connected = connectRet.isSuccessful(); + if (connected) { + std::cout << "Client connected successfully\n"; + } else { + std::cout << "Client failed to connect: " << connectRet.message() << "\n" + << "Make sure the server is open and listening\n\n"; + sleep(2); + std::cout << "Retrying to connect...\n"; + } + } + + // send messages to server + while (true) { + // Fuzzed input for sending a message to the server + std::string message = /* fuzzed message */; + pipe_ret_t sendRet = client.sendMsg(message.c_str(), message.size()); + if (!sendRet.isSuccessful()) { + std::cout << "Failed to send message: " << sendRet.message() << "\n"; + } else { + std::cout << "Message was sent successfully\n"; + } + } + + return 0; +} + +#endif diff --git a/test/my_fuzz_test.cpp b/test/my_fuzz_test.cpp new file mode 100644 index 0000000..13fc581 --- /dev/null +++ b/test/my_fuzz_test.cpp @@ -0,0 +1,155 @@ +#ifdef SERVER_EXAMPLE + +#include +#include +#include +#include + +#include "../include/tcp_server.h" + +// declare the server +TcpServer server; + +// declare a server observer which will receive incomingPacketHandler messages. +// the server supports multiple observers +server_observer_t observer; + +bool shouldSaveMsg = false; +char msgBuffer[10] = {0}; + +std::mutex mtx; +std::condition_variable server_ready; +bool canAcceptNextClient = true; + +// observer callback. will be called for every new message received by clients +// with the requested IP address +void onIncomingMsg(const std::string &clientIP, const char *msg, size_t size) { + std::string msgStr = msg; + if (msgStr == "S") { + shouldSaveMsg = true; + } else if (shouldSaveMsg) { + if (strncmp(msgStr.c_str(), "M", 1) == 0) { + memcpy(msgBuffer, msg, size); + } + shouldSaveMsg = false; + } + // print client message + std::cout << "Observer1 got client msg: " << msgStr << "\n"; +} + +// observer callback. will be called when client disconnects +void onClientDisconnected(const std::string &ip, const std::string &msg) { + std::cout << "Client: " << ip << " disconnected. Reason: " << msg << "\n"; + { + std::lock_guard lock(mtx); + canAcceptNextClient = true; + server_ready.notify_one(); + } +} + +int main() { + // start server on port 65123 + pipe_ret_t startRet = server.start(65123); + if (startRet.isSuccessful()) { + std::cout << "Server setup succeeded\n"; + } else { + std::cout << "Server setup failed: " << startRet.message() << "\n"; + return EXIT_FAILURE; + } + + // configure and register observer + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onClientDisconnected; + observer.wantedIP = "127.0.0.1"; + server.subscribe(observer); + + while (true) { + acceptClient(); + { + std::lock_guard lock(mtx); + canAcceptNextClient = false; + } + std::unique_lock lock(mtx); + server_ready.wait(lock, [] { return canAcceptNextClient; }); + } + + return 0; +} + +#endif +/////////////////////////////////////////////////////////// +/////////////////////CLIENT EXAMPLE//////////////////////// +/////////////////////////////////////////////////////////// + +#ifdef CLIENT_EXAMPLE + +#include +#include +#include "../include/tcp_client.h" + +TcpClient client; + +// on sig_exit, close client +void sig_exit(int s) { + std::cout << "Closing client...\n"; + pipe_ret_t finishRet = client.close(); + if (finishRet.isSuccessful()) { + std::cout << "Client closed.\n"; + } else { + std::cout << "Failed to close client.\n"; + } + exit(0); +} + +// observer callback. will be called for every new message received by the server +void onIncomingMsg(const char *msg, size_t size) { + std::cout << "Got msg from server: " << msg << "\n"; +} + +// observer callback. will be called when server disconnects +void onDisconnection(const pipe_ret_t &ret) { + std::cout << "Server disconnected: " << ret.message() << "\n"; +} + +int main() { + // register to SIGINT to close client when user press ctrl+c + signal(SIGINT, sig_exit); + + // configure and register observer + client_observer_t observer; + observer.wantedIP = "127.0.0.1"; + observer.incomingPacketHandler = onIncomingMsg; + observer.disconnectionHandler = onDisconnection; + client.subscribe(observer); + + // connect client to an open server + bool connected = false; + while (!connected) { + pipe_ret_t connectRet = client.connectTo("127.0.0.1", 65123); + connected = connectRet.isSuccessful(); + if (connected) { + std::cout << "Client connected successfully\n"; + } else { + std::cout << "Client failed to connect: " << connectRet.message() << "\n" + << "Make sure the server is open and listening\n\n"; + sleep(2); + std::cout << "Retrying to connect...\n"; + } + } + + // send messages to server + while (true) { + // Fuzzed input for sending a message to the server + std::string message = /* fuzzed message */; + pipe_ret_t sendRet = client.sendMsg(message.c_str(), message.size()); + if (!sendRet.isSuccessful()) { + std::cout << "Failed to send message: " << sendRet.message() << "\n"; + } else { + std::cout << "Message was sent successfully\n"; + } + } + + return 0; +} + +#endif From beefea8922d398ac2c0052e93813686a3fbe68c0 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Fri, 2 Jun 2023 15:27:25 +0200 Subject: [PATCH 067/211] coms --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 23dac00..20612b3 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -13,7 +13,7 @@ env: FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL. WEB_APP_ADDRESS: https://app.code-intelligence.com - # Directory in which the repository will be cloned. + # Directories in which the repository will be cloned. CHECKOUT_DIR: checkout-dir/ CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" CIFUZZ_INSTALL_DIR: ./cifuzz From 6e247ff2a82fa319732b3883ab7ddbc936f39efb Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Fri, 2 Jun 2023 15:30:15 +0200 Subject: [PATCH 068/211] all --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 20612b3..9a7e8c0 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -41,7 +41,7 @@ jobs: - id: Destinat name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/ + run: mkdir -p /home/runner/work/TcpServer/* From 13fbba3dd297b0dd9d26404fd3e8f11a8ce72f7e Mon Sep 17 00:00:00 2001 From: Chironda Date: Fri, 16 Jun 2023 19:35:35 +0200 Subject: [PATCH 069/211] fuzz --- examples/server_example.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/server_example.cpp b/examples/server_example.cpp index 3d9f21d..4085a81 100644 --- a/examples/server_example.cpp +++ b/examples/server_example.cpp @@ -56,6 +56,28 @@ void onIncomingMsg(const std::string &clientIP, const char * msg, size_t size) { } // print client message std::cout << "Observer1 got client msg: " << msgStr << "\n"; + + void onIncomingMsg(const std::string &clientIP, const char * msg, size_t size) { + std::string msgStr = msg; + if (msgStr == "S") { + shouldSaveMsg = true; + } else if (shouldSaveMsg) { + if (strncmp(msgStr.c_str(), "M", 1) == 0) { + memcpy(msgBuffer, msg, size); + } + shouldSaveMsg = false; + } + // Print client message + std::cout << "Observer1 got client msg: " << msgStr << "\n"; + + // Check for the X-Injected-Header value + std::string injectedHeaderValue = "MaliciousContentChironda"; + if (msgStr == injectedHeaderValue) { + std::cout << "Zacarias has injected a file heree: " << msgStr << "\n"; + // Example: server.handleInjectedHeader(injectedHeaderValue); + } +} + } // observer callback. will be called when client disconnects From 4061a390e2958a3c9da75149bc86c4882b3ca95a Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 16:42:55 +0200 Subject: [PATCH 070/211] changes --- examples/server_example.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/examples/server_example.cpp b/examples/server_example.cpp index 4085a81..b4781b7 100644 --- a/examples/server_example.cpp +++ b/examples/server_example.cpp @@ -42,20 +42,6 @@ void acceptClient() { } -// observer callback. will be called for every new message received by clients -// with the requested IP address -void onIncomingMsg(const std::string &clientIP, const char * msg, size_t size) { - std::string msgStr = msg; - if (msgStr == "S") { - shouldSaveMsg = true; - } else if (shouldSaveMsg) { - if (strncmp(msgStr.c_str(), "M", 1) == 0) { - memcpy(msgBuffer, msg, size); - } - shouldSaveMsg = false; - } - // print client message - std::cout << "Observer1 got client msg: " << msgStr << "\n"; void onIncomingMsg(const std::string &clientIP, const char * msg, size_t size) { std::string msgStr = msg; @@ -76,7 +62,7 @@ void onIncomingMsg(const std::string &clientIP, const char * msg, size_t size) { std::cout << "Zacarias has injected a file heree: " << msgStr << "\n"; // Example: server.handleInjectedHeader(injectedHeaderValue); } -} + } From 082e9e894549e45a089e60c3030c26c8faeace54 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 17:07:47 +0200 Subject: [PATCH 071/211] replacing --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9a7e8c0..9952aa1 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -66,7 +66,7 @@ jobs: name: Build Server run: | # Build the server application - # Replace the command with the actual build command for your server application + # Replacing the command with the actual build command for your server application # Example command: cd ${{ env.CHECKOUT_DIR }}/server cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} From 247dcd082b89eb4f136469b40591674362b1da10 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 17:12:01 +0200 Subject: [PATCH 072/211] add build --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9952aa1..d508ecf 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,7 @@ jobs: # Build the server application # Replacing the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }}/server + cd ${{ env.CHECKOUT_DIR }}/build cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From 8cef55213247c590b150573664f6abdac5cc61e7 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 21:09:47 +0200 Subject: [PATCH 073/211] te --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 3a911ea..54185db 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -72,7 +72,7 @@ jobs: # Build the server application # Replacing the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }}/build + cd ${{ env.CHECKOUT_DIR }} cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From b7202cc4c46e871961140672e9204488df39e61f Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 21:16:32 +0200 Subject: [PATCH 074/211] cs --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 54185db..6e99b1e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -72,7 +72,8 @@ jobs: # Build the server application # Replacing the command with the actual build command for your server application # Example command: - cd ${{ env.CHECKOUT_DIR }} + cd /home/runner/work/TcpServer/TcpServer/ + #cd ${{ env.CHECKOUT_DIR }} cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From 35188cedc870d2b1fdaa186f5b09f0d3b9040020 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 21:19:01 +0200 Subject: [PATCH 075/211] aaa --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6e99b1e..8ace783 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -70,8 +70,9 @@ jobs: name: Build Server run: | # Build the server application - # Replacing the command with the actual build command for your server application + # Example command: + echo ${{ env.CHECKOUT_DIR }} cd /home/runner/work/TcpServer/TcpServer/ #cd ${{ env.CHECKOUT_DIR }} cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} From 694b9afde5390bc0dc298edfe4aeac2797a3be8f Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 21:35:10 +0200 Subject: [PATCH 076/211] add build --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8ace783..214aa4e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -44,7 +44,7 @@ jobs: - id: Destinat name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/* + run: mkdir -p /home/runner/work/TcpServer/build/ From 8947c53cea68067de53f012db62216e9f8db0369 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 21:41:18 +0200 Subject: [PATCH 077/211] variazionebuild --- .github/workflows/Vulnerability.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 214aa4e..6c81a1d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -70,13 +70,13 @@ jobs: name: Build Server run: | # Build the server application - - # Example command: - echo ${{ env.CHECKOUT_DIR }} - cd /home/runner/work/TcpServer/TcpServer/ - #cd ${{ env.CHECKOUT_DIR }} - cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - cmake --build build --config ${{ env.BUILD_TYPE }} + cd tcp_server_client + mkdir build + cmake .. + make + + # cmake -B build #-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + # cmake --build build --config ${{ env.BUILD_TYPE }} - name: Build Client From 5c8352e5c6b07d1ce09569984ad997a81fe9623b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sat, 17 Jun 2023 22:43:55 +0200 Subject: [PATCH 078/211] Update Vulnerability.yml chege my --- .github/workflows/Vulnerability.yml | 128 +++++++++++----------------- 1 file changed, 49 insertions(+), 79 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6c81a1d..c41c060 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,5 +1,4 @@ -name: Vulnerability Assessment - + name: Vulnerability Assessment on: workflow_dispatch: push: @@ -9,13 +8,8 @@ on: branches: [ main ] env: - # The fuzzing server gRPC URL. FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL. WEB_APP_ADDRESS: https://app.code-intelligence.com - - # Directories in which the repository will be cloned. - CHECKOUT_DIR: checkout-dir/ CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" CIFUZZ_INSTALL_DIR: ./cifuzz @@ -26,91 +20,67 @@ jobs: fuzz-test: runs-on: ubuntu-latest steps: - - id: Checkout-Repo - name: Checkout Repository - uses: actions/checkout@v2 - with: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + repository: gladzeka/TcpServer + ref: TestChironda/TcpServer path: ${{ env.CHECKOUT_DIR }} - - id: SetupCmake - name: Setup Cmake - run: | - sudo apt-get install -y cmake - - id: DownloadCmake - name: Download CMakeLists.txt - run: | - curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - - - id: Destinat - name: Create Destination Directory + - name: Setup CMake + run: | + sudo apt-get install -y cmake - run: mkdir -p /home/runner/work/TcpServer/build/ - - - - + - name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/build/ - - id: install-cifuzz - name: Install cifuzz - run: | + - name: Install cifuzz + run: | curl --fail --silent --show-error --location -o cifuzz_installer "$CIFUZZ_DOWNLOAD_URL" chmod u+x cifuzz_installer ./cifuzz_installer --install-dir $CIFUZZ_INSTALL_DIR - - id: Envs - name: Setup Environment - run: | - # Set up the necessary dependencies and environment for the fuzz test - # Install any required packages or tools - # Example commands: - sudo apt-get update - - - - id: Build - name: Build Server - run: | - # Build the server application - cd tcp_server_client - mkdir build - cmake .. - make - - # cmake -B build #-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - # cmake --build build --config ${{ env.BUILD_TYPE }} - - - - name: Build Client - run: | - # Build the client application - # Replace the command with the actual build command for your client application - # Example command: + - name: Setup Environment + run: | + sudo apt-get update + + - name: Build Server + run: | + cd ${{ env.CHECKOUT_DIR }} + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. + cmake --build . + + - name: Build Client + run: | + cd ${{ env.CHECKOUT_DIR }} g++ client.cpp -o client - - name: Start Server - run: | - # Start the server before running the fuzz test - # Replace the command with the actual command to start the server - # Example command: - ./server + - name: Start Server + run: | + cd ${{ env.CHECKOUT_DIR }} + ./server & - - name: Run Fuzz Test - run: | - # Run the fuzz test on the client application - # Replace the command with the actual fuzz test command for your client application - # Example command: - - ./client + - name: Run Fuzz Test + run: | + cd ${{ env.CHECKOUT_DIR }} + ./client - - name: Save Fuzz Test Results - if: always() - run: | + - name: Save Fuzz Test Results + if: always() + run: | # Save the fuzz test results to an artifact or a file for further analysis - # Replace the command with the necessary steps to save the results # Example command: - # - cp fuzz_results.txt $GITHUB_WORKSPACE/fuzz_results.txt + # - cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt - - name: Upload Fuzz Test Results - if: always() - uses: actions/upload-artifact@v2 - with: + - name: Upload Fuzz Test Results + if: always() + uses: actions/upload-artifact@v2 + with: name: Fuzz Test Results - path: # Replace with the actual path to the fuzz test results + path: ${{ env.CHECKOUT_DIR }}/results From 59cce6cd62d2e828c0d238a1449a44246f26d275 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sat, 17 Jun 2023 22:52:29 +0200 Subject: [PATCH 079/211] Create cmake.yml --- .github/workflows/cmake.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..cf8e1ce --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,37 @@ +name: CMake + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + From 56e6cdc5b8d72ae7c584885218f2ce7ec32cb7cd Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:19:09 +0200 Subject: [PATCH 080/211] msg --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c41c060..c261411 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,7 +74,7 @@ jobs: - name: Save Fuzz Test Results if: always() run: | - # Save the fuzz test results to an artifact or a file for further analysis + # Save the fuzzing test results to an artifact or a file for further analysis # Example command: # - cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt From 45978ae0849a732bd81551fa26cf735641e6f69c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:20:06 +0200 Subject: [PATCH 081/211] seninf --- .vscode/settings.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e804c3c..24c6579 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,8 @@ "chrono": "cpp", "system_error": "cpp", "xlocale": "cpp" - } + }, + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] } \ No newline at end of file From 7e3cb172a56d657b05554fb7c44d1b047be3fb58 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:24:40 +0200 Subject: [PATCH 082/211] iotaaa --- .github/workflows/Vulnerability.yml | 2 +- .github/workflows/cmake.yml | 37 ----------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c261411..505cf94 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,7 +74,7 @@ jobs: - name: Save Fuzz Test Results if: always() run: | - # Save the fuzzing test results to an artifact or a file for further analysis + # Saeve the fuzzing test results to an artifact or a file for further analysis # Example command: # - cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index cf8e1ce..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CMake - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - From 3785d3d910b850dca8a672d689da8fe960ada7bb Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:33:50 +0200 Subject: [PATCH 083/211] mdo --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 505cf94..ba76c5e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,5 @@ - name: Vulnerability Assessment +name: Vulnerability Assessment + on: workflow_dispatch: push: @@ -74,7 +75,7 @@ jobs: - name: Save Fuzz Test Results if: always() run: | - # Saeve the fuzzing test results to an artifact or a file for further analysis + # Save the fuzzing test results to an artifact or a file for further analysis # Example command: # - cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt From 5d0de3bde6f6de9a4aceb1f5922256629b3c0002 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:37:59 +0200 Subject: [PATCH 084/211] main --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index ba76c5e..3834d5e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -25,8 +25,8 @@ jobs: uses: actions/checkout@v2 with: repository: gladzeka/TcpServer - ref: TestChironda/TcpServer - path: ${{ env.CHECKOUT_DIR }} + ref: main/TcpServer + - name: Setup CMake run: | From 28439c44dcd27df4c8f05344d511c8678d412b97 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:42:56 +0200 Subject: [PATCH 085/211] change2 --- .github/workflows/Vulnerability.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 3834d5e..eb2a7b7 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -21,6 +21,12 @@ jobs: fuzz-test: runs-on: ubuntu-latest steps: + - name: Debug github + run: | + git remote -v + git ls-remote --heads origin + git config --get remote.origin.url + - name: Checkout Repository uses: actions/checkout@v2 with: From b6eb5fab03accdf68ba71edccb6a43a74839c2d6 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:46:20 +0200 Subject: [PATCH 086/211] ref --- .github/workflows/Vulnerability.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index eb2a7b7..6c6dd87 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -21,18 +21,11 @@ jobs: fuzz-test: runs-on: ubuntu-latest steps: - - name: Debug github - run: | - git remote -v - git ls-remote --heads origin - git config --get remote.origin.url - - name: Checkout Repository uses: actions/checkout@v2 with: repository: gladzeka/TcpServer - ref: main/TcpServer - + ref: main - name: Setup CMake run: | From 96e6c6776d36f8af0de50e8fd6ae908fc13e5046 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:46:49 +0200 Subject: [PATCH 087/211] modific2 --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6c6dd87..3b4fc5d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -26,6 +26,7 @@ jobs: with: repository: gladzeka/TcpServer ref: main + #path: ${{ env.CHECKOUT_DIR }} - name: Setup CMake run: | From 4bd9186a8b81e5db6870249fa30703d4bbc16f40 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 14:57:22 +0200 Subject: [PATCH 088/211] runserver --- .github/workflows/Vulnerability.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 3b4fc5d..473eca7 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -38,6 +38,10 @@ jobs: - name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/build/ + cd tcp_server_client + mkdir build + cmake .. + make - name: Install cifuzz run: | @@ -51,16 +55,13 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }} - mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. - cmake --build . + ./TcpServer - name: Build Client run: | - cd ${{ env.CHECKOUT_DIR }} - g++ client.cpp -o client + #cd ${{ env.CHECKOUT_DIR }} + # g++ client.cpp -o client - name: Start Server run: | From e5ce262ebe1d73e09519a3e783c90a82239ac2b9 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:00:10 +0200 Subject: [PATCH 089/211] remove1 --- .github/workflows/Vulnerability.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 473eca7..6f6c606 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -26,7 +26,7 @@ jobs: with: repository: gladzeka/TcpServer ref: main - #path: ${{ env.CHECKOUT_DIR }} + - name: Setup CMake run: | @@ -38,10 +38,6 @@ jobs: - name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/build/ - cd tcp_server_client - mkdir build - cmake .. - make - name: Install cifuzz run: | @@ -55,13 +51,16 @@ jobs: - name: Build Server run: | + cd ${{ env.CHECKOUT_DIR }} + mkdir -p build cd build - ./TcpServer + cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. + cmake --build . - name: Build Client run: | - #cd ${{ env.CHECKOUT_DIR }} - # g++ client.cpp -o client + cd ${{ env.CHECKOUT_DIR }} + g++ client.cpp -o client - name: Start Server run: | From acb02b190835fa4d9069abb7df9f02970dbb6f29 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:03:46 +0200 Subject: [PATCH 090/211] fix_2 --- .github/workflows/Vulnerability.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6f6c606..8b4a6c5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -51,25 +51,26 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }} - mkdir -p build - cd build - cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. - cmake --build . + mkdir build + cmake .. + make + #mkdir -p build + #cd build + #cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. + #cmake --build . - - name: Build Client - run: | - cd ${{ env.CHECKOUT_DIR }} - g++ client.cpp -o client + #- name: Build Client + # run: | + # cd ${{ env.CHECKOUT_DIR }} + # g++ client.cpp -o client - name: Start Server run: | - cd ${{ env.CHECKOUT_DIR }} - ./server & + cd build + ./tcp_server - name: Run Fuzz Test run: | - cd ${{ env.CHECKOUT_DIR }} ./client - name: Save Fuzz Test Results From 651daebcd08c93011e512c24aedf2ef7466b1135 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:06:51 +0200 Subject: [PATCH 091/211] fix_3 --- .github/workflows/Vulnerability.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8b4a6c5..bb161e9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -37,7 +37,10 @@ jobs: curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/build/ + run: | + mkdir -p /home/runner/work/TcpServer/build/ + cmake .. + make - name: Install cifuzz run: | @@ -51,8 +54,6 @@ jobs: - name: Build Server run: | - mkdir build - cmake .. make #mkdir -p build #cd build From fa73737404d7704d6f6d60c7e90776112c2279a5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:07:57 +0200 Subject: [PATCH 092/211] fix_4 --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index bb161e9..fa645ab 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -38,7 +38,7 @@ jobs: - name: Create Destination Directory run: | - mkdir -p /home/runner/work/TcpServer/build/ + mkdir -p /home/runner/work/TcpServer/ cmake .. make From f25fc5590fc30529bba1ccfc7dff7ae7a7b29e4a Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:08:44 +0200 Subject: [PATCH 093/211] back_1 --- .github/workflows/Vulnerability.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index fa645ab..0d63ab2 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -37,10 +37,8 @@ jobs: curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - name: Create Destination Directory - run: | - mkdir -p /home/runner/work/TcpServer/ - cmake .. - make + run: mkdir -p /home/runner/work/TcpServer/build/ + - name: Install cifuzz run: | @@ -54,6 +52,8 @@ jobs: - name: Build Server run: | + mkdir -p build + cmake .. make #mkdir -p build #cd build From 4b8d8c2e6116323b5823eb9724777db9d68a2945 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:10:47 +0200 Subject: [PATCH 094/211] mkdir --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 0d63ab2..89fddb5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,7 +52,7 @@ jobs: - name: Build Server run: | - mkdir -p build + cd /home/runner/work/TcpServer/build/ cmake .. make #mkdir -p build From 2750cd8ce69ffa8448f2ae5557f7824d23493087 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:15:46 +0200 Subject: [PATCH 095/211] ttt --- .github/workflows/Vulnerability.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 89fddb5..05e27b5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,13 +52,13 @@ jobs: - name: Build Server run: | - cd /home/runner/work/TcpServer/build/ + cmake .. make - #mkdir -p build - #cd build - #cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. - #cmake --build . + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. + #- name: Build Client # run: | From e550f17bae27c5e5f6e23c2bab98491e569320d4 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:18:05 +0200 Subject: [PATCH 096/211] treyt --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 05e27b5..1716d9c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,11 +53,11 @@ jobs: - name: Build Server run: | - cmake .. - make + cd ${{ env.CHECKOUT_DIR }}/build mkdir -p build cd build cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. + cmake --build . #- name: Build Client From 82024d829ef8391467f43f18512d43edacc4256f Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:19:53 +0200 Subject: [PATCH 097/211] ocm --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 1716d9c..ba850c9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,7 +53,7 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }}/build + cd /home/runner/work/_temp/26d29d52-f948-4497-a2fd-2718d57883e7 mkdir -p build cd build cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. From 1840f7f695182f63b93a30c0d36715e38fac57ec Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:20:47 +0200 Subject: [PATCH 098/211] run simple --- .github/workflows/Vulnerability.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index ba850c9..b37386b 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,12 +52,7 @@ jobs: - name: Build Server run: | - - cd /home/runner/work/_temp/26d29d52-f948-4497-a2fd-2718d57883e7 - mkdir -p build - cd build - cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} .. - cmake --build . + ./tcp_server #- name: Build Client From 8550c6b0f04e8c1917664e58e19ec1e0f1a44975 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:24:59 +0200 Subject: [PATCH 099/211] vai --- .github/workflows/Vulnerability.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index b37386b..fb2c81f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,6 +52,10 @@ jobs: - name: Build Server run: | + cd ${{ env.CHECKOUT_DIR }} + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build + cd build ./tcp_server From e8d8c573786104137e1fdcfcb07294075688d44c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:27:09 +0200 Subject: [PATCH 100/211] checkaclut --- .github/workflows/Vulnerability.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index fb2c81f..8e284c5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,10 +52,7 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }} - cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - cmake --build build - cd build + ./tcp_server From f81593e666b6b65d082aa909ad74eee6b199b35e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:27:45 +0200 Subject: [PATCH 101/211] ora --- .github/workflows/Vulnerability.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8e284c5..fb2c81f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,7 +52,10 @@ jobs: - name: Build Server run: | - + cd ${{ env.CHECKOUT_DIR }} + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build + cd build ./tcp_server From b81b03de2ac85a4c917ad76e25c98830bf28a11f Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:31:15 +0200 Subject: [PATCH 102/211] checkout --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index fb2c81f..3d9014c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -11,7 +11,7 @@ on: env: FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 WEB_APP_ADDRESS: https://app.code-intelligence.com - CHECKOUT_DIR: checkout-dir/ + CHECKOUT_DIR: TcpServer CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" CIFUZZ_INSTALL_DIR: ./cifuzz FUZZING_ARTIFACT: fuzzing-artifact.tar.gz From 298ce8fe3c0b945088043ab3c3da57a508d58152 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:32:22 +0200 Subject: [PATCH 103/211] add build --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 3d9014c..c151429 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,7 +52,7 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }} + cd ${{ env.CHECKOUT_DIR }}/build cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build cd build From 2dd58061dd14747d4e8c8e5bd4844c4efc35de9b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:33:37 +0200 Subject: [PATCH 104/211] di --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c151429..d202b4b 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -52,7 +52,7 @@ jobs: - name: Build Server run: | - cd ${{ env.CHECKOUT_DIR }}/build + cd /home/runner/work/TcpServer/build/ cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build cd build From 78f642ef351137f91c724b8e10b8131e7e717353 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:34:17 +0200 Subject: [PATCH 105/211] slah --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index d202b4b..6646804 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -11,7 +11,7 @@ on: env: FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 WEB_APP_ADDRESS: https://app.code-intelligence.com - CHECKOUT_DIR: TcpServer + CHECKOUT_DIR: TcpServer/ CIFUZZ_DOWNLOAD_URL: "https://github.com/CodeIntelligenceTesting/cifuzz/releases/latest/download/cifuzz_installer_linux_amd64" CIFUZZ_INSTALL_DIR: ./cifuzz FUZZING_ARTIFACT: fuzzing-artifact.tar.gz From 2203011f1ee1e498ba917613f2fe5de0fcf9d459 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:36:51 +0200 Subject: [PATCH 106/211] copycmake --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6646804..4a23f86 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -35,6 +35,7 @@ jobs: - name: Download CMakeLists.txt run: | curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + cp CMakeLists.txt /home/runner/work/TcpServer/build/ - name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/build/ @@ -52,7 +53,7 @@ jobs: - name: Build Server run: | - cd /home/runner/work/TcpServer/build/ + cd ${{ env.CHECKOUT_DIR }}/build cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build cd build From 9da23db5657c0b3170fced78557b4075bcf78737 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:38:14 +0200 Subject: [PATCH 107/211] ved --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 4a23f86..10f3d4d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -35,7 +35,7 @@ jobs: - name: Download CMakeLists.txt run: | curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - cp CMakeLists.txt /home/runner/work/TcpServer/build/ + - name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/build/ @@ -53,6 +53,7 @@ jobs: - name: Build Server run: | + cp CMakeLists.txt /home/runner/work/TcpServer/build/ cd ${{ env.CHECKOUT_DIR }}/build cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build From d2a608c5f9fa10341736d55ae82b728ccf89db26 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:39:55 +0200 Subject: [PATCH 108/211] ttttttt --- .github/workflows/Vulnerability.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 10f3d4d..8fbbef8 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,8 +53,7 @@ jobs: - name: Build Server run: | - cp CMakeLists.txt /home/runner/work/TcpServer/build/ - cd ${{ env.CHECKOUT_DIR }}/build + cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build cd build From 6fffa2929dc3f9434e0d299b650a7abd395c6e6c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:40:27 +0200 Subject: [PATCH 109/211] step1 --- .github/workflows/Vulnerability.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8fbbef8..ff1fb57 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -54,10 +54,10 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - cmake --build build - cd build - ./tcp_server + #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + #cmake --build build + #cd build + #./tcp_server #- name: Build Client From 54e87447810fdea85c9f40e75b055f489be1e773 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:43:13 +0200 Subject: [PATCH 110/211] dir --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index ff1fb57..03f6349 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -38,7 +38,8 @@ jobs: - name: Create Destination Directory - run: mkdir -p /home/runner/work/TcpServer/build/ + run: | + mkdir -p ${{ env.CHECKOUT_DIR }}/build/ - name: Install cifuzz From 0204e918c448e2781bb0568e241bbf0a491bc87c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:44:06 +0200 Subject: [PATCH 111/211] stp2 --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 03f6349..54013ef 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,7 +55,7 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} #cmake --build build #cd build #./tcp_server From cead18639a8c7cda2b82018e164a3ccb1e7e2338 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:48:29 +0200 Subject: [PATCH 112/211] cmake --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a5bc31..740e035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) -enable_fuzz_testing() + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") From 9158f9afd92ba6904a83e5ee26c2556d8d89548e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:50:37 +0200 Subject: [PATCH 113/211] bld --- .github/workflows/Vulnerability.yml | 4 ++-- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 54013ef..c1e7056 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,8 +55,8 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - #cmake --build build + #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build #cd build #./tcp_server diff --git a/CMakeLists.txt b/CMakeLists.txt index 740e035..6a5bc31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) - +enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") From e72f240536f903914d9856aaffc3b4261c3cb8de Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:51:43 +0200 Subject: [PATCH 114/211] rmv --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c1e7056..7e511a6 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -56,7 +56,7 @@ jobs: run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - cmake --build build + #cmake --build build #cd build #./tcp_server From 7f4f27a42691af1b0c7f870d71ce035375ec5c6d Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:52:30 +0200 Subject: [PATCH 115/211] rmvvvvv --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 7e511a6..28ae6f6 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,11 +68,12 @@ jobs: - name: Start Server run: | - cd build + cd ${{ env.CHECKOUT_DIR }}/build ./tcp_server - name: Run Fuzz Test run: | + cd ${{ env.CHECKOUT_DIR }}/build ./client - name: Save Fuzz Test Results From 0b71ef99a59148c482c46ea4b922232458b721f5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:54:20 +0200 Subject: [PATCH 116/211] addmake --- .github/workflows/Vulnerability.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 28ae6f6..151e261 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,6 +55,9 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build + cmake .. + make + #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} #cmake --build build #cd build From 472cfbf976f3dc44511c4c26905f181612958cb4 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 15:57:21 +0200 Subject: [PATCH 117/211] cmake --- .github/workflows/Vulnerability.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 151e261..ff7bebc 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,13 +55,13 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake .. + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}/build make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} #cmake --build build - #cd build - #./tcp_server + #cd build + #./tcp_server #- name: Build Client From db50bf3790b47069eb8d920267fcfd14a56f2911 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:04:22 +0200 Subject: [PATCH 118/211] comments --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a5bc31..5bfa88b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) -enable_fuzz_testing() +*/enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") @@ -39,7 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) + /*add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From c6aabffdb630e49a549792cfdbfdbcb57d6bfe85 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:05:16 +0200 Subject: [PATCH 119/211] rmv2 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bfa88b..a957c1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) -*/enable_fuzz_testing() + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") @@ -39,7 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - /*add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) + target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From 97201cffa18e3a907fffb832b87414a6ff72f0ba Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:07:20 +0200 Subject: [PATCH 120/211] te --- .github/workflows/Vulnerability.yml | 5 +++-- CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index ff7bebc..2b153b9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -56,12 +56,13 @@ jobs: run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}/build + make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} #cmake --build build - #cd build - #./tcp_server + #cd build + #./tcp_server #- name: Build Client diff --git a/CMakeLists.txt b/CMakeLists.txt index a957c1f..62dd10f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) - + "*/enable_fuzz_testing" set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") @@ -39,7 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - + /*add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From 9e2b48cbf72a9f0b37de176aff317d7efd022840 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:09:25 +0200 Subject: [PATCH 121/211] cifff --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62dd10f..87f2c1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) - "*/enable_fuzz_testing" +include(${CIFUZZ_CMAKE_MODULE_PATH}) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") From 152eea59439687d1bdbb6d82c66fec717faf469c Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:10:38 +0200 Subject: [PATCH 122/211] remv3 --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87f2c1a..2eb2f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,6 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - /*add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From 9c65adc7beefdacfb468cf3078fb42de0a9bbac2 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:25:43 +0200 Subject: [PATCH 123/211] cccc --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2eb2f6c..acb5752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) -include(${CIFUZZ_CMAKE_MODULE_PATH}) +include(${CMakeLists.txt}) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") From 5ad5937fa5042862c1cce09db2bae8c086515e07 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:48:01 +0200 Subject: [PATCH 124/211] original --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acb5752..6a5bc31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) find_package(cifuzz) -include(${CMakeLists.txt}) +enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") @@ -39,6 +39,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From b6ca5fe0ed829e77a56bbaa7adade2a6a4124c38 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:49:13 +0200 Subject: [PATCH 125/211] trynow --- .github/workflows/Vulnerability.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 2b153b9..4b37e95 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,14 +55,12 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}/build - - make - + cmake + make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} #cmake --build build - #cd build - #./tcp_server + #cd build + #./tcp_server #- name: Build Client From f20fafac23665fc02dc639fbaebcb4d15c7d18e0 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:53:18 +0200 Subject: [PATCH 126/211] targer --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 4b37e95..1864900 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,9 +55,9 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake + cmake -S ${{ env.CHECKOUT_DIR }} -B ${{ env.CHECKOUT_DIR }}/build make - #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B #cmake --build build #cd build #./tcp_server From 403b7ae87314183abd6dac9f1306916c9c18d53e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:55:01 +0200 Subject: [PATCH 127/211] b --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 1864900..91a6777 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,8 +55,8 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake -S ${{ env.CHECKOUT_DIR }} -B ${{ env.CHECKOUT_DIR }}/build - make + cmake -S ${{ env.CHECKOUT_DIR }}/buid -B ${{ env.CHECKOUT_DIR }}/build + #make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B #cmake --build build #cd build From c2eb873e739e6a2095f219489cc058eeee0ad014 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 16:58:21 +0200 Subject: [PATCH 128/211] punto --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 91a6777..0d11973 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,7 +55,7 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake -S ${{ env.CHECKOUT_DIR }}/buid -B ${{ env.CHECKOUT_DIR }}/build + cmake -S . #make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B #cmake --build build From b2cc1b78ccd4acc88c08778dd0be6a23797a496e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 17:06:33 +0200 Subject: [PATCH 129/211] tm2 --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 0d11973..83fb992 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,6 +55,7 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build + cd ${{ env.CHECKOUT_DIR }}/build cmake -S . #make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B From eff57a686843db9cd6039a8377e2e685803825cc Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 17:43:27 +0200 Subject: [PATCH 130/211] instrumentations --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a5bc31..a528d7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ enable_fuzz_testing() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") +enable_testing() +find_package(cifuzz) +enable_fuzz_testing() + add_library(${PROJECT_NAME} src/tcp_client.cpp src/tcp_server.cpp @@ -39,7 +43,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - add_fuzz_test(my_fuzz_test test/my_fuzz_test.cpp) + target_link_libraries(my_fuzz_test PRIVATE server_example) endif() From a4d59c95c6eb9e1ca37b8fc6c5709cdb213d3ca2 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 17:50:38 +0200 Subject: [PATCH 131/211] Create example.yml --- .github/workflows/example.yml | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/example.yml diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000..1eadad3 --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,98 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + container: cifuzz/builder-zint:llvm-13 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Build fuzzers + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: | + sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" + export PATH="$PATH:$HOME/cifuzz/bin" + cifuzz bundle + mkdir fuzz_tests && cd fuzz_tests + tar -xvzf ../fuzz_tests.tar.gz + egrep -v 'library_paths|- ""' cifuzz.yaml > cifuzz2.yaml + sed 's|ubuntu|cifuzz/builder-zint:llvm-13|' cifuzz2.yaml > cifuzz.yaml + echo "code_revision:" >> cifuzz.yaml + echo " git:" >> cifuzz.yaml + echo " commit: $GITHUB_SHA" >> cifuzz.yaml + echo " branch: $BRANCH_NAME" >> cifuzz.yaml + cat cifuzz.yaml + tar -cvzf ../fuzz_tests.tar.gz * + + - name: Upload fuzzer + id: start-fuzzing + env: + BEARER_TOKEN: ${{secrets.CI_FUZZ_API_TOKEN}} + run: | + export IMPORT_RESULT=$(curl -s \ + -H "Authorization: Bearer $BEARER_TOKEN" \ + -F 'fuzzing-artifacts=@fuzz_tests.tar.gz' \ + https://app.code-intelligence.com/v2/projects/c-cpp-demo-c170bc17/artifacts/import) + echo "${IMPORT_RESULT}" + export ARTIFACT_NAME=$(echo "$IMPORT_RESULT" | jq -r '."resource-name"') + echo "https://app.code-intelligence.com/v1/${ARTIFACT_NAME}:run" + export RUN_RESULT=$(curl -X POST -H "Authorization: Bearer $BEARER_TOKEN" \ + "https://app.code-intelligence.com/v1/${ARTIFACT_NAME}:run") + echo "${RUN_RESULT}" + export CAMPAIGN_RUN_NAME=$(echo "$RUN_RESULT" | jq -r '."name"') + echo "::set-output name=test_collection_run::${CAMPAIGN_RUN_NAME}" + + - name: Monitor Fuzzing + uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v3 + with: + ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: grpc.code-intelligence.com:443 + dashboard_address: https://app.code-intelligence.com/ + timeout: 180 + + - name: Save Fuzz Test Results + uses: CodeIntelligenceTesting/github-actions/save-results@v3 + if: ${{ success() || failure() }} + with: + ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} + test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} + fuzzing_server_address: grpc.code-intelligence.com:443 + dashboard_address: https://app.code-intelligence.com/ + + - id: upload-artifact + uses: actions/upload-artifact@v2 + if: ${{ (success() || failure()) }} + with: + name: ci_fuzz_results + path: | + findings.json + coverage.json + web_app_address.txt + + - id: coverage + uses: CodeIntelligenceTesting/github-actions/report-coverage@master + with: + ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} + project: c-cpp-demo-c170bc17 + test_collection_run: ${{ steps.start-fuzzing.outputs.test-collection-run }} From fe9bf6fd4ad988fdabbb589b9fd1a275a51f16ae Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 18:03:10 +0200 Subject: [PATCH 132/211] di --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a528d7c..54c8bc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) -find_package(cifuzz) -enable_fuzz_testing() + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") From 5f6fd79c8e2794e3fd11b8f1c0fadd22082f7ec5 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 18:04:35 +0200 Subject: [PATCH 133/211] se --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54c8bc0..1330542 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") enable_testing() find_package(cifuzz) -enable_fuzz_testing() + add_library(${PROJECT_NAME} src/tcp_client.cpp @@ -41,7 +41,7 @@ if(CLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) - target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries (tcp_client ${tcp_server} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(my_fuzz_test PRIVATE server_example) From 2a852696503801117ff12cc0404680c477537f6e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 18:05:36 +0200 Subject: [PATCH 134/211] viaaa --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1330542..67d50c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,6 @@ if(CLIENT_EXAMPLE) target_link_libraries (tcp_client ${tcp_server} ${CMAKE_THREAD_LIBS_INIT}) - target_link_libraries(my_fuzz_test PRIVATE server_example) + endif() From 0ae7f50ea928c3004609b6d435a04cb84651d0dc Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 18:10:24 +0200 Subject: [PATCH 135/211] modifiche --- CMakeLists.txt | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 67d50c2..f2bdaff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,48 +1,34 @@ cmake_minimum_required(VERSION 3.8.1) project(tcp_client_server) - - set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") enable_testing() find_package(cifuzz) - -add_library(${PROJECT_NAME} - src/tcp_client.cpp - src/tcp_server.cpp - src/client.cpp - src/pipe_ret_t.cpp - src/common.cpp) +set(SOURCES + src/tcp_client.cpp + src/tcp_server.cpp + src/client.cpp + src/pipe_ret_t.cpp + src/common.cpp +) + +add_library(${PROJECT_NAME} ${SOURCES}) option(SERVER_EXAMPLE "Build SERVER" ON) if(SERVER_EXAMPLE) - - add_definitions( - -DSERVER_EXAMPLE - ) - + add_definitions(-DSERVER_EXAMPLE) add_executable(tcp_server examples/server_example.cpp) - - target_link_libraries (tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) - + target_link_libraries(tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) endif() option(CLIENT_EXAMPLE "Build CLIENT" ON) if(CLIENT_EXAMPLE) - - add_definitions( - -DCLIENT_EXAMPLE - ) - + add_definitions(-DCLIENT_EXAMPLE) add_executable(tcp_client examples/client_example.cpp) - - target_link_libraries (tcp_client ${tcp_server} ${CMAKE_THREAD_LIBS_INIT}) - - - + target_link_libraries(tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) endif() From 82a5de5c228c9885b2426b13af77e06af35e8e9b Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 18:17:42 +0200 Subject: [PATCH 136/211] all --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2bdaff..e08db1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,12 @@ cmake_minimum_required(VERSION 3.8.1) -project(tcp_client_server) +project(TcpServer) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") -enable_testing() find_package(cifuzz) +enable_fuzz_testing() set(SOURCES src/tcp_client.cpp @@ -15,7 +16,12 @@ set(SOURCES src/common.cpp ) -add_library(${PROJECT_NAME} ${SOURCES}) +add_library(${PROJECT_NAME} + src/tcp_client.cpp + src/tcp_server.cpp + src/client.cpp + src/pipe_ret_t.cpp + src/common.cpp) option(SERVER_EXAMPLE "Build SERVER" ON) From e6d39ef86652ba1e5e6eb7eace7099ab417780d1 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 23:07:44 +0200 Subject: [PATCH 137/211] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e08db1b..9440415 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") find_package(cifuzz) -enable_fuzz_testing() + set(SOURCES src/tcp_client.cpp From 7d88040f69b0a8d88eb8e4c6a7b0f35b528f9e75 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 23:10:03 +0200 Subject: [PATCH 138/211] Update CMakeLists.txt --- CMakeLists.txt | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9440415..ccfee5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,11 @@ -cmake_minimum_required(VERSION 3.8.1) + cmake_minimum_required(VERSION 3.8.1) project(TcpServer) +find_package (Threads) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11") -find_package(cifuzz) - - -set(SOURCES - src/tcp_client.cpp - src/tcp_server.cpp - src/client.cpp - src/pipe_ret_t.cpp - src/common.cpp -) - add_library(${PROJECT_NAME} src/tcp_client.cpp src/tcp_server.cpp @@ -26,15 +16,27 @@ add_library(${PROJECT_NAME} option(SERVER_EXAMPLE "Build SERVER" ON) if(SERVER_EXAMPLE) - add_definitions(-DSERVER_EXAMPLE) + + add_definitions( + -DSERVER_EXAMPLE + ) + add_executable(tcp_server examples/server_example.cpp) - target_link_libraries(tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + + target_link_libraries (tcp_server ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + endif() option(CLIENT_EXAMPLE "Build CLIENT" ON) if(CLIENT_EXAMPLE) - add_definitions(-DCLIENT_EXAMPLE) + + add_definitions( + -DCLIENT_EXAMPLE + ) + add_executable(tcp_client examples/client_example.cpp) - target_link_libraries(tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + + target_link_libraries (tcp_client ${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) + endif() From c632bf6bcaaf9502fd5a3bed63fdda3fbc37b493 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 23:40:15 +0200 Subject: [PATCH 139/211] adding correct client.cpp --- examples/client_example.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/client_example.cpp b/examples/client_example.cpp index d6d48cb..64f4ea6 100644 --- a/examples/client_example.cpp +++ b/examples/client_example.cpp @@ -2,9 +2,7 @@ /////////////////////CLIENT EXAMPLE//////////////////////// /////////////////////////////////////////////////////////// -std::string message; -std::cin >> message; - +#ifdef CLIENT_EXAMPLE #include #include From d99bbd3d23a1d1fcd0a361f2572ad8a716c061e7 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 23:41:53 +0200 Subject: [PATCH 140/211] rmv --- .github/workflows/example.yml | 98 ----------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 .github/workflows/example.yml diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml deleted file mode 100644 index 1eadad3..0000000 --- a/.github/workflows/example.yml +++ /dev/null @@ -1,98 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - container: cifuzz/builder-zint:llvm-13 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - - name: Build fuzzers - env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - run: | - sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" - export PATH="$PATH:$HOME/cifuzz/bin" - cifuzz bundle - mkdir fuzz_tests && cd fuzz_tests - tar -xvzf ../fuzz_tests.tar.gz - egrep -v 'library_paths|- ""' cifuzz.yaml > cifuzz2.yaml - sed 's|ubuntu|cifuzz/builder-zint:llvm-13|' cifuzz2.yaml > cifuzz.yaml - echo "code_revision:" >> cifuzz.yaml - echo " git:" >> cifuzz.yaml - echo " commit: $GITHUB_SHA" >> cifuzz.yaml - echo " branch: $BRANCH_NAME" >> cifuzz.yaml - cat cifuzz.yaml - tar -cvzf ../fuzz_tests.tar.gz * - - - name: Upload fuzzer - id: start-fuzzing - env: - BEARER_TOKEN: ${{secrets.CI_FUZZ_API_TOKEN}} - run: | - export IMPORT_RESULT=$(curl -s \ - -H "Authorization: Bearer $BEARER_TOKEN" \ - -F 'fuzzing-artifacts=@fuzz_tests.tar.gz' \ - https://app.code-intelligence.com/v2/projects/c-cpp-demo-c170bc17/artifacts/import) - echo "${IMPORT_RESULT}" - export ARTIFACT_NAME=$(echo "$IMPORT_RESULT" | jq -r '."resource-name"') - echo "https://app.code-intelligence.com/v1/${ARTIFACT_NAME}:run" - export RUN_RESULT=$(curl -X POST -H "Authorization: Bearer $BEARER_TOKEN" \ - "https://app.code-intelligence.com/v1/${ARTIFACT_NAME}:run") - echo "${RUN_RESULT}" - export CAMPAIGN_RUN_NAME=$(echo "$RUN_RESULT" | jq -r '."name"') - echo "::set-output name=test_collection_run::${CAMPAIGN_RUN_NAME}" - - - name: Monitor Fuzzing - uses: CodeIntelligenceTesting/github-actions/monitor-fuzzing@v3 - with: - ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: grpc.code-intelligence.com:443 - dashboard_address: https://app.code-intelligence.com/ - timeout: 180 - - - name: Save Fuzz Test Results - uses: CodeIntelligenceTesting/github-actions/save-results@v3 - if: ${{ success() || failure() }} - with: - ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} - test_collection_run: ${{ steps.start-fuzzing.outputs.test_collection_run }} - fuzzing_server_address: grpc.code-intelligence.com:443 - dashboard_address: https://app.code-intelligence.com/ - - - id: upload-artifact - uses: actions/upload-artifact@v2 - if: ${{ (success() || failure()) }} - with: - name: ci_fuzz_results - path: | - findings.json - coverage.json - web_app_address.txt - - - id: coverage - uses: CodeIntelligenceTesting/github-actions/report-coverage@master - with: - ci_fuzz_api_token: ${{secrets.CI_FUZZ_API_TOKEN}} - project: c-cpp-demo-c170bc17 - test_collection_run: ${{ steps.start-fuzzing.outputs.test-collection-run }} From 16e2fb9168e14459f756ea82269a41c8c263bb7e Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:10:52 +0200 Subject: [PATCH 141/211] chang1 --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 83fb992..c6f73df 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,8 +55,9 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cd ${{ env.CHECKOUT_DIR }}/build - cmake -S . + cd /home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer + cmake .. + make #make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B #cmake --build build From a6ae81bd39f9799bb34ddfd63b32d856faac736d Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:25:07 +0200 Subject: [PATCH 142/211] vediamo --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c6f73df..138d9ba 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,11 +53,12 @@ jobs: sudo apt-get update - name: Build Server + run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cd /home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer + #cd /home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer cmake .. - make + cmake --build . #make #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B #cmake --build build From 7c2af59c331038601ed2c5c2502cfee837f662ee Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:26:25 +0200 Subject: [PATCH 143/211] vul_1 --- .github/workflows/Vulnerability.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 138d9ba..04bb0cd 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,18 +53,11 @@ jobs: sudo apt-get update - name: Build Server - run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - #cd /home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer cmake .. cmake --build . - #make - #cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} # cmake [options] -S -B - #cmake --build build - #cd build - #./tcp_server - + #- name: Build Client # run: | From 469bdb0ba3c92f8f779b8b0b3e5c025c72645393 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:39:24 +0200 Subject: [PATCH 144/211] CA --- .../api/v1/query/client-vscode/query.json | 1 + .../address+undefined/CMakeCache.txt | 97 +++++++++++++++++++ .../CMakeFiles/3.22.3/CMakeSystem.cmake | 15 +++ .../CMakeFiles/CMakeOutput.log | 1 + .../CMakeFiles/cmake.check_cache | 1 + .github/workflows/Vulnerability.yml | 5 +- 6 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 .cifuzz-build/libfuzzer/address+undefined/.cmake/api/v1/query/client-vscode/query.json create mode 100644 .cifuzz-build/libfuzzer/address+undefined/CMakeCache.txt create mode 100644 .cifuzz-build/libfuzzer/address+undefined/CMakeFiles/3.22.3/CMakeSystem.cmake create mode 100644 .cifuzz-build/libfuzzer/address+undefined/CMakeFiles/CMakeOutput.log create mode 100644 .cifuzz-build/libfuzzer/address+undefined/CMakeFiles/cmake.check_cache diff --git a/.cifuzz-build/libfuzzer/address+undefined/.cmake/api/v1/query/client-vscode/query.json b/.cifuzz-build/libfuzzer/address+undefined/.cmake/api/v1/query/client-vscode/query.json new file mode 100644 index 0000000..82bb964 --- /dev/null +++ b/.cifuzz-build/libfuzzer/address+undefined/.cmake/api/v1/query/client-vscode/query.json @@ -0,0 +1 @@ +{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]} \ No newline at end of file diff --git a/.cifuzz-build/libfuzzer/address+undefined/CMakeCache.txt b/.cifuzz-build/libfuzzer/address+undefined/CMakeCache.txt new file mode 100644 index 0000000..ce5ba0a --- /dev/null +++ b/.cifuzz-build/libfuzzer/address+undefined/CMakeCache.txt @@ -0,0 +1,97 @@ +# This is the CMakeCache file. +# For build in directory: /home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer/.cifuzz-build/libfuzzer/address+undefined +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//No help, variable specified on the command line. +CIFUZZ_ENGINE:UNINITIALIZED=libfuzzer + +//No help, variable specified on the command line. +CIFUZZ_SANITIZERS:UNINITIALIZED=address;undefined + +//No help, variable specified on the command line. +CIFUZZ_TESTING:BOOL=ON + +//No help, variable specified on the command line. +CMAKE_BUILD_RPATH_USE_ORIGIN:BOOL=ON + +//No help, variable specified on the command line. +CMAKE_BUILD_TYPE:UNINITIALIZED=RelWithDebInfo + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=TcpServer + +//Value Computed by CMake +TcpServer_BINARY_DIR:STATIC=/home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer/.cifuzz-build/libfuzzer/address+undefined + +//Value Computed by CMake +TcpServer_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +TcpServer_SOURCE_DIR:STATIC=/home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer + + +######################## +# INTERNAL cache entries +######################## + +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer/.cifuzz-build/libfuzzer/address+undefined +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=22 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/zacarias/Desktop/CodeIntelligence/TcpServer/TcpServer +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.22 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname + diff --git a/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/3.22.3/CMakeSystem.cmake b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/3.22.3/CMakeSystem.cmake new file mode 100644 index 0000000..14a03a4 --- /dev/null +++ b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/3.22.3/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-5.4.0-110-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "5.4.0-110-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-5.4.0-110-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "5.4.0-110-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/CMakeOutput.log b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/CMakeOutput.log new file mode 100644 index 0000000..b557a2d --- /dev/null +++ b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/CMakeOutput.log @@ -0,0 +1 @@ +The system is: Linux - 5.4.0-110-generic - x86_64 diff --git a/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/cmake.check_cache b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/.cifuzz-build/libfuzzer/address+undefined/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 04bb0cd..e5aac1a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,8 +55,9 @@ jobs: - name: Build Server run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cmake .. - cmake --build . + cd ${{ env.CHECKOUT_DIR }}/build + #make .. + #make --build . #- name: Build Client From cc3c5e5baa4e71519e65668fdeaa16334b2d49c8 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:44:40 +0200 Subject: [PATCH 145/211] UPS --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index e5aac1a..98aa88c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -56,7 +56,7 @@ jobs: run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cd ${{ env.CHECKOUT_DIR }}/build - #make .. + make .. #make --build . From aaf472dc73abdd102a40864e27a0a859c33b1be0 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:46:28 +0200 Subject: [PATCH 146/211] NT --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 98aa88c..a0efb3a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,6 +53,7 @@ jobs: sudo apt-get update - name: Build Server + working-directory: ./TcpServer/build run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cd ${{ env.CHECKOUT_DIR }}/build From 10cfd41d2fb346a1e0729c538afd03e508ee4d05 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:48:58 +0200 Subject: [PATCH 147/211] SVAI --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index a0efb3a..c2224e8 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -53,11 +53,11 @@ jobs: sudo apt-get update - name: Build Server - working-directory: ./TcpServer/build + #working-directory: ./TcpServer/build run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cd ${{ env.CHECKOUT_DIR }}/build - make .. + Cmake .. #make --build . From 7ae036ae122a09f098e7e8dae64ea1ab4f8cfee0 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:51:09 +0200 Subject: [PATCH 148/211] bast --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c2224e8..769fc7a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -57,7 +57,7 @@ jobs: run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build cd ${{ env.CHECKOUT_DIR }}/build - Cmake .. + cmake .. #make --build . From 03cafee9ebf694aee000bb998750d0677f06f051 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:53:08 +0200 Subject: [PATCH 149/211] tre --- .github/workflows/Vulnerability.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 769fc7a..606fa37 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -56,7 +56,6 @@ jobs: #working-directory: ./TcpServer/build run: | cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build - cd ${{ env.CHECKOUT_DIR }}/build cmake .. #make --build . From f98ba1df963ed894ee92cc43f60d98b71d7563eb Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:54:11 +0200 Subject: [PATCH 150/211] trrrr --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 606fa37..89ceeb6 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -55,7 +55,7 @@ jobs: - name: Build Server #working-directory: ./TcpServer/build run: | - cp CMakeLists.txt ${{ env.CHECKOUT_DIR }}/build + cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} cmake .. #make --build . From 0a86eb4f83c6d1d138f6f1108852c95000f6b752 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:57:35 +0200 Subject: [PATCH 151/211] bod --- .github/workflows/Vulnerability.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 89ceeb6..cd1debe 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -40,6 +40,7 @@ jobs: - name: Create Destination Directory run: | mkdir -p ${{ env.CHECKOUT_DIR }}/build/ + cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} - name: Install cifuzz @@ -55,9 +56,9 @@ jobs: - name: Build Server #working-directory: ./TcpServer/build run: | - cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} - cmake .. - #make --build . + #cp CMakeLists.txt ${{ env.CHECKOUT_DIR }/} + cmake . + cmake --build . #- name: Build Client From 4cca549d084d56dd45c2c61152e2d2e6b93f300f Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 00:58:51 +0200 Subject: [PATCH 152/211] mmmm --- .github/workflows/Vulnerability.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index cd1debe..97af2a5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -54,9 +54,8 @@ jobs: sudo apt-get update - name: Build Server - #working-directory: ./TcpServer/build - run: | - #cp CMakeLists.txt ${{ env.CHECKOUT_DIR }/} + #working-directory: ./TcpServer/build + run: | cmake . cmake --build . From c15237dab7a40b6657b434b6ceabad81e91f8432 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 09:37:01 +0200 Subject: [PATCH 153/211] ops --- .github/workflows/Vulnerability.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 97af2a5..76340f5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -66,13 +66,11 @@ jobs: # g++ client.cpp -o client - name: Start Server - run: | - cd ${{ env.CHECKOUT_DIR }}/build + run: | ./tcp_server - name: Run Fuzz Test run: | - cd ${{ env.CHECKOUT_DIR }}/build ./client - name: Save Fuzz Test Results From a13f6873289ab146df9a81cbe750f55cea1266ea Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 09:56:25 +0200 Subject: [PATCH 154/211] Client --- .github/workflows/Vulnerability.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 76340f5..b012cb4 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -54,22 +54,15 @@ jobs: sudo apt-get update - name: Build Server - #working-directory: ./TcpServer/build run: | cmake . cmake --build . - - #- name: Build Client - # run: | - # cd ${{ env.CHECKOUT_DIR }} - # g++ client.cpp -o client - - name: Start Server run: | ./tcp_server - - name: Run Fuzz Test + - name: Start Client run: | ./client From b3047cc4a4f2e4a8bff10042b2ef1c61e165b386 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:33:55 +0200 Subject: [PATCH 155/211] percentual --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index b012cb4..2fe8daa 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -60,7 +60,7 @@ jobs: - name: Start Server run: | - ./tcp_server + ./tcp_server & - name: Start Client run: | From 0f5771813714a3a925f6071da3c4d7c43494a894 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:36:28 +0200 Subject: [PATCH 156/211] tcp_client --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 2fe8daa..51c88f9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,7 +64,7 @@ jobs: - name: Start Client run: | - ./client + ./tcp_client - name: Save Fuzz Test Results if: always() From 2ebdc8b69df586c22e9ea547e7dc9a139fd1db02 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:45:59 +0200 Subject: [PATCH 157/211] send msg --- .github/workflows/Vulnerability.yml | 6 ++++++ .vscode/settings.json | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 51c88f9..053d5b6 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -65,7 +65,13 @@ jobs: - name: Start Client run: | ./tcp_client + 1 + + - name: Send Message to Server + run: | + echo "1" | ./tcp_client + - name: Save Fuzz Test Results if: always() run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 24c6579..b3553ae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,13 @@ { "cmake.configureOnOpen": true, "files.associations": { + "*.py": "python", + "*.txt": "plaintext", "*.yml": "cpp", "chrono": "cpp", "system_error": "cpp", - "xlocale": "cpp" + "xlocale": "cpp", + "typeinfo": "cpp" }, "githubPullRequests.ignoredPullRequestBranches": [ "main" From 57c1a4260ca8416748c758fb792d4536a920e37a Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:49:10 +0200 Subject: [PATCH 158/211] send msg --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 053d5b6..50481b4 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -65,12 +65,13 @@ jobs: - name: Start Client run: | ./tcp_client - 1 + echo "1" | ./tcp_client # choose to send the msg to the server - name: Send Message to Server run: | - echo "1" | ./tcp_client + echo "Ciao" | ./tcp_client # Sending a msg to the server + echo "2" | ./tcp_client # Choose option 2 to close and exit - name: Save Fuzz Test Results if: always() From 14d4f30f030996865d683ce11a542f0ce2ae25f6 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:56:17 +0200 Subject: [PATCH 159/211] test --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 50481b4..9af1bcc 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -65,7 +65,7 @@ jobs: - name: Start Client run: | ./tcp_client - echo "1" | ./tcp_client # choose to send the msg to the server + cd /Fuzzing - name: Send Message to Server From 5eb40e24290459a1355f0c61dff45053517fa081 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 11:59:40 +0200 Subject: [PATCH 160/211] cat --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9af1bcc..2924106 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -65,7 +65,7 @@ jobs: - name: Start Client run: | ./tcp_client - cd /Fuzzing + cat input.txt | ./tcp_client - name: Send Message to Server From 641902dcb8ae5a6305adc7662d32c71bec0fd6bf Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:02:01 +0200 Subject: [PATCH 161/211] cat2 --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 2924106..168add0 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,8 +64,8 @@ jobs: - name: Start Client run: | - ./tcp_client - cat input.txt | ./tcp_client + ./tcp_client & cat input.txt | ./tcp_client + - name: Send Message to Server From 22cbfba820d835be269e149b3580bde8d49fb5b8 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:09:50 +0200 Subject: [PATCH 162/211] list --- .github/workflows/Vulnerability.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 168add0..97f7a6d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -57,10 +57,16 @@ jobs: run: | cmake . cmake --build . - + - name: List Directories + run: | + ls #List the files in the current directory + pwd #display the working directory + - name: Start Server run: | - ./tcp_server & + ./tcp_server & ls + + - name: Start Client run: | From cd5f76b07c99ee84633d7e185823dcf5f3e2f60b Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:15:57 +0200 Subject: [PATCH 163/211] cav --- .github/workflows/Vulnerability.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 97f7a6d..878ff5d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -57,10 +57,14 @@ jobs: run: | cmake . cmake --build . + - name: List Directories - run: | - ls #List the files in the current directory - pwd #display the working directory + run: | + pwd && ls # display the working directory and List the files in the current directory + + - name: Work on the build dir + run: | + cd /TcpServer/build && ls - name: Start Server run: | From 6e287b34d6f7577254241f9785523c95752f9d40 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:17:02 +0200 Subject: [PATCH 164/211] bb --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 878ff5d..f60ad48 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,7 +64,7 @@ jobs: - name: Work on the build dir run: | - cd /TcpServer/build && ls + cd /TcpServer/ && ls - name: Start Server run: | From 2aed82d1284f128f2ca54c0a986eec1631ae0394 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:19:15 +0200 Subject: [PATCH 165/211] add build --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f60ad48..62e14b3 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,7 +64,7 @@ jobs: - name: Work on the build dir run: | - cd /TcpServer/ && ls + cd /home/runner/work/TcpServer/TcpServer/build && ls - name: Start Server run: | From e9905c6ce53ed3263c6fc7f412fec0f621ebc086 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:21:54 +0200 Subject: [PATCH 166/211] letsgo --- .cifuzz-build/input.txt | 2 ++ .github/workflows/Vulnerability.yml | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 .cifuzz-build/input.txt diff --git a/.cifuzz-build/input.txt b/.cifuzz-build/input.txt new file mode 100644 index 0000000..bccb652 --- /dev/null +++ b/.cifuzz-build/input.txt @@ -0,0 +1,2 @@ +1 +Ciao \ No newline at end of file diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 62e14b3..5b02a61 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -61,10 +61,6 @@ jobs: - name: List Directories run: | pwd && ls # display the working directory and List the files in the current directory - - - name: Work on the build dir - run: | - cd /home/runner/work/TcpServer/TcpServer/build && ls - name: Start Server run: | From 3830945faa0c947078c3cacfbb14fb15ae8f1eea Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:23:26 +0200 Subject: [PATCH 167/211] double --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5b02a61..f7ad3db 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,13 +64,13 @@ jobs: - name: Start Server run: | - ./tcp_server & ls + ./tcp_server - name: Start Client run: | - ./tcp_client & cat input.txt | ./tcp_client + ./tcp_client && cat input.txt | ./tcp_client From c710221a44980cc2fe05f417fc3ddc2646606846 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:24:32 +0200 Subject: [PATCH 168/211] vedi --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f7ad3db..e6928ca 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -66,11 +66,11 @@ jobs: run: | ./tcp_server - - name: Start Client run: | - ./tcp_client && cat input.txt | ./tcp_client + ./tcp_client + cat input.txt | ./tcp_client From 7c67187b142bb94f8a030da239e0d1bf51b8ed20 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:27:33 +0200 Subject: [PATCH 169/211] arg1 --- .github/workflows/Vulnerability.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index e6928ca..8e72aa7 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -66,16 +66,13 @@ jobs: run: | ./tcp_server - - name: Start Client run: | - ./tcp_client - cat input.txt | ./tcp_client - - + ./tcp_client 1 - name: Send Message to Server run: | + cat input.txt | ./tcp_client echo "Ciao" | ./tcp_client # Sending a msg to the server echo "2" | ./tcp_client # Choose option 2 to close and exit From 1f1abbef04587ba779f3971ffc4f13ebcf90099a Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:29:59 +0200 Subject: [PATCH 170/211] buru --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8e72aa7..36cb2ba 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,7 @@ jobs: - name: Start Client run: | - ./tcp_client 1 + ./tcp_client & 1 - name: Send Message to Server run: | From df63e37b546762348dddaed077c93a619c6b657b Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:31:42 +0200 Subject: [PATCH 171/211] chep --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 36cb2ba..c6b9d2b 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -64,7 +64,7 @@ jobs: - name: Start Server run: | - ./tcp_server + ./tcp_server & - name: Start Client run: | From e032dbd80821b201961f31afd27e21bba446c6f2 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:34:05 +0200 Subject: [PATCH 172/211] jumo --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c6b9d2b..a9f8e36 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,7 +68,7 @@ jobs: - name: Start Client run: | - ./tcp_client & 1 + ./tcp_client & - name: Send Message to Server run: | From daae38260ab73f403d37aba71a21f5d5363bddaf Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:36:50 +0200 Subject: [PATCH 173/211] vaios --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index a9f8e36..5793ce7 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,11 +68,11 @@ jobs: - name: Start Client run: | - ./tcp_client & + cat input.txt | ./tcp_client - name: Send Message to Server run: | - cat input.txt | ./tcp_client + echo -e "1\n Mio msg" | ./tcp_client echo "Ciao" | ./tcp_client # Sending a msg to the server echo "2" | ./tcp_client # Choose option 2 to close and exit From 88752961363d3451a7eb12e584b4e95b74483ed6 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:38:15 +0200 Subject: [PATCH 174/211] vurios --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5793ce7..86f5da6 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -41,6 +41,7 @@ jobs: run: | mkdir -p ${{ env.CHECKOUT_DIR }}/build/ cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} + ls ${{ env.CHECKOUT_DIR }} - name: Install cifuzz From 78bb4a7c9650abb7a2352f57139183e73ca2b83e Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Mon, 19 Jun 2023 12:41:07 +0200 Subject: [PATCH 175/211] Create start.txt --- start.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 start.txt diff --git a/start.txt b/start.txt new file mode 100644 index 0000000..91b9f0b --- /dev/null +++ b/start.txt @@ -0,0 +1,2 @@ +1 +Ciao From fbaf647c29ceb0c787fa5492fd2b036a5b92656a Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:43:01 +0200 Subject: [PATCH 176/211] it --- .github/workflows/Vulnerability.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 86f5da6..cc5e9d9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -35,12 +35,14 @@ jobs: - name: Download CMakeLists.txt run: | curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + curl -sSL -o start.txt https://github.com/gladzeka/TcpServer/tree/main/start.txt - name: Create Destination Directory run: | mkdir -p ${{ env.CHECKOUT_DIR }}/build/ cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} + cp start.txt ${{ env.CHECKOUT_DIR }} ls ${{ env.CHECKOUT_DIR }} From 8072f2f446b4e3b2e4dc3250890a3ee0f222487e Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:46:47 +0200 Subject: [PATCH 177/211] bbbb --- .github/workflows/Vulnerability.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index cc5e9d9..47801e9 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -37,12 +37,10 @@ jobs: curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt curl -sSL -o start.txt https://github.com/gladzeka/TcpServer/tree/main/start.txt - - name: Create Destination Directory run: | mkdir -p ${{ env.CHECKOUT_DIR }}/build/ cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} - cp start.txt ${{ env.CHECKOUT_DIR }} ls ${{ env.CHECKOUT_DIR }} @@ -64,6 +62,7 @@ jobs: - name: List Directories run: | pwd && ls # display the working directory and List the files in the current directory + cp start.txt ${{ env.CHECKOUT_DIR }} - name: Start Server run: | From 703b8b7efca0418729e7f66cbe0ab367baf8a092 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:48:57 +0200 Subject: [PATCH 178/211] aa --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 47801e9..573ef21 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -70,6 +70,7 @@ jobs: - name: Start Client run: | + pwd && ls cat input.txt | ./tcp_client - name: Send Message to Server From 807ae2c04e951563d5bdd02a373b43b0b3067f71 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:51:01 +0200 Subject: [PATCH 179/211] non --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 573ef21..c1b07ea 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -63,6 +63,7 @@ jobs: run: | pwd && ls # display the working directory and List the files in the current directory cp start.txt ${{ env.CHECKOUT_DIR }} + cp start.txt /home/runner/work/TcpServer/TcpServer - name: Start Server run: | From 58890221ea701b22096d5ead54a37b543769fc6d Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:52:38 +0200 Subject: [PATCH 180/211] error1 --- .github/workflows/Vulnerability.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index c1b07ea..573ef21 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -63,7 +63,6 @@ jobs: run: | pwd && ls # display the working directory and List the files in the current directory cp start.txt ${{ env.CHECKOUT_DIR }} - cp start.txt /home/runner/work/TcpServer/TcpServer - name: Start Server run: | From 136b1b124ad7b2aca0417f52f0ecd3511ec80df1 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:57:18 +0200 Subject: [PATCH 181/211] vetttt --- .github/workflows/Vulnerability.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 573ef21..85abf5c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -27,7 +27,11 @@ jobs: repository: gladzeka/TcpServer ref: main - + - name: Create Input.txt + run: | + echo "1" > input.txt + echo "Your message" >> input.txt + - name: Setup CMake run: | sudo apt-get install -y cmake From cc186b034c25cc67249f6986e9df17ee874b5546 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 12:59:57 +0200 Subject: [PATCH 182/211] one --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 85abf5c..e0da68f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -31,7 +31,7 @@ jobs: run: | echo "1" > input.txt echo "Your message" >> input.txt - + - name: Setup CMake run: | sudo apt-get install -y cmake @@ -66,7 +66,7 @@ jobs: - name: List Directories run: | pwd && ls # display the working directory and List the files in the current directory - cp start.txt ${{ env.CHECKOUT_DIR }} + - name: Start Server run: | From 8fb77526fe5c53ca09e40f4d15ae3d1302fbb854 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:02:28 +0200 Subject: [PATCH 183/211] control22 --- .github/workflows/Vulnerability.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index e0da68f..9a1e107 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -30,7 +30,7 @@ jobs: - name: Create Input.txt run: | echo "1" > input.txt - echo "Your message" >> input.txt + echo ",CIAO_Zac" >> input.txt - name: Setup CMake run: | @@ -39,7 +39,7 @@ jobs: - name: Download CMakeLists.txt run: | curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - curl -sSL -o start.txt https://github.com/gladzeka/TcpServer/tree/main/start.txt + - name: Create Destination Directory run: | @@ -67,7 +67,6 @@ jobs: run: | pwd && ls # display the working directory and List the files in the current directory - - name: Start Server run: | ./tcp_server & @@ -75,7 +74,7 @@ jobs: - name: Start Client run: | pwd && ls - cat input.txt | ./tcp_client + cat ${{ env.CHECKOUT_DIR }}/input.txt | ./tcp_client - name: Send Message to Server run: | From 980d57289f5c9f155eb87e3263e01fed9aae34af Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:04:07 +0200 Subject: [PATCH 184/211] back --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9a1e107..757b1ba 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -67,6 +67,7 @@ jobs: run: | pwd && ls # display the working directory and List the files in the current directory + - name: Start Server run: | ./tcp_server & @@ -74,7 +75,7 @@ jobs: - name: Start Client run: | pwd && ls - cat ${{ env.CHECKOUT_DIR }}/input.txt | ./tcp_client + cat input.txt | ./tcp_client - name: Send Message to Server run: | From e4509b4d899d72f4947189e895278ac9ea3d526b Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:13:18 +0200 Subject: [PATCH 185/211] test folder --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 757b1ba..901f51e 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,8 +74,8 @@ jobs: - name: Start Client run: | - pwd && ls cat input.txt | ./tcp_client + cd test && ls - name: Send Message to Server run: | From f6f0e2bb41f13dc66fe92d2e026027610600daa5 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:14:45 +0200 Subject: [PATCH 186/211] before --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 901f51e..03e67a5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,8 +74,9 @@ jobs: - name: Start Client run: | - cat input.txt | ./tcp_client cd test && ls + cat input.txt | ./tcp_client + - name: Send Message to Server run: | From dd4906222b859c2c63b6598de3b4c5a2617cffc5 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:21:43 +0200 Subject: [PATCH 187/211] error --- .github/workflows/Vulnerability.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 03e67a5..4ad99a3 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,8 +74,10 @@ jobs: - name: Start Client run: | + cd test && ls - cat input.txt | ./tcp_client + cat input.txt | ./tcp_client + continue-on-error: true - name: Send Message to Server From 766e22efb122d4a5b3d70bca4ab0693e7f4935fc Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:26:32 +0200 Subject: [PATCH 188/211] many --- .github/workflows/Vulnerability.yml | 13 ++++--- test/Fuzzing/DoS.py | 20 +++++++++++ test/Fuzzing/crash.py | 27 ++++++++++++++ test/Fuzzing/input_dir/accesscontrol.py | 16 +++++++++ test/Fuzzing/input_dir/output_dir/cmdline | 2 ++ test/Fuzzing/input_dir/output_dir/plot_data | 1 + test/Fuzzing/input_dir/testcase1.py | 32 +++++++++++++++++ test/Fuzzing/input_dir/testcase2 | 1 + test/Fuzzing/inputvalidation.py | 36 +++++++++++++++++++ test/Fuzzing/output_dir/.cur_input | 0 test/Fuzzing/output_dir/cmdline | 1 + test/Fuzzing/output_dir/plot_data | 1 + .../id:000000,time:0,orig:accesscontrol.py | 16 +++++++++ .../queue/id:000001,time:0,orig:crash.py | 27 ++++++++++++++ .../queue/id:000002,time:0,orig:testcase1.py | 32 +++++++++++++++++ .../queue/id:000003,time:0,orig:testcase2 | 1 + 16 files changed, 219 insertions(+), 7 deletions(-) create mode 100644 test/Fuzzing/DoS.py create mode 100644 test/Fuzzing/crash.py create mode 100644 test/Fuzzing/input_dir/accesscontrol.py create mode 100644 test/Fuzzing/input_dir/output_dir/cmdline create mode 100644 test/Fuzzing/input_dir/output_dir/plot_data create mode 100644 test/Fuzzing/input_dir/testcase1.py create mode 100644 test/Fuzzing/input_dir/testcase2 create mode 100644 test/Fuzzing/inputvalidation.py create mode 100644 test/Fuzzing/output_dir/.cur_input create mode 100644 test/Fuzzing/output_dir/cmdline create mode 100644 test/Fuzzing/output_dir/plot_data create mode 100644 test/Fuzzing/output_dir/queue/id:000000,time:0,orig:accesscontrol.py create mode 100644 test/Fuzzing/output_dir/queue/id:000001,time:0,orig:crash.py create mode 100644 test/Fuzzing/output_dir/queue/id:000002,time:0,orig:testcase1.py create mode 100644 test/Fuzzing/output_dir/queue/id:000003,time:0,orig:testcase2 diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 4ad99a3..5d55650 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -74,17 +74,16 @@ jobs: - name: Start Client run: | - - cd test && ls cat input.txt | ./tcp_client + echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true - - - name: Send Message to Server + - name: My Fuzz Client run: | - echo -e "1\n Mio msg" | ./tcp_client - echo "Ciao" | ./tcp_client # Sending a msg to the server - echo "2" | ./tcp_client # Choose option 2 to close and exit + cd test/Fuzzing && ls + python inputvalidation.py + + - name: Save Fuzz Test Results if: always() diff --git a/test/Fuzzing/DoS.py b/test/Fuzzing/DoS.py new file mode 100644 index 0000000..d0d65bd --- /dev/null +++ b/test/Fuzzing/DoS.py @@ -0,0 +1,20 @@ +import socket + +# Connect to the server +server_address = ('localhost', 65123) +client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client_socket.connect(server_address) + +# Define the payload to be sent repeatedly +payload = "A" * 1000 # Adjust the payload length as needed + +try: + # Send the payload repeatedly + while True: + client_socket.sendall(payload.encode()) +except KeyboardInterrupt: + # Interrupt the loop on keyboard interrupt + pass + +# Close the connection +client_socket.close() diff --git a/test/Fuzzing/crash.py b/test/Fuzzing/crash.py new file mode 100644 index 0000000..d7f97d5 --- /dev/null +++ b/test/Fuzzing/crash.py @@ -0,0 +1,27 @@ +import random + +# Function to fuzz-test +def process_input(input_string): + if input_string == "crash": + # Simulate a crash or error condition + raise Exception("Crash detected!") + else: + # Process the input normally + print("Processing input:", input_string) + +# Fuzz test the process_input function +def fuzz_test(): + while True: + # Generate a random input + input_length = random.randint(1, 10) + input_chars = [chr(random.randint(32, 126)) for _ in range(input_length)] + input_string = "".join(input_chars) + + # Call the process_input function with the generated input + try: + process_input(input_string) + except Exception as e: + print("Exception:", str(e)) + +# Run the fuzz test +fuzz_test() diff --git a/test/Fuzzing/input_dir/accesscontrol.py b/test/Fuzzing/input_dir/accesscontrol.py new file mode 100644 index 0000000..80694e1 --- /dev/null +++ b/test/Fuzzing/input_dir/accesscontrol.py @@ -0,0 +1,16 @@ + # Define the vulnerable function +def vulnerable_function(user_input): + if user_input == "admin": + print("Access granted!") + else: + print("Access denied!") + +# Fuzzing with AFL +import subprocess + +# Define the AFL command +afl_command = ["afl-fuzz", "-i", "input_dir", "-o", "output_dir", "--", "python", "-c", + "from main import vulnerable_function; import sys; vulnerable_function(sys.stdin.readline().strip())"] + +# Start the fuzzing process +subprocess.run(afl_command) diff --git a/test/Fuzzing/input_dir/output_dir/cmdline b/test/Fuzzing/input_dir/output_dir/cmdline new file mode 100644 index 0000000..9379a34 --- /dev/null +++ b/test/Fuzzing/input_dir/output_dir/cmdline @@ -0,0 +1,2 @@ +python +fuzzer.py diff --git a/test/Fuzzing/input_dir/output_dir/plot_data b/test/Fuzzing/input_dir/output_dir/plot_data new file mode 100644 index 0000000..4461bb2 --- /dev/null +++ b/test/Fuzzing/input_dir/output_dir/plot_data @@ -0,0 +1 @@ +# unix_time, cycles_done, cur_path, paths_total, pending_total, pending_favs, map_size, unique_crashes, unique_hangs, max_depth, execs_per_sec diff --git a/test/Fuzzing/input_dir/testcase1.py b/test/Fuzzing/input_dir/testcase1.py new file mode 100644 index 0000000..97ca304 --- /dev/null +++ b/test/Fuzzing/input_dir/testcase1.py @@ -0,0 +1,32 @@ +import socket + +# Connect to the server +server_address = ('localhost', 65123) +client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client_socket.connect(server_address) + +# Craft a test case for input validation +# Modify the client IP and message to simulate different scenarios +# Example 1: Valid input +client_ip = '127.0.0.1' +message = 'Hello, server!' +# Example 2: Invalid input (containing a semicolon) +# client_ip = '127.0.0.1;' +# message = 'Malicious payload' +# Example 3: Invalid input (empty client IP) +# client_ip = '' +# message = 'Hello, server!' + +# Craft the payload by combining client IP and message +payload = f'{client_ip}\n{message}' + +# Send the payload to the server +client_socket.sendall(payload.encode()) + +# Receive and print the server's response +response = client_socket.recv(1024).decode() +print(response) + +# Close the connection +client_socket.close() + diff --git a/test/Fuzzing/input_dir/testcase2 b/test/Fuzzing/input_dir/testcase2 new file mode 100644 index 0000000..140c703 --- /dev/null +++ b/test/Fuzzing/input_dir/testcase2 @@ -0,0 +1 @@ +name="DoS.py" diff --git a/test/Fuzzing/inputvalidation.py b/test/Fuzzing/inputvalidation.py new file mode 100644 index 0000000..d299d0e --- /dev/null +++ b/test/Fuzzing/inputvalidation.py @@ -0,0 +1,36 @@ +""" +By executing this Python code, I want to emulating a client that sends the malicious payload to the server +attempting to exploit the input validation vulnerability +""" + +import socket +# Connect to the server +server_address = ('localhost', 65123) +client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client_socket.connect(server_address) + +# Craft a malicious client IP and message +# Modifying the inputs to "127.0.0.1; rm -rf /" +# Establishing a connection with the server using a socket. +# Then, I craft a payload by combining the malicious client IP (127.0.0.1; rm -rf /) and message (S; rm -rf /). +# I send the payload to the server and receive the server's response. +# +client_ip = '127.0.0.1; rm -rf /' +message = 'S; rm -rf /' +message2 = '127.0.0.1' + + +# Craft the payload by combining client IP and message +payload = f'{client_ip}\n{message}\n{message2}' + +# Send the payload to the server +client_socket.sendall(payload.encode()) + +# Receive and print the server's response +response = client_socket.recv(1024).decode() +print(response) + +# Close the connection +client_socket.close() + + diff --git a/test/Fuzzing/output_dir/.cur_input b/test/Fuzzing/output_dir/.cur_input new file mode 100644 index 0000000..e69de29 diff --git a/test/Fuzzing/output_dir/cmdline b/test/Fuzzing/output_dir/cmdline new file mode 100644 index 0000000..bf2fc12 --- /dev/null +++ b/test/Fuzzing/output_dir/cmdline @@ -0,0 +1 @@ +tcp_server diff --git a/test/Fuzzing/output_dir/plot_data b/test/Fuzzing/output_dir/plot_data new file mode 100644 index 0000000..4461bb2 --- /dev/null +++ b/test/Fuzzing/output_dir/plot_data @@ -0,0 +1 @@ +# unix_time, cycles_done, cur_path, paths_total, pending_total, pending_favs, map_size, unique_crashes, unique_hangs, max_depth, execs_per_sec diff --git a/test/Fuzzing/output_dir/queue/id:000000,time:0,orig:accesscontrol.py b/test/Fuzzing/output_dir/queue/id:000000,time:0,orig:accesscontrol.py new file mode 100644 index 0000000..80694e1 --- /dev/null +++ b/test/Fuzzing/output_dir/queue/id:000000,time:0,orig:accesscontrol.py @@ -0,0 +1,16 @@ + # Define the vulnerable function +def vulnerable_function(user_input): + if user_input == "admin": + print("Access granted!") + else: + print("Access denied!") + +# Fuzzing with AFL +import subprocess + +# Define the AFL command +afl_command = ["afl-fuzz", "-i", "input_dir", "-o", "output_dir", "--", "python", "-c", + "from main import vulnerable_function; import sys; vulnerable_function(sys.stdin.readline().strip())"] + +# Start the fuzzing process +subprocess.run(afl_command) diff --git a/test/Fuzzing/output_dir/queue/id:000001,time:0,orig:crash.py b/test/Fuzzing/output_dir/queue/id:000001,time:0,orig:crash.py new file mode 100644 index 0000000..d7f97d5 --- /dev/null +++ b/test/Fuzzing/output_dir/queue/id:000001,time:0,orig:crash.py @@ -0,0 +1,27 @@ +import random + +# Function to fuzz-test +def process_input(input_string): + if input_string == "crash": + # Simulate a crash or error condition + raise Exception("Crash detected!") + else: + # Process the input normally + print("Processing input:", input_string) + +# Fuzz test the process_input function +def fuzz_test(): + while True: + # Generate a random input + input_length = random.randint(1, 10) + input_chars = [chr(random.randint(32, 126)) for _ in range(input_length)] + input_string = "".join(input_chars) + + # Call the process_input function with the generated input + try: + process_input(input_string) + except Exception as e: + print("Exception:", str(e)) + +# Run the fuzz test +fuzz_test() diff --git a/test/Fuzzing/output_dir/queue/id:000002,time:0,orig:testcase1.py b/test/Fuzzing/output_dir/queue/id:000002,time:0,orig:testcase1.py new file mode 100644 index 0000000..97ca304 --- /dev/null +++ b/test/Fuzzing/output_dir/queue/id:000002,time:0,orig:testcase1.py @@ -0,0 +1,32 @@ +import socket + +# Connect to the server +server_address = ('localhost', 65123) +client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +client_socket.connect(server_address) + +# Craft a test case for input validation +# Modify the client IP and message to simulate different scenarios +# Example 1: Valid input +client_ip = '127.0.0.1' +message = 'Hello, server!' +# Example 2: Invalid input (containing a semicolon) +# client_ip = '127.0.0.1;' +# message = 'Malicious payload' +# Example 3: Invalid input (empty client IP) +# client_ip = '' +# message = 'Hello, server!' + +# Craft the payload by combining client IP and message +payload = f'{client_ip}\n{message}' + +# Send the payload to the server +client_socket.sendall(payload.encode()) + +# Receive and print the server's response +response = client_socket.recv(1024).decode() +print(response) + +# Close the connection +client_socket.close() + diff --git a/test/Fuzzing/output_dir/queue/id:000003,time:0,orig:testcase2 b/test/Fuzzing/output_dir/queue/id:000003,time:0,orig:testcase2 new file mode 100644 index 0000000..140c703 --- /dev/null +++ b/test/Fuzzing/output_dir/queue/id:000003,time:0,orig:testcase2 @@ -0,0 +1 @@ +name="DoS.py" From 4b75169e243eed4fa04d4288e0c28f85f10fb8a2 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:29:54 +0200 Subject: [PATCH 189/211] jump --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 5d55650..a7c0407 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -31,6 +31,7 @@ jobs: run: | echo "1" > input.txt echo ",CIAO_Zac" >> input.txt + echo ",2" >> input.txt - name: Setup CMake run: | @@ -81,7 +82,7 @@ jobs: - name: My Fuzz Client run: | cd test/Fuzzing && ls - python inputvalidation.py + python inputvalidation.py & From 9c8fa9bc9598bf756ca9d454b60462545475c7c2 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:32:42 +0200 Subject: [PATCH 190/211] give a try --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index a7c0407..9c91f88 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,8 +75,9 @@ jobs: - name: Start Client run: | - cat input.txt | ./tcp_client - echo -e "1\n Mio msg" | ./tcp_client + python inputvalidation.py | ./tcp_client $ + #cat input.txt | ./tcp_client + #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true - name: My Fuzz Client From d1e4c7c120cea06c34b23ae70804c39897bd927c Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:33:11 +0200 Subject: [PATCH 191/211] fix_command --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9c91f88..43b5466 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,7 @@ jobs: - name: Start Client run: | - python inputvalidation.py | ./tcp_client $ + python inputvalidation.py | ./tcp_client #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true From 2c28ae5d05116958d23a0dc69b3ba6d295d63dc3 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:34:55 +0200 Subject: [PATCH 192/211] pipe --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 43b5466..6d7e81f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,7 @@ jobs: - name: Start Client run: | - python inputvalidation.py | ./tcp_client + cd test/Fuzzing | python inputvalidation.py | ./tcp_client #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true From 0216c7736f1b749c3d858a77c0ac19e6f83dfefa Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:38:03 +0200 Subject: [PATCH 193/211] fix_1 --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 6d7e81f..1e86790 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,8 @@ jobs: - name: Start Client run: | - cd test/Fuzzing | python inputvalidation.py | ./tcp_client + cd test/Fuzzing/inputvalidation.py | python inputvalidation.py + ./tcp_client #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true From 3a9ec0b99c5919c9532dc12db40e34619fa9895d Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:40:17 +0200 Subject: [PATCH 194/211] fix_2 --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 1e86790..93ef695 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -75,7 +75,8 @@ jobs: - name: Start Client run: | - cd test/Fuzzing/inputvalidation.py | python inputvalidation.py + cp test/Fuzzing/inputvalidation.py . + python inputvalidation.py ./tcp_client #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client From 30a20daaab3537a54a7fed745bc6924802a4ef03 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:43:22 +0200 Subject: [PATCH 195/211] fix_3 --- .github/workflows/Vulnerability.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 93ef695..2c0a79f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -73,20 +73,16 @@ jobs: run: | ./tcp_server & - - name: Start Client + - name: My Fuzz Client run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py - ./tcp_client + ./tcp_client & #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true - - name: My Fuzz Client - run: | - cd test/Fuzzing && ls - python inputvalidation.py & - + - name: Save Fuzz Test Results From 18619cf1c99dc03e0adcdba5d8a005222055665a Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:44:04 +0200 Subject: [PATCH 196/211] fix_4 --- .github/workflows/Vulnerability.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 2c0a79f..b296b0d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -76,8 +76,8 @@ jobs: - name: My Fuzz Client run: | cp test/Fuzzing/inputvalidation.py . - python inputvalidation.py - ./tcp_client & + python inputvalidation.py & + ./tcp_client #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true From 541c8c009297038546843f82879f95f3d0463020 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:47:42 +0200 Subject: [PATCH 197/211] fix_4 --- .github/workflows/Vulnerability.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index b296b0d..40fc40f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -72,6 +72,11 @@ jobs: - name: Start Server run: | ./tcp_server & + - name: Start Client + run: | + pwd && ls + cat input.txt | ./tcp_client + echo "::set-output name=clientFinished::true" - name: My Fuzz Client run: | From c2206f94778b03026fac6287989d0ee625279c37 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:48:09 +0200 Subject: [PATCH 198/211] fix_6 --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 40fc40f..98afc64 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -78,7 +78,7 @@ jobs: cat input.txt | ./tcp_client echo "::set-output name=clientFinished::true" - - name: My Fuzz Client + - name: Start Fuzz run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py & From 48f607b17b45fcfc4f1c78d31f21e2ded25ba6d9 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:51:22 +0200 Subject: [PATCH 199/211] fix_7 --- .github/workflows/Vulnerability.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 98afc64..f7344da 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -77,8 +77,10 @@ jobs: pwd && ls cat input.txt | ./tcp_client echo "::set-output name=clientFinished::true" + continue-on-error: true - name: Start Fuzz + if: steps.start-client.outputs.clientFinished == 'true' run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py & From 7c7b2d9f5cf5501246b2dbecdad2be502519b8b8 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 13:58:47 +0200 Subject: [PATCH 200/211] fiz_8 --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index f7344da..bc40e91 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -72,6 +72,7 @@ jobs: - name: Start Server run: | ./tcp_server & + - name: Start Client run: | pwd && ls @@ -80,7 +81,7 @@ jobs: continue-on-error: true - name: Start Fuzz - if: steps.start-client.outputs.clientFinished == 'true' + if: steps.start-client.outputs.clientFinished == 'false' run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py & From f212747e00bd3a482969a070709185dbb929e994 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:03:27 +0200 Subject: [PATCH 201/211] fix_9 --- .github/workflows/Vulnerability.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index bc40e91..8348987 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -77,11 +77,10 @@ jobs: run: | pwd && ls cat input.txt | ./tcp_client - echo "::set-output name=clientFinished::true" + #echo "::set-output name=clientFinished::true" continue-on-error: true - name: Start Fuzz - if: steps.start-client.outputs.clientFinished == 'false' run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py & From e8e33626261ab90771cea77ced3902098adcb78b Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:30:29 +0200 Subject: [PATCH 202/211] fix11 --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8348987..fb4c69f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -84,7 +84,7 @@ jobs: run: | cp test/Fuzzing/inputvalidation.py . python inputvalidation.py & - ./tcp_client + #cat input.txt | ./tcp_client #echo -e "1\n Mio msg" | ./tcp_client continue-on-error: true From 1d5a2d76050c13bc7bd391da03a22e76fb885edd Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:36:18 +0200 Subject: [PATCH 203/211] err --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index fb4c69f..4510fe7 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -32,6 +32,7 @@ jobs: echo "1" > input.txt echo ",CIAO_Zac" >> input.txt echo ",2" >> input.txt + python my_input_module.py > input.txt - name: Setup CMake run: | @@ -97,7 +98,7 @@ jobs: run: | # Save the fuzzing test results to an artifact or a file for further analysis # Example command: - # - cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt + cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt - name: Upload Fuzz Test Results if: always() From 8102b45594b3614865524b7c0d5e5faa398486a0 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:37:45 +0200 Subject: [PATCH 204/211] val --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 4510fe7..bd08261 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -32,7 +32,7 @@ jobs: echo "1" > input.txt echo ",CIAO_Zac" >> input.txt echo ",2" >> input.txt - python my_input_module.py > input.txt + python inputvalidation.py > input.txt - name: Setup CMake run: | From 733e7722dda518ddc1daed4fdd765bcff557ac2d Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:40:35 +0200 Subject: [PATCH 205/211] RES --- .github/workflows/Vulnerability.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index bd08261..021fd3a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -31,8 +31,9 @@ jobs: run: | echo "1" > input.txt echo ",CIAO_Zac" >> input.txt - echo ",2" >> input.txt - python inputvalidation.py > input.txt + echo "2" >> input.txt + echo "FUZZ TEST RESULTS" fuzz_results.txt + - name: Setup CMake run: | From 19cb09207796fe5038b0e0378ba02f6a2d3b9e62 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:43:25 +0200 Subject: [PATCH 206/211] dir --- .github/workflows/Vulnerability.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 021fd3a..a534827 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -32,7 +32,7 @@ jobs: echo "1" > input.txt echo ",CIAO_Zac" >> input.txt echo "2" >> input.txt - echo "FUZZ TEST RESULTS" fuzz_results.txt + echo "FUZZ TEST RESULTS" > fuzz_results.txt - name: Setup CMake @@ -49,6 +49,12 @@ jobs: mkdir -p ${{ env.CHECKOUT_DIR }}/build/ cp CMakeLists.txt ${{ env.CHECKOUT_DIR }} ls ${{ env.CHECKOUT_DIR }} + + - name: Create Fuzz Directory + run: | + mkdir -p ${{ env.CHECKOUT_DIR }}/results/ + cp fuzz_results.txt ${{ env.CHECKOUT_DIR }} + ls ${{ env.CHECKOUT_DIR }} - name: Install cifuzz From 05c94a286d094a2a30797af5bfb9504c1c8fb21f Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:46:34 +0200 Subject: [PATCH 207/211] res --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index a534827..00a2f48 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -103,7 +103,7 @@ jobs: - name: Save Fuzz Test Results if: always() run: | - # Save the fuzzing test results to an artifact or a file for further analysis + # Save thee fuzzing test results to an artifact or a file for further analysis # Example command: cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt From 1faa68e621ca4d3286b59f6b1050c60031340772 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:54:40 +0200 Subject: [PATCH 208/211] commandsError --- .github/workflows/Vulnerability.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 00a2f48..9b7aeed 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -88,6 +88,10 @@ jobs: #echo "::set-output name=clientFinished::true" continue-on-error: true + - name: Fuzz commands + run: | + cifuzz run testcase1 + - name: Start Fuzz run: | cp test/Fuzzing/inputvalidation.py . @@ -104,7 +108,6 @@ jobs: if: always() run: | # Save thee fuzzing test results to an artifact or a file for further analysis - # Example command: cp fuzz_results.txt ${{ env.CHECKOUT_DIR }}/results/fuzz_results.txt - name: Upload Fuzz Test Results @@ -113,3 +116,4 @@ jobs: with: name: Fuzz Test Results path: ${{ env.CHECKOUT_DIR }}/results + From 2f7f2dc3dcc53084259f242fb2343002d02871fa Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 14:57:47 +0200 Subject: [PATCH 209/211] run2 --- .github/workflows/Vulnerability.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9b7aeed..51e642d 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -90,7 +90,11 @@ jobs: - name: Fuzz commands run: | - cifuzz run testcase1 + sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" + cifuzz login + cifuzz run heap_buffer_overflow_test + + - name: Start Fuzz run: | From d581712f12eb846ae2d4c393c7eeafa427f2827b Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 15:02:04 +0200 Subject: [PATCH 210/211] example --- .github/workflows/Vulnerability.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 51e642d..0df779a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -90,7 +90,8 @@ jobs: - name: Fuzz commands run: | - sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" + cifuzz init + #sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" cifuzz login cifuzz run heap_buffer_overflow_test From d24c893f38995cf30f385fd867bbab4634977687 Mon Sep 17 00:00:00 2001 From: Chironda Date: Mon, 19 Jun 2023 15:06:31 +0200 Subject: [PATCH 211/211] tr1 --- .github/workflows/Vulnerability.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 0df779a..43f6526 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -90,8 +90,8 @@ jobs: - name: Fuzz commands run: | + sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" cifuzz init - #sh -c "$(curl -fsSL https://raw.githubusercontent.com/CodeIntelligenceTesting/cifuzz/main/install.sh)" cifuzz login cifuzz run heap_buffer_overflow_test