Skip to content

Examples

himanshu edited this page Aug 27, 2023 · 19 revisions

Getting Started

Below is the workflow to get started on using a module and the respective sub-modules.

To invoke a module from the primary menu, use the index numbers denoted next to the module name.

$ sudo python3 byteosaurus_hex.py

==================================================
Scapy based packet generator
==================================================

1 -- ICMP
2 -- ARP
3 -- IGMP
4 -- Multicast
5 -- VXLAN
6 -- Load PCAP File
7 -- Exit

Enter your choice (1-7):

For example to invoke the VXLAN module

  • Press 5 then hit Enter
  • Provide the number of flows you want to build, minimum 1 flow is required.
    • For each flow you will have the option to select the:
      • Number / count of packets to send
      • Egress / Outgoing interface from which the packets will be sent.
  • Select the sub-module from the menu option.
$ sudo python3 byteosaurus_hex.py

==================================================
Scapy based packet generator
==================================================

1 -- ICMP
2 -- ARP
3 -- IGMP
4 -- Multicast
5 -- VXLAN
6 -- Load PCAP File
7 -- Exit

Enter your choice (1-7): 5
Enter the number of flows > 2

Building flow number [ 1 ]:

Packet Type:

1 -- Vxlan - Inner ICMP
2 -- Vxlan - Inner UDP
3 -- Vxlan - Inner TCP
4 -- Vxlan - Inner ARP

Enter your choice (1-3) > 1
Generate random Vxlan ICMP Packet? (y/n) >

For detailed examples per module, please refer to the module specific documentation.

ICMP

The ICMP module allows users to generate following ICMP packets:

  • ICMP Echo Request
  • ICMP Echo Response

This module supports:

  • Multiple flows
  • Packet count & Outgoing interface per flow
  • Random automated packet generation
  • Full manual packet generation
  • Adding VLAN tags

ICMP Echo Request

Random packet generation

Reveal Output

$ sudo python3 byteosaurus_hex.py

==================================================
Scapy based packet generator
==================================================

1 -- ICMP
2 -- ARP
3 -- IGMP
4 -- Multicast
5 -- VXLAN
6 -- Load PCAP File
7 -- Exit

Enter your choice (1-7): 1
Enter the number of flows > 1

Building flow number [ 1 ]:

Random ICMP Packet? (y/n) > y
ICMP Type (req/reply) > req
Count (c for continous) > 5
Source Interface > et48
2023-08-27 09:24:03,984: INFO: ICMP packet built
###[ Ethernet ]###
  dst       = e1:5e:04:ef:37:6f
  src       = c4:ca:2b:b1:f6:39
  type      = IPv4
###[ IP ]###
     version   = 4
     ihl       = None
     tos       = 0x0
     len       = None
     id        = 1
     flags     =
     frag      = 0
     ttl       = 162
     proto     = icmp
     chksum    = None
     src       = 172.17.229.151
     dst       = 172.29.92.217
     \options   \
###[ ICMP ]###
        type      = echo-request
        code      = 0
        chksum    = None
        id        = 0x5ff
        seq       = 0x0
        unused    = ''
###[ Raw ]###
           load      = 'Ȭ8Ԃ\\xd3~\x1dυ\\xfb\\xbfǜ\\xd7H\\x8c\\xeb\\xd8,\\x87\\x90R\\xbbfLj5k\\xe1\\xbe}\\xd6/aa\\xc7\\xfd>U7\\xeaT\\x92_\\xb5l\\x9c\\xaem\\xd9\\xeb\\xf7\\xe7lv5\\x8f\\xebؕ 2_'

2023-08-27 09:24:03,985: INFO: Sending out all flows
2023-08-27 09:24:04,030: INFO: Done sending all flows
2023-08-27 09:24:04,063: INFO: Module completed
Reveal Packet

Ethernet II, Src: AristaNe_b1:f6:39 (c4:ca:2b:b1:f6:39), Dst: e1:5e:04:ef:37:6f (e1:5e:04:ef:37:6f)
    Destination: e1:5e:04:ef:37:6f (e1:5e:04:ef:37:6f)
    Source: AristaNe_b1:f6:39 (c4:ca:2b:b1:f6:39)
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 172.17.229.151, Dst: 172.29.92.217
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
    Total Length: 92
    Identification: 0x0001 (1)
    000. .... = Flags: 0x0
    ...0 0000 0000 0000 = Fragment Offset: 0
    Time to Live: 162
    Protocol: ICMP (1)
    Header Checksum: 0x7e00 [validation disabled]
    [Header checksum status: Unverified]
    Source Address: 172.17.229.151
    Destination Address: 172.29.92.217
