mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-01-15 19:15:17 +00:00
Implement sni-detection brute for QUIC
This commit is contained in:
parent
60e33318cb
commit
e98bb5ecad
@ -391,9 +391,13 @@ pl_incr:
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
if (section->sni_detection == SNI_DETECTION_BRUTE) {
|
||||||
|
ret = bruteforce_analyze_sni_str(section, crypto_message, crypto_message_len, &tlsv);
|
||||||
|
} else {
|
||||||
ret = analyze_tls_message(
|
ret = analyze_tls_message(
|
||||||
section, crypto_message, crypto_message_len, &tlsv
|
section, crypto_message, crypto_message_len, &tlsv
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
free(crypto_message);
|
free(crypto_message);
|
||||||
return tlsv;
|
return tlsv;
|
||||||
|
@ -28,11 +28,13 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int bruteforce_analyze_sni_str(
|
int bruteforce_analyze_sni_str(
|
||||||
const struct section_config_t *section,
|
const struct section_config_t *section,
|
||||||
const uint8_t *data, size_t dlen,
|
const uint8_t *data, size_t dlen,
|
||||||
struct tls_verdict *vrd
|
struct tls_verdict *vrd
|
||||||
) {
|
) {
|
||||||
|
*vrd = (struct tls_verdict){0};
|
||||||
|
|
||||||
if (section->all_domains) {
|
if (section->all_domains) {
|
||||||
vrd->target_sni = 1;
|
vrd->target_sni = 1;
|
||||||
vrd->sni_len = 0;
|
vrd->sni_len = 0;
|
||||||
|
@ -55,6 +55,15 @@ int analyze_tls_message(
|
|||||||
struct tls_verdict *tlsv
|
struct tls_verdict *tlsv
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries to bruteforce over the packet and match domains as plain text
|
||||||
|
*/
|
||||||
|
int bruteforce_analyze_sni_str(
|
||||||
|
const struct section_config_t *section,
|
||||||
|
const uint8_t *data, size_t dlen,
|
||||||
|
struct tls_verdict *vrd
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes the packet and finds TLS Client Hello information inside it.
|
* Processes the packet and finds TLS Client Hello information inside it.
|
||||||
|
Loading…
Reference in New Issue
Block a user