Code Monkey home page Code Monkey logo

ja4tscan's People

Contributors

igr001-galactica avatar john-althouse avatar noeltimothy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ja4tscan's Issues

ja4tscan fails to build with latest zmap

make install gives the folllowing error:

/root/ja4tscan/zmap/src/probe_modules/probe_modules.c:77:6: error: conflicting types for 'fs_add_system_fields'; have 'void(fieldset_t *, int,  int)' {aka 'void(struct fieldset *, int,  int)'}
   77 | void fs_add_system_fields(fieldset_t *fs, int is_repeat, int in_cooldown)
      |      ^~~~~~~~~~~~~~~~~~~~
In file included from /root/ja4tscan/zmap/src/probe_modules/probe_modules.c:19:
/root/ja4tscan/zmap/src/probe_modules/probe_modules.h:117:6: note: previous declaration of 'fs_add_system_fields' with type 'void(fieldset_t *, int,  int,  const struct timespec)' {aka 'void(struct fieldset *, int,  int,  const struct timespec)'}
  117 | void fs_add_system_fields(fieldset_t *fs, int is_repeat, int in_cooldown, const struct timespec ts);
      |      ^~~~~~~~~~~~~~~~~~~~
    

build failed in Archlinux

Follow the instruction on: https://github.com/zmap/zmap/blob/main/INSTALL.md , I can build zmap source code without ja4tscan success.
But when I run bash build.sh to add ja4tscan feature to zmap, I get Error:

[ 12%] Built target zmaplib
[ 12%] Built target git_versioning
[ 13%] Generating zopt.h
[ 14%] Building C object src/CMakeFiles/zmap.dir/zmap.c.o
[ 15%] Building C object src/CMakeFiles/zmap.dir/zopt_compat.c.o
[ 16%] Building C object src/CMakeFiles/zmap.dir/probe_modules/module_ja4tscan.c.o
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c: In function ‘num_of_digits’:
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c:72:31: warning: cast from function call of type ‘double’ to non-matching type ‘int’ [-Wbad-function-cast]
   72 |         return ( n==0 ) ? 1 : (int) log10(n)+1;
      |                               ^
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c: At top level:
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c:495:23: error: initialization of ‘int (*)(void *, macaddr_t *, macaddr_t *, void *)’ {aka ‘int (*)(void *, unsigned char *, unsigned char *, void *)’} from incompatible pointer type ‘int (*)(void *, macaddr_t *, macaddr_t *, void **)’ {aka ‘int (*)(void *, unsigned char *, unsigned char *, void **)’} [-Wincompatible-pointer-types]
  495 |     .prepare_packet = &ja4tscan_prepare_packet,
      |                       ^
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c:495:23: note: (near initialization for ‘module_ja4tscan.prepare_packet’)
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c:496:20: error: initialization of ‘int (*)(void *, size_t *, ipaddr_n_t,  ipaddr_n_t,  port_n_t,  uint8_t,  uint32_t *, int,  uint16_t,  void *)’ {aka ‘int (*)(void *, long unsigned int *, unsigned int,  unsigned int,  short unsigned int,  unsigned char,  unsigned int *, int,  short unsigned int,  void *)’} from incompatible pointer type ‘int (*)(void *, size_t *, ipaddr_n_t,  ipaddr_n_t,  port_n_t,  uint8_t,  uint32_t *, int,  void *)’ {aka ‘int (*)(void *, long unsigned int *, unsigned int,  unsigned int,  short unsigned int,  unsigned char,  unsigned int *, int,  void *)’} [-Wincompatible-pointer-types]
  496 |     .make_packet = &ja4tscan_make_packet,
      |                    ^