Internet Control Message Protocol
    Type: 8 (Echo (ping) request)
    Code: 0
    Checksum: 0xdecb [correct]
    [Checksum Status: Good]
    Identifier (BE): 1535 (0x05ff)
    Identifier (LE): 65285 (0xff05)
    Sequence Number (BE): 0 (0x0000)
    Sequence Number (LE): 0 (0x0000)
    [No response seen]
    Data (64 bytes)

ICMP Echo Response

Manual packet generation with VLAN Tag

Reveal Output

==================================================
Scapy based packet generator
==================================================

1 -- ICMP
2 -- ARP
3 -- IGMP
4 -- Multicast
5 -- VXLAN
6 -- Load PCAP File
7 -- Exit

Enter your choice (1-7): 1
Enter the number of flows > 1

Building flow number [ 1 ]:

Random ICMP Packet? (y/n) > n
ICMP Type (req/reply) > reply
Source MAC (de:ad:be:ef:ca:fe) > 00:1c:58:23:64:c1
Destination MAC > 00:15:62:64:33:41
Source IP > 192.168.14.10
Destination IP > 192.168.14.20
TTL > 10
Tag (y/n) > y
VLAN Tag (x,y) > 1,20
Count (c for continous) > 5
Source Interface > et48
2023-08-27 09:49:54,678: INFO: ICMP Packet built
###[ Ethernet ]###
  dst       = 00:15:62:64:33:41
  src       = 00:1c:58:23:64:c1
  type      = n_802_1Q
###[ 802.1Q ]###
     prio      = 0
     id        = 0
     vlan      = 1
     type      = n_802_1Q
###[ 802.1Q ]###
        prio      = 0
        id        = 0
        vlan      = 20
        type      = IPv4
###[ IP ]###
           version   = 4
           ihl       = None
           tos       = 0x0
           len       = None
           id        = 1
           flags     =
           frag      = 0
           ttl       = 10
           proto     = icmp
           chksum    = None
           src       = 192.168.14.10
           dst       = 192.168.14.20
           \options   \
###[ ICMP ]###
              type      = echo-reply
              code      = 0
              chksum    = None
              id        = 0x70c
              seq       = 0x0
              unused    = ''
###[ Raw ]###
                 load      = '\\xabqT\\x8a\\x85.fF\\xf64\\xbf:e\\xdcgb\x15\\xa5-\\xfaDZz\\x83\\xfa\\xe6\\xa90\\xd9\\xe0\\xcf\n@\n\x10\\xef\'\\xf9\\xa5\\xd0L\\x80\\xdc\\xc4L"\\xf4\\xf8\x0ef+\\xfb\\xa8_\\xeaꔖ\\x94\x06%\\xe16i'

2023-08-27 09:49:54,679: INFO: Sending out all flows
2023-08-27 09:49:54,730: INFO: Done sending all flows
2023-08-27 09:49:54,762: INFO: Module completed
Reveal Packet

Ethernet II, Src: Cisco_23:64:c1 (00:1c:58:23:64:c1), Dst: Cisco_64:33:41 (00:15:62:64:33:41)
    Destination: Cisco_64:33:41 (00:15:62:64:33:41)
    Source: Cisco_23:64:c1 (00:1c:58:23:64:c1)
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 1
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = DEI: Ineligible
    .... 0000 0000 0001 = ID: 1
    Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN, PRI: 0, DEI: 0, ID: 20
    000. .... .... .... = Priority: Best Effort (default) (0)
    ...0 .... .... .... = DEI: Ineligible
    .... 0000 0001 0100 = ID: 20
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.14.10, Dst: 192.168.14.20
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
    Total Length: 92
    Identification: 0x0001 (1)
    000. .... = Flags: 0x0
    ...0 0000 0000 0000 = Fragment Offset: 0
    Time to Live: 10
    Protocol: ICMP (1)
    Header Checksum: 0x1332 [validation disabled]
    [Header checksum status: Unverified]
    Source Address: 192.168.14.10
    Destination Address: 192.168.14.20
Internet Control Message Protocol
    Type: 0 (Echo (ping) reply)
    Code: 0
    Checksum: 0xdc45 [correct]
    [Checksum Status: Good]
    Identifier (BE): 1804 (0x070c)
    Identifier (LE): 3079 (0x0c07)
    Sequence Number (BE): 0 (0x0000)
    Sequence Number (LE): 0 (0x0000)
    Data (64 bytes)