Skip to content

Commit

Permalink
ja4
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Nov 13, 2024
1 parent 885a7d5 commit 4a99432
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/ja4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: JA4+
on:
push:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
merge_group:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
ja4:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
HOST: localhost
PORT: 4433

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/rust
with:
components: clippy
tools: cargo-hack
token: ${{ secrets.GITHUB_TOKEN }}

- id: nss-version
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"

- uses: ./.github/actions/nss
with:
minimum-version: ${{ steps.nss-version.outputs.minimum }}

- if: runner.os == 'Linux'
run: |
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update
sudo apt-get install -y --no-install-recommends tshark netcat firefox
- if: runner.os == 'MacOS'
run: brew install tshark netcat firefox

- run: netcat localhost 12345 &
- run: ps auxww

- run: |
cargo build --bin neqo-client
PCAP="$(mktemp)"
sudo tshark -i loopback -w "$PCAP" -l host "$HOST" and port "$PORT" &
DUMP=$!
netcat --udp -n "$HOST" "$PORT" &
SERVER=$!
target/debug/neqo-client "https://$HOST:$PORT/$SIZE"
kill $SERVER $DUMP
tshark -r "$PCAP"
read -r JA4 <<<"$(tshark -n -r "$PCAP" -T fields -e tls.handshake.ja4)"
echo "$JA4"
echo "H3_JA4=$JA4" >> "$GITHUB_ENV"
env:
HOST: localhost
PORT: 4433
- run: |
PCAP="$(mktemp)"
sudo tshark -i loopback -w "$PCAP" -l host "$HOST" and port "$PORT" &
DUMP=$!
netcat --tcp -n "$HOST" "$PORT" &
SERVER=$!
firefox --headless "https://$HOST:$PORT/$SIZE"
kill $SERVER $DUMP
tshark -r "$PCAP"
read -r JA4 <<<"$(tshark -n -r "$PCAP" -T fields -e tls.handshake.ja4)"
echo "$JA4"
echo "H2_JA4=$JA4" >> "$GITHUB_ENV"

0 comments on commit 4a99432

Please sign in to comment.