/segate/code/TCPServerFingerprint/ja4tscan/zmap/src/probe_modules/module_ja4tscan.c:496:20: note: (near initialization for ‘module_ja4tscan.make_packet’)
make[2]: *** [src/CMakeFiles/zmap.dir/build.make:382: src/CMakeFiles/zmap.dir/probe_modules/module_ja4tscan.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:205: src/CMakeFiles/zmap.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
You can now run python3 ja4tscan.py

It's seem that gcc 14 not support this kind of pointer or other cause? I'm not sure because I'm not particularly proficient in writing C code, I would greatly appreciate your generous assistance :)

system info:

[user@arch zmap]$ cat /etc/issue
Arch Linux \r (\l)
[user@arch zmap]$ cmake -version
cmake version 3.29.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[user@arch zmap]$ gcc --version
gcc (GCC) 14.1.1 20240507
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Segmentation fault (core dumped)

Hello, I've built the code locally (Ubuntu and macos M2), but the scans all prompt a memory crash.

sudo python3 ja4tscan.py -p 443 59.110.219.243
adding iptable rules...
cmd zmap -p 443 -r 10 -I input -o output.csv --output-fields=timestamp,saddr,ja4ts --probe-module=ja4ts --dedup-method none --cooldown-time=120
Mar 17 18:23:15.751 [INFO] dedup: Response deduplication method is none
Mar 17 18:23:15.752 [INFO] filter: No output filter provided. ZMap will output all results, including duplicate and non-successful responses (e.g., RST and ICMP packets). If you want a filter similar to ZMap's default behavior, you can set an output filter similar to the following: --output-filter="success=1 && repeat=0".
Mar 17 18:23:15.764 [WARN] zmap: list of IPs is small compared to address space. Performance will suffer, consider using an allowlist instead
Mar 17 18:23:15.773 [INFO] recv: duplicate responses will be passed to the output module
Mar 17 18:23:15.774 [INFO] recv: unsuccessful responses will be passed to the output module
0:00 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
0:00 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
Segmentation fault (core dumped)
cleaning up iptable rules...

zmap -p 443 -r 10 -I ./input -o output.csv --output-fields=timestamp,saddr,ja4ts --probe-module=ja4ts --dedup-method none --cooldown-time=120
Mar 17 18:23:47.687 [INFO] dedup: Response deduplication method is none
Mar 17 18:23:47.687 [INFO] filter: No output filter provided. ZMap will output all results, including duplicate and non-successful responses (e.g., RST and ICMP packets). If you want a filter similar to ZMap's default behavior, you can set an output filter similar to the following: --output-filter="success=1 && repeat=0".
Mar 17 18:23:47.699 [WARN] zmap: list of IPs is small compared to address space. Performance will suffer, consider using an allowlist instead
Mar 17 18:23:47.709 [INFO] recv: duplicate responses will be passed to the output module
Mar 17 18:23:47.710 [INFO] recv: unsuccessful responses will be passed to the output module
0:00 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
0:00 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
Segmentation fault (core dumped)

zmap 4.0 version fails when run on a single IP

adding iptable rules...
Apr 22 19:19:09.765 [INFO] dedup: Response deduplication method is none
Apr 22 19:19:09.765 [INFO] filter: No output filter provided. ZMap will output all results, including duplicate and non-successful responses (e.g., RST and ICMP packets). If you want a filter similar to ZMap's default behavior, you can set an output filter similar to the following: --output-filter="success=1 && repeat=0".
Apr 22 19:19:09.775 [WARN] zmap: list of IPs is small compared to address space. Performance will suffer, consider using an allowlist instead
Apr 22 19:19:09.852 [INFO] recv: duplicate responses will be passed to the output module
Apr 22 19:19:09.852 [INFO] recv: unsuccessful responses will be passed to the output module
zmap: /mnt/d/customers/gary/temp/ja4tscan/zmap/lib/constraint.c:253: constraint_lookup_index: Assertion `index < con->root->count' failed.
 0:00 0%; send: 0 0 p/s (0 p/s avg); recv: 0 0 p/s (0 p/s avg); drops: 0 p/s (0 p/s avg); hitrate: 0.00%
Aborted
cleaning up iptable rules...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.