From 3f63c93b6b3d785283561cf21c8d578f996a0a51 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Wed, 31 May 2023 21:04:52 +0200 Subject: [PATCH 001/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] # --- .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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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/103] 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 9eeb5fa16714d29470bc463f31292e281dad5a45 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:02:44 +0200 Subject: [PATCH 078/103] dddd --- .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 6c81a1d..33517de 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -9,7 +9,7 @@ on: branches: [ main ] env: - # The fuzzing server gRPC URL. + # The fuzzing server gRPC URL.c FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL. WEB_APP_ADDRESS: https://app.code-intelligence.com From 3948a895ef5aef8db5e34205119af79ffcfec543 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:04:57 +0200 Subject: [PATCH 079/103] aaaa --- .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 33517de..418ec43 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -9,7 +9,7 @@ on: branches: [ main ] env: - # The fuzzing server gRPC URL.c + # The fuzzing server gRPC URssssL.c FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL. WEB_APP_ADDRESS: https://app.code-intelligence.com From 36f603ccac2569a71b547137369b5ced1cd58a12 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:12:13 +0200 Subject: [PATCH 080/103] changecheck out --- .github/workflows/Vulnerability.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 418ec43..8dda4dc 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -30,6 +30,8 @@ jobs: name: Checkout Repository uses: actions/checkout@v2 with: + repository: gladzeka/TcpServer + refer: TestChironda path: ${{ env.CHECKOUT_DIR }} - id: SetupCmake name: Setup Cmake From dae031676a9ad35e4fd5b55bad91324fb8e93873 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:16:01 +0200 Subject: [PATCH 081/103] adding changes --- .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 8dda4dc..e6454e0 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -48,10 +48,6 @@ jobs: run: mkdir -p /home/runner/work/TcpServer/build/ - - - - - id: install-cifuzz name: Install cifuzz run: | @@ -71,8 +67,8 @@ jobs: - id: Build name: Build Server run: | - # Build the server application - cd tcp_server_client + # Testing this falling part + cd ${{ env.CHECKOUT_DIR }} mkdir build cmake .. make @@ -115,4 +111,4 @@ jobs: 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 # Replace with the actual path to the fuzz test results From aa389a58cd6848c91009ca3bae765479f31b8761 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:18:17 +0200 Subject: [PATCH 082/103] a --- .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 e6454e0..7aceadc 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,13 +68,13 @@ jobs: name: Build Server run: | # Testing this falling part - cd ${{ env.CHECKOUT_DIR }} + echo ${{ env.CHECKOUT_DIR }} mkdir build cmake .. make - # cmake -B build #-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - # cmake --build build --config ${{ env.BUILD_TYPE }} + cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + cmake --build build --config ${{ env.BUILD_TYPE }} - name: Build Client From 8b73670b6286c9a565c4cec984d58033e4850de3 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:25:29 +0200 Subject: [PATCH 083/103] AGAIN --- .github/workflows/Vulnerability.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 7aceadc..bd6cd6a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -68,11 +68,14 @@ jobs: name: Build Server run: | # Testing this falling part - echo ${{ env.CHECKOUT_DIR }} - mkdir build - cmake .. - make + #echo ${{ env.CHECKOUT_DIR }} + #mkdir build + #cmake .. + #make + #cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + #cmake --build build --config ${{ env.BUILD_TYPE }} + cd ${{ env.CHECKOUT_DIR }} cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} cmake --build build --config ${{ env.BUILD_TYPE }} From 3946a05b68fdee4025120f1228cb0513e27707e6 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:29:33 +0200 Subject: [PATCH 084/103] aa --- .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 bd6cd6a..8b28124 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -32,7 +32,7 @@ jobs: with: repository: gladzeka/TcpServer refer: TestChironda - path: ${{ env.CHECKOUT_DIR }} + #path: ${{ env.CHECKOUT_DIR }} - id: SetupCmake name: Setup Cmake run: | From 0baac764084d3f53eea0ac2c6997a70708205842 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:31:40 +0200 Subject: [PATCH 085/103] last --- .github/workflows/Vulnerability.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 8b28124..c55121f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -67,17 +67,6 @@ jobs: - id: Build name: Build Server run: | - # Testing this falling part - #echo ${{ env.CHECKOUT_DIR }} - #mkdir build - #cmake .. - #make - - #cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - #cmake --build build --config ${{ env.BUILD_TYPE }} - cd ${{ env.CHECKOUT_DIR }} - cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - cmake --build build --config ${{ env.BUILD_TYPE }} - name: Build Client From 5017beae010579dbff8cd68f78be01e2819d0a5c Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 22:47:50 +0200 Subject: [PATCH 086/103] camio --- .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 c55121f..eaee9f8 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -31,8 +31,8 @@ jobs: uses: actions/checkout@v2 with: repository: gladzeka/TcpServer - refer: TestChironda - #path: ${{ env.CHECKOUT_DIR }} + refer: TestChironda/TcpServer + path: ${{ env.CHECKOUT_DIR }} - id: SetupCmake name: Setup Cmake run: | @@ -67,6 +67,7 @@ jobs: - id: Build name: Build Server run: | + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Build Client From 90c731391d52eec63ef9cf2426126c74d959045d Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:06:48 +0200 Subject: [PATCH 087/103] many changes --- .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 eaee9f8..fc7769f 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -20,11 +20,14 @@ 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 + +env: BUILD_TYPE: Release jobs: fuzz-test: runs-on: ubuntu-latest + steps: - id: Checkout-Repo name: Checkout Repository @@ -37,13 +40,15 @@ jobs: name: Setup Cmake run: | sudo apt-get install -y cmake + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + - id: DownloadCmake name: Download CMakeLists.txt run: | curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - - id: Destinat + - id: Destination name: Create Destination Directory run: mkdir -p /home/runner/work/TcpServer/build/ @@ -67,6 +72,7 @@ jobs: - id: Build name: Build Server run: | + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} From 8a361db95a6a1fd11532fe43e14168eb09a78451 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:08:31 +0200 Subject: [PATCH 088/103] ADDING POINTS --- .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 fc7769f..fb89698 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -11,7 +11,7 @@ on: env: # The fuzzing server gRPC URssssL.c FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL. + # The fuzzing server HTTP URL...... WEB_APP_ADDRESS: https://app.code-intelligence.com # Directories in which the repository will be cloned. From 69f8d8e478307abace686361900d2a790c990f51 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:09:23 +0200 Subject: [PATCH 089/103] MOD --- .github/workflows/Vulnerability.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index fb89698..28b4b12 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -20,8 +20,6 @@ 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 - -env: BUILD_TYPE: Release jobs: From f9a82adfa89627ae9226ca28080fe2d081eccc80 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:10:41 +0200 Subject: [PATCH 090/103] Modified build --- .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 28b4b12..c583c0c 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -9,7 +9,7 @@ on: branches: [ main ] env: - # The fuzzing server gRPC URssssL.c + # The fuzzing server gRPC URssssL FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL...... WEB_APP_ADDRESS: https://app.code-intelligence.com @@ -79,7 +79,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: | @@ -101,7 +101,7 @@ jobs: # 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 $GITHUB_WORKSPACE/fuzz_results.txt - name: Upload Fuzz Test Results if: always() From a460243e7653b526392d4819e8204b529bb2b03f Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:13:55 +0200 Subject: [PATCH 091/103] cazzzzzzzzzz --- .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 c583c0c..a4dd1ba 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -92,7 +92,7 @@ jobs: run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application - # Example command: + # Example command ss: - ./client - name: Save Fuzz Test Results From e3e90c6e6edfa35fdde7a9cbb72fc509d6cc9ed0 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:17:26 +0200 Subject: [PATCH 092/103] check --- .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 a4dd1ba..74c1989 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -92,8 +92,8 @@ jobs: run: | # Run the fuzz test on the client application # Replace the command with the actual fuzz test command for your client application - # Example command ss: - - ./client + # Example command d + ./client - name: Save Fuzz Test Results if: always() From 04669b0b64fc5af75809c42d447d04623413e01b Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:18:45 +0200 Subject: [PATCH 093/103] AAA --- .github/workflows/Vulnerability.yml | 111 ++++++++++++++++++++++++++++ 1 file changed, 111 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..b5347a6 --- /dev/null +++ b/.github/workflows/Vulnerability.yml @@ -0,0 +1,111 @@ +name: Vulnerability Assessment + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: [ main ] + +env: + # The fuzzing server gRPC URssssLff + 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 + 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: + repository: gladzeka/TcpServer + refer: TestChironda/TcpServer + path: ${{ env.CHECKOUT_DIR }} + - id: SetupCmake + name: Setup Cmake + run: | + sudo apt-get install -y cmake + cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + + - id: DownloadCmake + name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + + - id: Destination + name: Create Destination Directory + + run: mkdir -p /home/runner/work/TcpServer/build/ + + - 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: | + + cmake --build ${{github.workspace}}/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 d + ./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: ${{ env.CHECKOUT_DIR }}/results # Replace with the actual path to the fuzz test results From f56b17d8c9bfeb6626b9eb882ca29b9d94061212 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:23:17 +0200 Subject: [PATCH 094/103] AAA --- .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 74c1989..02ecad5 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ -name: Vulnerability Assessment +name: Vulnerability AssessmentF on: workflow_dispatch: @@ -9,7 +9,7 @@ on: branches: [ main ] env: - # The fuzzing server gRPC URssssL + # The fuzzing server gRPC URssssLFF FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL...... WEB_APP_ADDRESS: https://app.code-intelligence.com From e1c0db5695a291b42d4cd64453e29180e83c8808 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:24:41 +0200 Subject: [PATCH 095/103] FUC --- .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 02ecad5..f900096 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ -name: Vulnerability AssessmentF +name: Vulnerability AssessmentFZZ on: workflow_dispatch: From c277be1125e2f888b71b4507f904dd8675b2868e Mon Sep 17 00:00:00 2001 From: Chironda Date: Sat, 17 Jun 2023 23:25:13 +0200 Subject: [PATCH 096/103] AZURO --- .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 f900096..7a56cd1 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ -name: Vulnerability AssessmentFZZ +name: Vulnerability Assessment on: workflow_dispatch: From 0824e353803bd86ab92df322ed5c6160a56314e6 Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 11:46:42 +0200 Subject: [PATCH 097/103] curreny --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e804c3c..fd8ba10 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ "chrono": "cpp", "system_error": "cpp", "xlocale": "cpp" - } + }, + "C_Cpp.errorSquiggles": "disabled" } \ No newline at end of file From 05756f8dea47643974e2035e2471dc7d05f1d8df Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 11:47:35 +0200 Subject: [PATCH 098/103] changes --- .github/workflows/Vulnerability.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 9d96efb..4863f5a 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,8 +1,4 @@ -<<<<<<< HEAD name: Vulnerability Assessment -======= -name: Vulnerability Assessment ->>>>>>> main on: workflow_dispatch: @@ -13,11 +9,7 @@ on: branches: [ main ] env: -<<<<<<< HEAD - # The fuzzing server gRPC URssssLFF -======= - # The fuzzing server gRPC URssssLff ->>>>>>> main + # The fuzzing server gRPC UR FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 # The fuzzing server HTTP URL...... WEB_APP_ADDRESS: https://app.code-intelligence.com From 0ae568b8fa851c6172f171a318833921a9e7f53b Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 11:49:51 +0200 Subject: [PATCH 099/103] alignments fix --- .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 4863f5a..df31476 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,4 +1,4 @@ -name: Vulnerability Assessment + name: Vulnerability Assessment on: workflow_dispatch: From 6ce879ffbaa75a0a7f051120ec0c350ed622887e Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 12:02:11 +0200 Subject: [PATCH 100/103] ref --- .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 df31476..96a33ae 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,5 +1,4 @@ name: Vulnerability Assessment - on: workflow_dispatch: push: @@ -32,7 +31,7 @@ jobs: uses: actions/checkout@v2 with: repository: gladzeka/TcpServer - refer: TestChironda/TcpServer + ref: TestChironda/TcpServer path: ${{ env.CHECKOUT_DIR }} - id: SetupCmake name: Setup Cmake From 5a798a1c4500ec7f50c74454fcd5f2458485c98a Mon Sep 17 00:00:00 2001 From: Chironda Date: Sun, 18 Jun 2023 12:09:45 +0200 Subject: [PATCH 101/103] try2 --- .github/workflows/Vulnerability.yml | 94 ++++++++++++++--------------- 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 96a33ae..677a57b 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: @@ -10,11 +11,10 @@ on: env: # The fuzzing server gRPC UR FUZZING_SERVER_ADDRESS: grpc.code-intelligence.com:443 - # The fuzzing server HTTP URL...... + # 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,85 +26,81 @@ jobs: runs-on: ubuntu-latest steps: - - id: Checkout-Repo - name: Checkout Repository - uses: actions/checkout@v2 - with: + - id: Checkout-Repo + 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 - cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + - id: SetupCmake + name: Setup Cmake + run: | + sudo apt-get install -y cmake + cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - - id: DownloadCmake - name: Download CMakeLists.txt - run: | - curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt + - id: DownloadCmake + name: Download CMakeLists.txt + run: | + curl -sSL -o CMakeLists.txt https://github.com/gladzeka/TcpServer/raw/main/CMakeLists.txt - - id: Destination - name: Create Destination Directory - - run: mkdir -p /home/runner/work/TcpServer/build/ + - id: Destination + name: Create Destination Directory + run: mkdir -p /home/runner/work/TcpServer/build/ - - id: install-cifuzz - 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 $CIFUZZ_INSTALL_DIR - - id: Envs - name: Setup Environment - run: | + - 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 update - - - id: Build - name: Build Server - run: | - - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - + - id: Build + name: Build Server + run: | + cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} - - 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 + # 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 + ./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 d ./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: ${{ env.CHECKOUT_DIR }}/results # Replace with the actual path to the fuzz test results From f017930fe46923a9ac0a16095d74569901c15168 Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 12:20:20 +0200 Subject: [PATCH 102/103] chec --- .github/workflows/Vulnerability.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Vulnerability.yml b/.github/workflows/Vulnerability.yml index 677a57b..4ed9a61 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -1,5 +1,6 @@ name: Vulnerability Assessment + on: workflow_dispatch: push: From 4bb6933462ebd956a0ade5e8f861aef2a720481d Mon Sep 17 00:00:00 2001 From: Zacarias Chironda Date: Sun, 18 Jun 2023 13:18:31 +0200 Subject: [PATCH 103/103] check2 --- .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 4ed9a61..de310cc 100644 --- a/.github/workflows/Vulnerability.yml +++ b/.github/workflows/Vulnerability.yml @@ -15,7 +15,7 @@ env: # The fuzzing server HTTP URL... WEB_APP_ADDRESS: https://app.code-intelligence.com - # Directories in which the repository will be cloned. + # Directoriess 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