Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage details #1

wr47h opened this issue Jul 10, 2018 · 3 comments

Usage details #1

wr47h opened this issue Jul 10, 2018 · 3 comments


Copy link

@wr47h wr47h commented Jul 10, 2018

Not exactly an issue, but how to do what you have mentioned in the 1st line of README?
If you want to get this to work, you need to configure the Ethernet dst and src to point to your interface's MAC address and the target interface MAC address.

Copy link

@JuxhinDB JuxhinDB commented Jul 10, 2018

Hey @wr47h -- Great question. The README is currently just in a placeholder state right now. I'll be working on refining it along the lines of my other project, so I apologise for that.

To answer your question, if you take a look at the code here:


Lines 56 to 62 in 84797a0

let mut eth_header = MutableEthernetPacket::new(&mut tmp_packet[..ETHERNET_HEADER_LEN]).unwrap();
eth_header.set_destination(MacAddr::new(8, 0, 39, 203, 157, 11));
eth_header.set_source(MacAddr::new(10, 0, 39, 0, 0, 12));

You will notice that the Ethernet header has its source and destination MAC addresses hardcoded. I should instead pull these details from the network interface however for the time being you would need to do it yourself. The source MAC address is simply your local NIC card which can be pulled like so:

$ ipconfig /all

Ethernet adapter vEthernet (DockerNAT):

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #3
   Physical Address. . . . . . . . . : 00-15-5D-00-02-1E  <-- This guy here
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
   NetBIOS over Tcpip. . . . . . . . : Disabled

Whereas the Target MAC address would depend on the following:

  1. If it's a local target (e.g. VM or machine on your network) then you need to find the MAC address of its [generally Ethernet] interface (e.g. eth0 for Linux).

  2. If it's a remote target (e.g. Test DigitalOcean Droplet) then you would need to pass the MAC address of your default gateway (which is your router). If you know the router's IP you can find this by running arp -d {router_ip}

When that is done, you can run cargo build then cargo run {target_ip} {network_interface_name} for example:

cargo run \DEVICE\NNN_{FOO}

If you don't know your network interface beforehand, you can run the command once with a dummy value like I did above, and see what the console prints out thanks to:

println!("{:?}", &interfaces);

OR you can use tools like WireShark in order to see what interfaces it can pull.

  1. If you want to run this on Windows like I did, you're going to go through some growing pains. Libpnet (which is was builds and sends the packets) requires WinPcap in order to work. I recommend checking out their documentation

  2. Important: You need to make sure your terminal/command prompt is running with admin privileges in order to be able to pull the list of network interfaces.

I hope this helps.

Copy link

@JuxhinDB JuxhinDB commented Jul 11, 2018

This should now be resolved as of:

76b41ce and ece9655

You should be able to simply send a SYN packet by running:

$ cargo run eth0

I'll be implement packet count to adjust how many packets to send and will polish the README. Closing issue; if you have any further questions feel free to re-open. :-)

@JuxhinDB JuxhinDB closed this Jul 11, 2018
Copy link

@wr47h wr47h commented Jul 11, 2018

Right, now I understand. Thank you for the explanation. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants