Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-18 07:25:47 +00:00

zapret_antidpi: rst

This commit is contained in:
bol-van
2025-11-23 13:51:54 +03:00
parent 38ef16bcdf
commit f1d02aa81d
3 changed files with 27 additions and 1 deletions

View File

@@ -11,3 +11,4 @@ v0.1.2
* nfqws2: 'mtproto' protocol, 'mtproto_initial' payload
* nfqws2: 'known' protocol and payload filter
* nfqws2: 'aes_ctr' luacall
* zapret-antidpi: rst

View File

@@ -323,6 +323,31 @@ function syndata(ctx, desync)
end
end
-- nfqws1 : "--dpi-desync=rst"
-- standard args : direction, payload, fooling, ip_id, rawsend, reconstruct, ipfrag
-- arg : rstack - send RST,ACK instead of RST
function rst(ctx, desync)
if not desync.dis.tcp then
instance_cutoff(ctx)
return
end
direction_cutoff_opposite(ctx, desync)
if direction_check(desync, "any") and payload_check(desync) then
if replay_first(desync) then
local dis = deepcopy(desync.dis)
dis.payload = ""
dis.tcp.th_flags = TH_RST + (desync.arg.rstack and TH_ACK or 0)
apply_fooling(desync, dis)
apply_ip_id(desync, dis, nil, "none")
DLOG("rst")
-- it uses rawsend, reconstruct and ipfrag options
rawsend_dissect_ipfrag(dis, desync_opts(desync))
else
DLOG("rst: not acting on further replay pieces")
end
end
end
-- nfqws1 : "--dpi-desync=fake"
-- standard args : direction, payload, fooling, ip_id, rawsend, reconstruct, ipfrag
-- arg : blob=<blob> - fake payload

View File

@@ -12,7 +12,7 @@ void aes_ctr_xcrypt_buffer(aes_context *ctx, const uint8_t *iv, const uint8_t *i
for (i = 0, bi = AES_BLOCKLEN; i < length; ++i, ++bi)
{
if (bi == AES_BLOCKLEN) /* we need to regen xor compliment in buffer */
if (bi == AES_BLOCKLEN) /* we need to regen xor complement in buffer */
{
memcpy(buffer, ivc, AES_BLOCKLEN);
aes_cipher(ctx, buffer, buffer);