If you are you not running source connectors to produce events, you can use ksqlDB INSERT INTO
statements to insert mock data into the source topics:
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016000', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016100', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016200', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016205', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016300', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016184', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016400', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016500', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016600', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016800', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642016900', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017000', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017100', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017200', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017300', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017400', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017500', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017600', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.12', srch_host := '192.168.33.12', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '0')));
INSERT INTO network_traffic (TIMESTAMP, layers) VALUES (UNIX_TIMESTAMP(), STRUCT(frame := STRUCT(time := '1642017700', protocols := 'eth:ethertype:ip:tcp'), eth := STRUCT(src := 'FF:AA:C9:83:C0:21', dst := 'DF:ED:E3:91:D4:13'), ip := STRUCT(src := '192.168.33.11', srch_host := '192.168.33.11', dst := '192.168.33.77', dst_host := '192.168.33.77', proto := '1'), tcp := STRUCT(srcport := '59202', dstport := '443', flags_ack := '1',flags_reset := '1')));
To validate that this recipe is working, run the following query:
SELECT * FROM potential_slowloris_attacks EMIT CHANGES LIMIT 1;
Your output should resemble:
+---------------------------------------------+---------------------------------------------+---------------------------------------------+---------------------------------------------+
|SRC |WINDOWSTART |WINDOWEND |COUNT_CONNECTION_RESET |
+---------------------------------------------+---------------------------------------------+---------------------------------------------+---------------------------------------------+
|192.168.33.11 |1646315280000 |1646315340000 |11 |
Limit Reached
Query terminated