mirror of
https://github.com/ValdikSS/GoodbyeDPI.git
synced 2025-01-03 04:49:56 +00:00
parent
505b8bf516
commit
ad60d30caa
@ -383,6 +383,7 @@ int main(int argc, char *argv[]) {
|
|||||||
do_host_mixedcase = 0,
|
do_host_mixedcase = 0,
|
||||||
do_dnsv4_redirect = 0, do_dnsv6_redirect = 0,
|
do_dnsv4_redirect = 0, do_dnsv6_redirect = 0,
|
||||||
do_dns_verb = 0, do_blacklist = 0,
|
do_dns_verb = 0, do_blacklist = 0,
|
||||||
|
do_fake_packet = 0,
|
||||||
do_wrong_chksum = 0;
|
do_wrong_chksum = 0;
|
||||||
unsigned int http_fragment_size = 0;
|
unsigned int http_fragment_size = 0;
|
||||||
unsigned int https_fragment_size = 0;
|
unsigned int https_fragment_size = 0;
|
||||||
@ -584,9 +585,11 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '$':
|
case '$':
|
||||||
|
do_fake_packet = 1;
|
||||||
ttl_of_fake_packet = atoub(optarg, "Set TTL parameter error!");
|
ttl_of_fake_packet = atoub(optarg, "Set TTL parameter error!");
|
||||||
break;
|
break;
|
||||||
case '%':
|
case '%':
|
||||||
|
do_fake_packet = 1;
|
||||||
do_wrong_chksum = 1;
|
do_wrong_chksum = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -761,14 +764,16 @@ int main(int argc, char *argv[]) {
|
|||||||
((do_fragment_https ? packet_dataLen == https_fragment_size : 0) ||
|
((do_fragment_https ? packet_dataLen == https_fragment_size : 0) ||
|
||||||
packet_dataLen > 16) &&
|
packet_dataLen > 16) &&
|
||||||
ppTcpHdr->DstPort != htons(80) &&
|
ppTcpHdr->DstPort != htons(80) &&
|
||||||
(ttl_of_fake_packet || do_wrong_chksum)
|
(do_fake_packet)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (packet_dataLen >=2 && memcmp(packet_data, "\x16\x03", 2) == 0) {
|
if (packet_dataLen >=2 && memcmp(packet_data, "\x16\x03", 2) == 0) {
|
||||||
|
if (do_fake_packet) {
|
||||||
send_fake_https_request(w_filter, &addr, packet, packetLen, packet_v6,
|
send_fake_https_request(w_filter, &addr, packet, packetLen, packet_v6,
|
||||||
ttl_of_fake_packet, do_wrong_chksum);
|
ttl_of_fake_packet, do_wrong_chksum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* Handle OUTBOUND packet on port 80, search for Host header */
|
/* Handle OUTBOUND packet on port 80, search for Host header */
|
||||||
else if (addr.Direction == WINDIVERT_DIRECTION_OUTBOUND &&
|
else if (addr.Direction == WINDIVERT_DIRECTION_OUTBOUND &&
|
||||||
packet_dataLen > 16 &&
|
packet_dataLen > 16 &&
|
||||||
@ -777,7 +782,8 @@ int main(int argc, char *argv[]) {
|
|||||||
(do_fragment_http ? http_fragment_size : 0u),
|
(do_fragment_http ? http_fragment_size : 0u),
|
||||||
&http_req_fragmented) &&
|
&http_req_fragmented) &&
|
||||||
(do_host || do_host_removespace ||
|
(do_host || do_host_removespace ||
|
||||||
do_host_mixedcase || do_fragment_http_persistent))
|
do_host_mixedcase || do_fragment_http_persistent ||
|
||||||
|
do_fake_packet))
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Find Host header */
|
/* Find Host header */
|
||||||
@ -789,7 +795,7 @@ int main(int argc, char *argv[]) {
|
|||||||
host_addr = hdr_value_addr;
|
host_addr = hdr_value_addr;
|
||||||
host_len = hdr_value_len;
|
host_len = hdr_value_len;
|
||||||
|
|
||||||
if (ttl_of_fake_packet || do_wrong_chksum)
|
if (do_fake_packet)
|
||||||
send_fake_http_request(w_filter, &addr, packet, packetLen, packet_v6,
|
send_fake_http_request(w_filter, &addr, packet, packetLen, packet_v6,
|
||||||
ttl_of_fake_packet, do_wrong_chksum);
|
ttl_of_fake_packet, do_wrong_chksum);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user