2020-01-21 03:31:42 +01:00

1.3 KiB

Raw socket programming challenge

How to send a pure ethernet packet?

Let us know in your favorite programming language!

What are we expecting?

A layer 2 ethernet frame is constructed in the following way.

[Destination MAC: 6 bytes][Source MAC: 6 bytes][Protocol: 2 bytes][Message: ZeusWPI is de max!]

For example

\xff\xff\xff\xff\xff\xff \x12\xab\x34\xcd\x56 \x60\x00  \x5a\x45\x75\x53...
   Broadcast Dest MAC   |     Source MAC     | Protocol | Your binary message

Send that frame with the protocol \x60\x00 and the message ZeusWPI is de max! over the same network interface that the listener is listening on and it will confirm that you completed the challenge!

You can then put your code in a folder with the name of the programming language providing instructions on how to run it.

How to

We are providing some code that will listen to any packets received. It will give you a confirmation if you completed the challenge.

The only python package requirement is netifaces. Install with the command pip install --user netifaces

Create a file named .env with the following line INTERFACE=YOUR_NETWORK_INTERFACE

  • Run the listener with sudo make listener

  • We also provide an example client in python. Run it with sudo make example-sender