foxio-llc / ja4tscan Goto Github PK
View Code? Open in Web Editor NEWJA4TScan is an active TCP server fingerprinting tool.
License: Other
JA4TScan is an active TCP server fingerprinting tool.
License: Other
Anyone receive this error:
sudo python3 ja4tscan.py -p 80 204.79.197.223
adding iptable rules...
zmap: invalid option -- 'I'
cleaning up iptable rules...
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...
There are certain cases where ja4tscan fails to clean up rules:
This needs to be fixed.
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.
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)
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);
| ^~~~~~~~~~~~~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.