Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR - next statement used outside of for or while statement #87

Open
benjeems opened this issue Jan 18, 2023 · 3 comments
Open

ERROR - next statement used outside of for or while statement #87

benjeems opened this issue Jan 18, 2023 · 3 comments

Comments

@benjeems
Copy link

A next statement in the ja3.zeek errors out in Zeek v5.2 and above. It should be a return statement.

From https://github.com/zeek/zeek/blob/master/NEWS:

  • Usage of break and next statements is now validated. It was previously
    possible to place these outside of for, while or switch
    statements without any error indication.

Output when running the package errors out:
error in ./ja3/zeek/./ja3.zeek, line 69: next statement used outside of for or while statement

Offending code:
event ssl_extension(c: connection, is_orig: bool, code: count, val: string)
{
if ( ! c?$tlsfp )
c$tlsfp=TLSFPStorage();
if ( is_orig == T ) {
if ( code in grease ) {
next;
}
...

p-l- added a commit to p-l-/ivre that referenced this issue Jan 19, 2023
Fix provided on Github by @benjeems. See
<salesforce/ja3#87>
@p-l-
Copy link

p-l- commented Jan 19, 2023

Nice catch!

mmguero added a commit to mmguero-dev/ja3 that referenced this issue Mar 14, 2023
Cable-2-5 added a commit that referenced this issue Mar 28, 2023
address #87 next statement used outside of for or while statement
@awelzel
Copy link

awelzel commented Mar 29, 2023

This can be closed now that #90 has been merged. Thanks @benjeems and @mmguero and @Cable-2-5 .

@jjdequevy
Copy link

I use zeek version 6 with '@load ja3' since 1 year without problem.
Yesterday I added the ja4 folder from https://github.com/FoxIO-LLC/ja4/tree/main/zeek, and added the @load ja4 to the local.zeek file.
I also upgraded zeek to reach the zeek 6.1.0
Without rebooting the Ubuntu, I could extract all zeek logs correctly, including ja3 + ja4 fingerprint values
Today after a reboot of my laptop, the extraction crash and ja3 gives the error "error in ./ja3.zeek, line 69: next statement used outside of for or while statement. (next )"
if I comment @load ja3, the extraction works well with ja4 ...
If I comment @load ja4 to let only the @load ja3 (initial situation before usage of ja4 yesterday) the error persist ...
It means I cannot go back to my working version , even ja4 is not used ....

The environment is Ubuntu 22.04.3 LTS under WSL in Windows 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants