Jump to content
 Share

Roy

[C] Packet Sequence Program!

Recommended Posts

Hey everyone,

 

I just wanted to share another C project I'm working on which takes my Packet Flooding program I made here to a new level and has the potential to become a network monitoring tool.

 

Video

I made a video showing what the tool is capable of and an explanation of it here:

 

 

Description

This tool allows you to create sequences and execute them in order for sending packets to hosts. It includes many features such as:

 

  • Creating config files using the YAML syntax.
  • Supports protocols UDP, TCP, and ICMP.
  • Being able to spoof as random IP ranges in IP/CIDR format or set a static source IP.
  • Being able to randomize the source or destination ports when using UDP/TCP.
  • Specifying source and destination MAC addresses. If left un-touched, will retrieve the source MAC of the interface you specify in the config and the destination MAC of the host's default gateway (e.g. your router).
  • Specifying specific payloads (in hexadecimal) or randomly generating payload between a minimum and maximum length.
  • Create max limits per sequence using packet count, max data sent, or timing (in seconds).
  • Able to block per sequence which means it won't move on to the next sequence until the current ends.
  • Specifying how many threads (pthreads) to spawn per sequence (if left un-touched or set to 0, will use the host's CPU count).
  • Enable or disable both layer 3 and layer 4 checksum calculations. If your NIC supports checksum offload (e.g. the NIC's hardware calculates the checksum), I'd recommend at least disabling the layer 3 checksum (IP header) calculation for increased performance.

 

With that said, I plan on implementing sequence types for receiving packets and hope to implement functionality that allows later sequences to use the response from the receive sequence. With that said, I'd like to implement functionality that allows you to send HTTP/HTTPS requests to a host if the receive sequence succeeds or fails x amount of times. This would allow the tool to operate as a network monitor to an extent.

 

This tool is not fully completed yet, but the basic functionality works as seen in the video above.

 

Test Configs

Here are some test configs I made when testing the tool:

 

Basic UDP:

 

# First basic config I'm making to show as an example on what the tool will be able to do.
interface: "ens18"

sequences:
  initial:
    # If we want to run other configs before this sequence (e.g. establishing a TCP handshake), use includes.
    includes:
      - /etc/sequencecfgs/tcp_handshake.yaml

    # If set to true, will send outgoing packets. Otherwise, will receive.
    send: True

    # Amount of times to generate the packet/sequence.
    count: 50

    # How many threads to spawn to handle this sequence (use 0 for host's CPU count).
    threads: 4
    
    # Ethernet header options.
    #eth:
      # Source MAC address (don't include to automatically retrieve the MAC address of 'interface').
      #smac: ""

      # Destination MAC address (don't include to automatically retrieve the MAC address of the default gateway).
      #dmac: ""

    # Additional IP options.
    ip:
      # Source IP (Required).
      srcip: "192.168.90.3"

      # Destination IP (Required).
      dstip: "172.16.0.3"

      # Layer 4 protocol (e.g. UDP, TCP, ICMP, etc) (Required).
      protocol: udp

      #tos: 0
      #ttl:
        #fixed: 64
        #maxttl: 128
        #minttl: 64

      # Whether to calculate IP header's checksum (if disabled and you have checksum offload enabled on NIC, will result in higher performance).
      #csum: True
    
    # UDP specific options.
    udp:
      srcport: 27000 # Don't include this for randomized port.
      dstport: 27015 # Don't include this for randomized port.

    # Whether to calculate layer 4 header's checksum (e.g. UDP/TCP/ICMP).
    #l4csum: True
    
    # Payload options.
    payload:
      # Payload length options.
      length:
        fixed: 64 # 64 bytes in payload size.
        #max: 1500
        #min: 1500
      
      # The exact payload is hexadecimal. If this is specified, anything related to the payload length will be ignored.
      #exact: "FF FF FF FF 49"

  second:
    send: true
    count: 300
    threads: 0
    ip:
      ranges:
          - 192.168.90.0/24
      dstip: "172.16.0.3"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 49"

 

Test:

 

# First basic config I'm making to show as an example on what the tool will be able to do.
interface: "ens18"

sequences:
  one:
    send: true
    time: 30
    threads: 0
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 49"
  second:
    send: true
    count: 300
    threads: 0
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      ranges:
          - 192.168.90.0/24
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 0
      dstport: 8808
    l4csum: True
    payload:
      length:
        max: 1400
        min: 500

 

Test #2:

 

# First basic config I'm making to show as an example on what the tool will be able to do.
interface: "ens18"

sequences:
  one:
    send: true
    block: true
    count: 1
    threads: 1
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 49"
  two:
    send: true
    block: true
    count: 1
    threads: 1
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 66"
  three:
    send: true
    block: true
    count: 1
    threads: 1
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 80"
  four:
    send: true
    block: true
    count: 1
    threads: 1
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "FF FF FF FF 90"
  five:
    send: true
    block: true
    count: 1
    threads: 1
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      srcip: "10.50.0.3"
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27015
    l4csum: True
    payload:
      exact: "01 02 03 04 05"
  six:
    send: true
    count: 10
    threads: 2
    eth:
      smac: "1a:c4:df:70:d8:a6"
      dmac: "ae:21:14:4b:3a:6d"
    ip:
      ranges:
        - 192.168.90.0/24
        - 10.30.0.0/24
        - 172.16.0.0/16
      dstip: "10.50.0.4"
      protocol: udp
      csum: True
    udp:
      srcport: 27000
      dstport: 27016
    l4csum: True
    payload:
      length:
        min: 300
        max: 500

 

You may see the results in the video of Test #2. Here is the TCPDump output on the machine running with 10.50.0.4:

 

18:33:05.061539 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 47: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 33)
    10.50.0.3.27000 > 10.50.0.4.27015: [udp sum ok] UDP, length 5
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0021 0000 0000 0011 a662 0a32 0003 0a32  .!.......b.2...2
        0x0020:  0004 6978 6987 000d cf69 ffff ffff 49    ..ixi....i....I
18:33:06.049362 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 47: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 33)
    10.50.0.3.27000 > 10.50.0.4.27015: [udp sum ok] UDP, length 5
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0021 0000 0000 0011 a662 0a32 0003 0a32  .!.......b.2...2
        0x0020:  0004 6978 6987 000d b269 ffff ffff 66    ..ixi....i....f
18:33:07.049344 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 47: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 33)
    10.50.0.3.27000 > 10.50.0.4.27015: [udp sum ok] UDP, length 5
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0021 0000 0000 0011 a662 0a32 0003 0a32  .!.......b.2...2
        0x0020:  0004 6978 6987 000d 9869 ffff ffff 80    ..ixi....i.....


18:33:08.049363 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 47: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 33)
    10.50.0.3.27000 > 10.50.0.4.27015: [udp sum ok] UDP, length 5
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0021 0000 0000 0011 a662 0a32 0003 0a32  .!.......b.2...2
        0x0020:  0004 6978 6987 000d 8869 ffff ffff 90    ..ixi....i.....
18:33:09.049335 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 47: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 33)
    10.50.0.3.27000 > 10.50.0.4.27015: [udp sum ok] UDP, length 5
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0021 0000 0000 0011 a662 0a32 0003 0a32  .!.......b.2...2
        0x0020:  0004 6978 6987 000d 0f64 0102 0304 05    ..ixi....d.....
18:33:10.049428 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 522: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 508)
    192.168.90.73.27000 > 10.50.0.4.27016: [udp sum ok] UDP, length 480
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  01fc 0000 0000 0011 93ca c0a8 5a49 0a32  ............ZI.2
        0x0020:  0004 6978 6988 01e8 4af6 251b 01b9 4ee2  ..ixi...J.%...N.
        0x0030:  9bf9 2c66 f389 c42c d636 52f3 7218 8680  ..,f...,.6R.r...
        0x0040:  e230 711e 8ad4 3de3 28ca 9fb3 a536 0c05  .0q...=.(....6..
        0x0050:  af33 ad68 0742 12c3 9a66 a85e 510b eba4  .3.h.B...f.^Q...
        0x0060:  a7aa 5ba4 ff2d 2f5c b213 cbb4 e952 f14b  ..[..-/\.....R.K
        0x0070:  30ff b9f4 c5ae 41fe b499 2437 a382 abad  0.....A...$7....
        0x0080:  6d59 c539 709d b6bc a582 9126 74d6 663b  mY.9p......&t.f;
        0x0090:  44a2 3b14 d493 bb66 4b16 af84 1045 2f25  D.;....fK....E/%
        0x00a0:  5a84 97e6 86e9 3b8d 2b5f da12 ed89 d35d  Z.....;.+_.....]
        0x00b0:  1467 18cf dbb9 e582 8926 304f 401b de93  .g.......&[email protected]
        0x00c0:  9774 bab1 e9dc 2556 6af4 8d7e fe34 9e39  .t....%Vj..~.4.9
        0x00d0:  c894 3a2d 84ea 29da 9411 8f9f dbcd 2180  ..:-..).......!.
        0x00e0:  4c71 15a4 413c dd9f 8b87 9374 4d9f 3258  Lq..A<.....tM.2X
        0x00f0:  8872 8936 75ec eef6 951e b57d 8923 5f72  .r.6u......}.#_r
        0x0100:  a1c2 91c6 35d2 caf0 b760 d3fb 8392 f440  ....5....`[email protected]
        0x0110:  7c49 ecf3 5788 9d5f b496 89ef f2e5 00f3  |I..W.._........
        0x0120:  beb0 151f 6f66 55d2 14c9 351b 49d4 4f7b  ....ofU...5.I.O{
        0x0130:  cc60 4b6a d285 9d9b 1ac1 f4ff bdda 6d8a  .`Kj..........m.
        0x0140:  cb83 8ab7 96bf e5cc cb08 a2dc 452e a890  ............E...
        0x0150:  a000 8fa5 8fac 5734 ede7 ddb4 94cb 0dbf  ......W4........
        0x0160:  f082 d796 52a6 e265 0466 0247 2068 6907  ....R..e.f.G.hi.
        0x0170:  2071 9fab 34c5 32b1 564f 2d16 1e7f 491a  .q..4.2.VO-...I.
        0x0180:  55f6 e4c5 4ae3 b527 e72a 3c62 8249 fa69  U...J..'.*<b.I.i
        0x0190:  74fa 6484 6a98 979a 7d41 cb2d 02bf 8824  t.d.j...}A.-...$
        0x01a0:  2127 9a4b 283d c59a 9c9d 3837 139a c23c  !'.K(=....87...<
        0x01b0:  c3e4 c539 d9ec ed77 8a07 9f02 ea53 3363  ...9...w.....S3c
        0x01c0:  7e5c e130 927d 7b44 4b07 dfcd 7b23 290a  ~\.0.}{DK...{#).
        0x01d0:  3777 abd0 298a 9cd1 a5e7 929b 7c03 b161  7w..).......|..a
        0x01e0:  93de a07c 326b 3eaf 1cb0 182c 62ac 985a  ...|2k>....,b..Z
        0x01f0:  f6fb fd53 023a 0d2f f52a 8c02 6196 6aa5  ...S.:./.*..a.j.
        0x0200:  87f5 bf37 aecf 7762 37df                 ...7..wb7.
18:33:10.049428 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 439: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 425)
    10.30.0.68.27000 > 10.50.0.4.27016: [udp sum ok] UDP, length 397
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  01a9 0000 0000 0011 a4ad 0a1e 0044 0a32  .............D.2
        0x0020:  0004 6978 6988 0195 a6e9 2a63 0d53 4a55  ..ixi.....*c.SJU
        0x0030:  0ec8 2792 ab06 4193 4415 ca80 6144 fa91  ..'...A.D...aD..
        0x0040:  5d6c 2031 e4f6 7be7 1d9c cdf4 a7f2 abbc  ]l.1..{.........
        0x0050:  44a3 95e5 567b c93f 0d29 d669 5cc0 f22f  D...V{.?.).i\../
        0x0060:  af00 0cb5 5e59 a054 dfaa 4c47 bdcd 2504  ....^Y.T..LG..%.
        0x0070:  4bd3 c96a 180e 349f 21d2 52b7 c7fb 5814  K..j..4.!.R...X.
        0x0080:  862d d28f 62dd 7b59 1f12 cfa2 38eb 60f6  .-..b.{Y....8.`.
        0x0090:  8cdf eb6b d8c6 297b e89b 66b1 8bfd d306  ...k..){..f.....
        0x00a0:  4a7a 9a08 d88a b5be 475c 7e4d ff54 045a  Jz......G\~M.T.Z
        0x00b0:  6e4f 232e 7fab 529b cb09 3aa0 90cf 0acd  nO#...R...:.....
        0x00c0:  646f 8c67 a969 f64b bf11 8092 fb10 b9f8  do.g.i.K........
        0x00d0:  5aab 99fc f4c5 56c6 31a5 f6cc bd78 a733  Z.....V.1....x.3
        0x00e0:  3c94 d0f5 bc81 e6c7 eeb7 ffb7 1327 2797  <............''.
        0x00f0:  b77b 751c 1f1d dcc5 82f8 c17c fa00 50fe  .{u........|..P.
        0x0100:  3872 8efa fada 2dfa 3cd8 2205 30a2 f600  8r....-.<.".0...
        0x0110:  ed48 dfd7 e9b9 8d60 2789 c5f9 306f aff7  .H.....`'...0o..
        0x0120:  c28f eebe 4a7c 73ae 12fb 10c3 3988 cefb  ....J|s.....9...
        0x0130:  6599 ff75 39a3 125e 88e0 288b 46cd 6ae5  e..u9..^..(.F.j.
        0x0140:  4275 1888 9570 60a9 d7a8 f33a 16e1 574f  Bu...p`....:..WO
        0x0150:  86f5 fd3e f8e2 1188 0c85 147a 2523 2a91  ...>.......z%#*.
        0x0160:  1fab 33a1 c2bc 9bb4 f467 f1b2 b0b5 39c5  ..3......g....9.
        0x0170:  b9e7 0079 0e7e 33a5 1b00 af0d b477 98c3  ...y.~3......w..
        0x0180:  c2b9 6950 b96a ce96 d0c1 3473 ee0c 1c24  ..iP.j....4s...$
        0x0190:  65f4 326f 6180 217f 1eda 238d dcd3 5a42  e.2oa.!...#...ZB
        0x01a0:  9128 e0df 6381 a018 d33d e2c4 b9ef a736  .(..c....=.....6
        0x01b0:  f3a5 b968 dbee 81                        ...h...
18:33:10.049428 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 384: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 370)
    192.168.90.64.27000 > 10.50.0.4.27016: [udp sum ok] UDP, length 342
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0172 0000 0000 0011 945d c0a8 5a40 0a32  .r.......][email protected]
        0x0020:  0004 6978 6988 015e 66e7 1c8d e986 56fc  ..ixi..^f.....V.
        0x0030:  b45a 3710 838e c95d fb79 62d8 94c1 a05f  .Z7....].yb...._
        0x0040:  ebba 15f8 d790 c1db 3d26 4331 a3bc ce99  ........=&C1....
        0x0050:  8653 dc6e 6ad0 a4ca b5e2 4b48 3ba2 dd8c  .S.nj.....KH;...
        0x0060:  98ff f983 41d7 4e6a 58e4 c98f 415c 8ad9  ....A.NjX...A\..
        0x0070:  f856 9a08 20ed 5dbc da26 c837 5a91 52e1  .V....]..&.7Z.R.
        0x0080:  3ab1 ab8e 8c1c 2e81 b161 1630 ebac 72c4  :........a.0..r.
        0x0090:  b32a d966 cb2c dd3b 120d 402b 19d4 e865  .*.f.,.;[email protected]+...e
        0x00a0:  7999 92a2 e1a7 482a f165 939a c9f4 6f63  y.....H*.e....oc
        0x00b0:  6097 0211 94d6 0b50 0561 1bae a0b4 8620  `......P.a......
        0x00c0:  fd7f 1645 69c2 846c c1b9 a757 037e 68bc  ...Ei..l...W.~h.
        0x00d0:  a567 7c8f a333 d001 5ae8 c247 1779 141a  .g|..3..Z..G.y..
        0x00e0:  6d2a a001 4ab3 cb50 c725 baee c190 46d9  m*..J..P.%....F.
        0x00f0:  2b60 b06a 218a 1358 bb6b 9c7e a66a 7b5b  +`.j!..X.k.~.j{[
        0x0100:  7363 985d adc3 05dc ac71 35e7 2b72 f1c1  sc.].....q5.+r..
        0x0110:  9a4b 0529 3425 bd5c cfb1 12db 75d0 a3ec  .K.)4%.\....u...
        0x0120:  b6f2 65e1 ba39 181a 1865 80cb 696e 4f7c  ..e..9...e..inO|
        0x0130:  9af0 e454 0549 b516 3d84 8be7 acf3 73d4  ...T.I..=.....s.
        0x0140:  dd9e 6f15 995e ef11 b3c8 0220 a3ca 4a13  ..o..^........J.
        0x0150:  d316 b474 bb41 e38c afaa 7028 721b d31b  ...t.A....p(r...
        0x0160:  9230 1f81 727a 6fc9 2562 2370 00cf ca8c  .0..rzo.%b#p....
        0x0170:  ed86 dd0f 8053 30c8 cbeb 2828 f18f acc9  .....S0...((....
18:33:10.049428 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 433: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 419)
    10.30.0.59.27000 > 10.50.0.4.27016: [udp sum ok] UDP, length 391
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  01a3 0000 0000 0011 a4bc 0a1e 003b 0a32  .............;.2
        0x0020:  0004 6978 6988 018f c227 21d4 f51f 526f  ..ixi....'!...Ro
        0x0030:  272a 323b 3b0b 46c4 6958 da65 83ec 136f  '*2;;.F.iX.e...o
        0x0040:  67f5 c30b 31b2 ffdf 33f8 7172 a479 6d4f  g...1...3.qr.ymO
        0x0050:  1ac3 c4eb b909 5b46 28a4 7a53 4657 e418  ......[F(.zSFW..
        0x0060:  a054 aa94 a002 be63 857b 4a22 15d7 bd92  .T.....c.{J"....
        0x0070:  142a a97e 724d 4f5d 475f f6b7 7f0a ff47  .*.~rMO]G_.....G
        0x0080:  5385 b8e4 7e5c f21f 2bf1 53ab b0c1 6c80  S...~\..+.S...l.
        0x0090:  fc66 8abd cf5f 4c51 ae92 f758 958d 8b45  .f..._LQ...X...E
        0x00a0:  698e 95c4 3448 c15c 0e62 36d6 dbbf a160  i...4H.\.b6....`
        0x00b0:  ba7f 0d70 38c8 7869 4744 25ff f068 b25a  ...p8.xiGD%..h.Z
        0x00c0:  ca79 e8fb 294f 5561 15d7 9a6b 0159 837b  .y..)OUa...k.Y.{
        0x00d0:  377e db5e 130e fcee f77c 2973 f923 9acd  7~.^.....|)s.#..
        0x00e0:  5d4d 5b52 c5f8 d477 2956 2731 8718 3c18  ]M[R...w)V'1..<.
        0x00f0:  5a69 9c50 cbbb 0127 a845 a97d 1847 6de7  Zi.P...'.E.}.Gm.
        0x0100:  0a12 9491 71ca 67e6 31e9 84f1 d782 f381  ....q.g.1.......
        0x0110:  0b4a f80e c556 ad5d 42a4 4ee5 b35b 51ef  .J...V.]B.N..[Q.
        0x0120:  bad1 3d80 954f 37f6 1697 5b73 5921 cffc  ..=..O7...[sY!..
        0x0130:  3328 975f 6c67 29d8 aba2 c073 35e7 702f  3(._lg)....s5.p/
        0x0140:  5490 fce6 970f 6aee bf68 527e 747c f9d2  T.....j..hR~t|..
        0x0150:  ba0b 210c 2577 9de0 ce48 a7ee 0373 f0ed  ..!.%w...H...s..
        0x0160:  c159 7b8c e290 2917 1564 12db 901b 9a4a  .Y{...)..d.....J
        0x0170:  87fb 3edd 5a0c 31bc 909d aa1f 8787 fa72  ..>.Z.1........r
        0x0180:  e833 603a db5c 9cb9 fe94 4452 1687 d8ad  .3`:.\....DR....
        0x0190:  8201 969a 73b0 0db5 dca9 73ce 29ac b705  ....s.....s.)...
        0x01a0:  b126 54b7 edfa eb1b 65fe 8eab 6d46 dc43  .&T.....e...mF.C
        0x01b0:  94                                       .
18:33:10.049428 1a:c4:df:70:d8:a6 > ae:21:14:4b:3a:6d, ethertype IPv4 (0x0800), length 414: (tos 0x0, id 0, offset 0, flags [none], proto UDP (17), length 400)
    192.168.90.55.27000 > 10.50.0.4.27016: [udp sum ok] UDP, length 372
        0x0000:  ae21 144b 3a6d 1ac4 df70 d8a6 0800 4500  .!.K:m...p....E.
        0x0010:  0190 0000 0000 0011 9448 c0a8 5a37 0a32  .........H..Z7.2
        0x0020:  0004 6978 6988 017c d444 3739 3020 3dae  ..ixi..|.D790.=.
        0x0030:  6835 1613 d27e bac9 8db1 3328 2dc7 53c3  h5...~....3(-.S.
        0x0040:  d01d 2a6a f15b 36f3 fe12 57b8 aa28 88de  ..*j.[6...W..(..
        0x0050:  02f4 4e5b 4227 eeb5 6470 628a 7cdd 08d2  ..N[B'..dpb.|...
        0x0060:  c602 1fe6 7adb f13f 6671 cffe 393e c12f  ....z..?fq..9>./
        0x0070:  9f50 f9cc 102f 0a83 677f dd37 3465 5e46  .P.../..g..74e^F
        0x0080:  d2a9 f98f 379e c831 8dc4 8814 842a 4e28  ....7..1.....*N(
        0x0090:  6594 fe6f e560 76bb be28 8d37 fd26 bea7  e..o.`v..(.7.&..
        0x00a0:  1c5b a26d cf6d 2252 9d54 6901 35b3 9a52  .[.m.m"R.Ti.5..R
        0x00b0:  7c06 454b 6980 99e6 90b1 5992 7fe9 8f7b  |.EKi.....Y....{
        0x00c0:  cc5f 0289 e910 6829 bd68 5acd f2a2 0a33  ._....h).hZ....3
        0x00d0:  0eef b768 4458 db8b 0763 2951 6276 394b  ...hDX...c)Qbv9K
        0x00e0:  0afe 00ea 2e4f 013d 1449 4480 65bf 0955  .....O.=.ID.e..U
        0x00f0:  4296 3bce 1eaf a532 4a85 e67b 4e95 25a0  B.;....2J..{N.%.
        0x0100:  fd80 8497 47f1 5518 cc3f 0e22 34d1 fc3f  ....G.U..?."4..?
        0x0110:  4045 b986 9f4e 5e63 8060 7818 eb0d bb01  @E...N^c.`x.....
        0x0120:  cf2d 779a dabf cd42 0b91 a1bc 08a1 4d79  .-w....B......My
        0x0130:  3042 1a96 6efd 6fa6 d33c c630 e1a7 61f6  0B..n.o..<.0..a.
        0x0140:  a74c c0fb 9081 d041 fb89 e455 8af7 648b  .L.....A...U..d.
        0x0150:  39d5 4608 3584 3f84 6961 b8cb d72b 8207  9.F.5.?.ia...+..
        0x0160:  ac26 48c0 11fe c79f c26d bff4 609b a8fd  .&H......m..`...
        0x0170:  8547 24e3 9baa 3683 6b16 37f2 7760 83bd  .G$...6.k.7.w`..
        0x0180:  0803 f6f2 06ff 19e2 8985 1ba4 3354 8158  ............3T.X
        0x0190:  3ae0 9c2f 4738 bd2d 02a4 2aab 680f       :../G8.-..*.h.

 

Other Notes

  • This project uses libyaml.
  • Here's the code I made to parse the YAML files using libyaml.
  • Here's a function to select a random IP based off of a network IP/CIDR (e.g. 192.168.90.0/24). Requested help on Stack Overflow thread here which was successful :) 

 

Compiling

You may simply use make to compile the program. Here's an example:

 

# Receive repo and libyaml via --recursive
git clone --recursive https://github.com/gamemann/Packet-Sequence.git

# Make libyaml and the packet sequence program.
make

sudo ./pcktseq -c /path/to/config.yaml

 

GitHub Repo

 

Credits go to me (Christian Deacon) for this program.

 

Thank you!

 

Edit

Video was just uploaded. Also, as always, I do not support this tool for malicious use. This will be used as a monitoring or pen-testing tool.

Share this post


Link to post
Share on other sites


Posted  Edited by positive

Great job doing something complicated we can't understand so we're not able to negatively criticize it. Jesus, roy, you absolute dick.

Edited by positive

Share this post


Link to post
Share on other sites


17 minutes ago, positive said:

Great job doing something complicated we can't understand so we're not able to negatively criticize it. Jesus, roy, you absolute dick.

 

Haha I just see a bunch of letters and numbers but it looks very good ❤️

Share this post


Link to post
Share on other sites

Achievements

I do not understand anything that you have put but what I do see is a huge passion for the occupation that you hold. I have a lot of respect for what you do, especially for GFL. Not a lot of people will ever get to understand the depths of what you know, and I think that's a really great aspect to flex . :kekw: ❤️

 

Share this post


Link to post
Share on other sites


Friday night and yesterday morning, I made many changes to my Packet Sequence program.

 

I moved as many static instructions outside of the while loop as possible and also added a feature for static payload. The move of many instructions outside of the while loop heavily improved performance. With that said, what the static payload does is it generates payload between the minimum and maximum lengths once before the while loop and uses that same payload repeatedly. If this isn't set, it generates random bytes of payload between min and max lengths for every packet. Depending on how big you want the packet to be, this can consume a lot of resources, especially if you're looking to do 64 KB packets. When using static payload with 61 KBs of payload, I went from 10 - 20 gbps to 50 - 60 gbps. This is a major difference and I find it cool my super old Intel Xeon CPU can push 50 - 60 gbps!

 

I made a video here demonstrating this as well for those interested.

 

 

I also tried messing with some of the read and write limits for sockets in the video to see if they would have any effect. I know when increasing the write limit, it results in the program using more of its CPU, but I didn't see any major differences with how much bandwidth I'm able to send. If I set the write default limit to a very high value, it resulted in the program using 100% of each thread, but the amount of bandwidth I was able to send out was heavily lowered due to the CPU bottlenecking. 

 

I also made a hard-coded program for trying to push as much data as possible with Linux sockets over UDP which can be found here. I used this program to compare performance against my Packet Sequence program and they were both having similar results (when I had the static payload set of course). Therefore, I believe it's safe to say the packet submission process in the program has very great performance!

 

Additionally, I've also documented everything finally and configuration for these YAML config files may be found here.

 

I'm pretty happy with what I was able to accomplish with this program and I have a feeling once people start finding it, it'll get some attraction since I'm not able to find any other tools on GitHub similar to this. Of course, as I stated many times before, I do not support using this tool for malicious use in any way. I made it for pen-testing purposes and still have plans to make it into a network monitoring tool once I implement sequences that can read incoming packets.

Share this post


Link to post
Share on other sites


Posted  Edited by fantastic

Looks cool! In your README in your repository you mentioned you were able to generate 50-60 gbps to your destination VM within the same environment -- have you ever accidentally run this outside of your sandbox environment? Can't imagine your ISP would be happy 😛

Edited by fantastic

Share this post


Link to post
Share on other sites


On 12/28/2020 at 10:42 PM, fantastic said:

Looks cool! In your README in your repository you mentioned you were able to generate 50-60 gbps to your destination VM within the same environment -- have you ever accidentally run this outsie of your sandbox environment? Can't imagine your ISP would be happy 😛

I used another generating program I made outside of my environment when testing Azure Load Balancing at work. Let's just say Microsoft knows how to protect from unintentional SYN floods at the least lmao. My "Packet Flooder" program isn't nearly as fast as this program though. I'm going to be introducing command line features to my Packet Sequence program soon so it's easy to use as well and that'd be at the point where there's no point to use the Packet Flooder/Generator program unless if I want to easily send IPIP traffic since I built that in.

Share this post


Link to post
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...