blob: 5544df6360aa9e5e7dcccc827cf212930ace0464 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
Packet builder modules
=======================
The packet builder module objective is to build a template packet for a stream and to create a Field engine program to change fields in the packet.
**Some examples for what can be done:**
* Build a IP/UDP/DNS packet and create a range of src_ip = 10.0.0.1-10.0.0.255
* Build a IP/UDP packets in IMIX sizes
for example this snippet will create SYN Attack::
# create attack from random src_ip from 16.0.0.0-18.0.0.254 and random src_port 1025-65000
# attack 48.0.0.1 server
def create_stream (self):
# TCP SYN
base_pkt = Ether()/IP(dst="48.0.0.1")/TCP(dport=80,flags="S")
pkt = STLPktBuilder(pkt = base_pkt)
return STLStream(packet = pkt, #<<<<< set packet builder inside the stream
mode = STLTXCont())
STLPktBuilder class
--------------------
Aggregate a raw instructions objects
.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLPktBuilder
:members:
:member-order: bysource
|