MCPcopy Create free account
hub / github.com/BruceDevices/firmware / generateClientFingerprint

Function generateClientFingerprint

src/modules/wifi/karma_attack.cpp:887–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887uint32_t generateClientFingerprint(const uint8_t *frame, int len) {
888 uint32_t hash = 5381;
889 int pos = 24;
890
891 while (pos + 1 < len) {
892 uint8_t tag = frame[pos];
893 uint8_t tagLen = frame[pos + 1];
894
895 if (pos + 2 + tagLen > len) break;
896
897 hash = ((hash << 5) + hash) + tag;
898 hash = ((hash << 5) + hash) + tagLen;
899
900 int maxBytes = (tagLen < 4) ? tagLen : 4;
901 for (int i = 0; i < maxBytes; i++) { hash = ((hash << 5) + hash) + frame[pos + 2 + i]; }
902
903 pos += 2 + tagLen;
904 }
905
906 return hash;
907}
908
909bool isProbeRequestWithSSID(const wifi_promiscuous_pkt_t *packet) {
910 if (!packet || packet->rx_ctrl.sig_len < 24) return false;

Callers 1

probe_snifferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected