diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..33b3667 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,112 @@ +name: ja4-wireshark-release +on: + push: + branches: [main] + paths: [wireshark/*, wireshark/source/*, wireshark/build-scripts/*] + workflow_dispatch: + +jobs: + wireshark-linux: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: build + run: cd wireshark/build-scripts && sudo apt update -y && sudo apt install ninja-build -y && sudo ./linux_build.sh 4.4.0 + - name: rename artifact + run: cp ./wireshark/build-scripts/wireshark-4.4.0/build/run/plugins/4.4/epan/ja4.so linux-ja4.so + - name: upload-linux-ja4 + uses: actions/upload-artifact@v4 + with: + name: linux-ja4 + path: linux-ja4.so + + wireshark-macos: + runs-on: macOS-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - name: build + run: cd wireshark/build-scripts && ./macos_build.sh 4.4.0 + - name: rename artifact + run: cp ./wireshark/build-scripts/wireshark-4.4.0/build/run/Wireshark.app/Contents/PlugIns/wireshark/4-4/epan/ja4.so macos-ja4.so + - name: upload-macos-ja4 + uses: actions/upload-artifact@v4 + with: + name: macos-ja4 + path: macos-ja4.so + + wireshark-windows: + runs-on: windows-2022 + env: + PLATFORM: x64 + WIRESHARK_BASE_DIR: C:\Development + CMAKE_PREFIX_PATH: D:\a\ja4\Qt\6.2.3\msvc2019_64 + WIRESHARK_VERSION_EXTRA: -GithubActionBuild + steps: + - name: checkout + uses: actions/checkout@v4 + - name: create wireshark directory + run: mkdir wireshark/build-scripts/wireshark + - name: checkout wireshark + uses: actions/checkout@v4 + with: + repository: wireshark/wireshark + ref: release-4.4 + path: wireshark/build-scripts/wireshark + - name: add ja4 plugin + run: copy -r wireshark/source wireshark/build-scripts/wireshark/plugins/epan/ja4 + - name: Choco install dependencies + run: choco install -y asciidoctorj xsltproc docbook-bundle nsis winflexbison3 cmake + - name: Install strawberryperl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: '5.30' + distribution: strawberry + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + arch: win64_msvc2019_64 + version: 6.2.3 + modules: 'qt5compat' + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + with: + vs-version: 16.8 + - name: Set MSVC command prompt + uses: ilammy/msvc-dev-cmd@v1 + - name: Mkdir build directory and copy sources + run: mkdir wireshark/build-scripts/wireshark/build + - name: Cmake + run: cd wireshark/build-scripts/wireshark/build && cmake -DCUSTOM_PLUGIN_SRC_DIR=plugins/epan/ja4 -DCMAKE_SYSTEM_VERSION="10.0.20348.0" -A x64 .. + env: + PLATFORM: x64 + WIRESHARK_BASE_DIR: C:/wireshark-libs + QT5_BASE_DIR: C:/Qt/5.12.3/msvc2017_64 + working-directory: wireshark/build-scripts/wireshark/build + - name: Build + run: cmake --build . --config RelWithDebInfo + working-directory: wireshark/build-scripts/wireshark/build + - name: rename artifact + run: cp wireshark/build-scripts/wireshark/build/run/RelWithDebInfo/plugins/4.4/epan/ja4.dll ja4.dll + - name: upload-windows-ja4 + uses: actions/upload-artifact@v4 + with: + name: windows-ja4 + path: ja4.dll + + release-artifacts: + runs-on: ubuntu-latest + needs: [ wireshark-linux, wireshark-macos, wireshark-windows ] + steps: + - name: set env + run: echo "NOW=$(date +'%Y.%m.%d.%M')" >> $GITHUB_ENV + - name: download-artifacts + uses: actions/download-artifact@v4 + - name: list files + run: ls -al + - name: release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release create ${{ env.NOW }} linux-ja4.so macos-ja4.so ja4.dll diff --git a/.github/workflows/temp.yml b/.github/workflows/temp.yml new file mode 100644 index 0000000..5f28267 --- /dev/null +++ b/.github/workflows/temp.yml @@ -0,0 +1,52 @@ +name: temp +on: + push: + branches: [main] + paths: [wireshark/*, wireshark/source/*, wireshark/build-scripts/*] + workflow_dispatch: + +jobs: + upload-one: + runs-on: ubuntu-latest + steps: + - name: touch one + run: echo "one" > one.txt + - name: upload-one + uses: actions/upload-artifact@v4 + with: + name: upload-one + path: one.txt + + upload-two: + runs-on: ubuntu-latest + steps: + - name: touch two + run: echo "two" > one.txt + - name: upload-two + uses: actions/upload-artifact@v4 + with: + name: upload-two + path: one.txt + + upload-all: + runs-on: ubuntu-latest + needs: [ upload-one, upload-two ] + steps: + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: upload-one + - name: release1 + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release create "test" one.txt#Linux + - name: Download a second artifact + uses: actions/download-artifact@v4 + with: + name: upload-two + - name: release2 + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: gh release upload "test" one.txt#Mac diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..e1816a1 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,71 @@ +name: windows-build +on: + push: + branches: [main] + paths: [wireshark/*, wireshark/source/*, wireshark/build-scripts/*, .github/workflows/*] + workflow_dispatch: + +jobs: + wireshark-windows: + name: build + runs-on: windows-2022 + env: + PLATFORM: x64 + WIRESHARK_BASE_DIR: C:\Development + CMAKE_PREFIX_PATH: D:\a\ja4\Qt\6.2.3\msvc2019_64 + WIRESHARK_VERSION_EXTRA: -GithubActionBuild + steps: + - name: checkout this repo + uses: actions/checkout@v4 + + - name: create wireshark directory + run: mkdir wireshark/build-scripts/wireshark + + - name: checkout wireshark + uses: actions/checkout@v4 + with: + repository: wireshark/wireshark + ref: release-4.4 + path: wireshark/build-scripts/wireshark + + - name: add ja4 plugin + run: copy -r wireshark/source wireshark/build-scripts/wireshark/plugins/epan/ja4 + + - name: Choco install dependencies + run: choco install -y asciidoctorj xsltproc docbook-bundle nsis winflexbison3 cmake + - name: Install strawberryperl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: '5.30' + distribution: strawberry + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + arch: win64_msvc2019_64 + version: 6.2.3 + modules: 'qt5compat' + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + with: + vs-version: 16.8 + + - name: Set MSVC command prompt + uses: ilammy/msvc-dev-cmd@v1 + + - name: Mkdir build directory and copy sources + run: mkdir wireshark/build-scripts/wireshark/build + + - name: Cmake + run: cd wireshark/build-scripts/wireshark/build && cmake -DCUSTOM_PLUGIN_SRC_DIR=plugins/epan/ja4 -DCMAKE_SYSTEM_VERSION="10.0.20348.0" -A x64 .. + env: + PLATFORM: x64 + WIRESHARK_BASE_DIR: C:/wireshark-libs + QT5_BASE_DIR: C:/Qt/5.12.3/msvc2017_64 + working-directory: wireshark/build-scripts/wireshark/build + + - name: Build + run: cmake --build . --config RelWithDebInfo + working-directory: wireshark/build-scripts/wireshark/build + diff --git a/README.md b/README.md index 21e715a..93fc4b2 100644 --- a/README.md +++ b/README.md @@ -197,3 +197,4 @@ And engineers working at GreyNoise, Hunt, Google, ExtraHop, F5, Driftnet and oth Contact John Althouse at john@foxio.io for licensing and questions. Copyright (c) 2024, FoxIO + diff --git a/wireshark/README.md b/wireshark/README.md index 82d99f6..d438b11 100644 --- a/wireshark/README.md +++ b/wireshark/README.md @@ -1,3 +1,4 @@ +Test # JA4+ Plugin for Wireshark ![JA4](https://github.com/FoxIO-LLC/ja4/blob/main/wireshark/screenshot.png) @@ -61,3 +62,5 @@ The preference file is located in the following locations: ## Licensing See [Licensing](https://github.com/FoxIO-LLC/ja4/tree/main#licensing) under repo root. + +test diff --git a/wireshark/binaries/test b/wireshark/binaries/test new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/wireshark/binaries/test @@ -0,0 +1 @@ +test diff --git a/wireshark/build-scripts/macos_build.sh b/wireshark/build-scripts/macos_build.sh index 25a935d..972f0b3 100755 --- a/wireshark/build-scripts/macos_build.sh +++ b/wireshark/build-scripts/macos_build.sh @@ -26,14 +26,14 @@ if [ ! -d wireshark-$VER ] cd wireshark-$VER fi - +rm -rf ./plugins/epan/ja4 cp -r ../../source ./plugins/epan/ja4 if [ ! -d build ]; then mkdir build fi -cd build && cmake -DCUSTOM_PLUGIN_SRC_DIR=plugins/epan/ja4 ../ +cd build && cmake -DCUSTOM_PLUGIN_SRC_DIR=plugins/epan/ja4 -DBUILD_wireshark=off ../ echo 'building using make...' make -j8 @@ -42,5 +42,6 @@ if [ ! -d ../../../../ja4-plugin ]; then fi cp `find . -name ja4.so` ../../../../ja4-plugin/ -echo "Your JA4 Plugin is ready at `pwd`/../../../../ja4-plugin/ja4.so" +echo "Your JA4 Plugin is ready at" `find . -name ja4.so` +