GithubHelp home page GithubHelp logo

gcarq / arp-spoof Goto Github PK

View Code? Open in Web Editor NEW
47.0 5.0 6.0 19 KB

Minimal ARP-Spoofing tool written in Rust

License: BSD 2-Clause "Simplified" License

Rust 100.00%
security arp network pcap rust linux arp-spoofing

arp-spoof's Introduction

arp-spoof

This is a minimal ARP-Spoofing tool written in Rust language using pcap.

This tool allows intercepting Ipv4 traffic between two hosts on the same network. Typically, between one machine and the internet gateway.

Please note, this tool was created to get comfortable with Rust, so the code isn't necessarily optimal nor idiomatic.

This tool is for educational purposes only.

Features:

  • 1 to 1 route poisoning
  • save intercepted traffic as pcap file
  • automatic Ipv4 forwarding

Usage

Usage:
    ./arp-spoof [OPTIONS]

Minimal ARP spoofing tool written in Rust.

optional arguments:
  -h,--help             show this help message and exit
  -i,--interface INTERFACE
                        interface name
  --target TARGET       target ipv4 address
  --gateway GATEWAY     gateway ipv4 address
  --log-traffic         logs all target traffic to `save.pcap`
  -n,--no-forward       leave `/proc/sys/net/ipv4/ip_forward` untouched
  -V,--version          show version

A typical invocation would look like this. The arguments are pretty self-describing.

# ./arp-spoof --interface eth0 --target 192.168.0.16 --gateway 192.168.0.1 --log-traffic
[*] Using device eth0 ...
 -> ip address: 192.168.0.100
 -> mac address: 95:8F:6F:17:36:71
 -> connection_status: Connected
[+] forwarding ipv4 traffic: true
[*] Resolving hosts (this can take a bit) ...
 -> found 7E:FA:8B:B2:F5:8A at 192.168.0.16
 -> found 7C:0B:B6:94:11:6B at 192.168.0.1
[*] Saving captured packets as save.pcap ...
[+] Poisoning traffic between 192.168.0.16 <==> 192.168.0.1
[*] Received: 274, dropped: 0, if_dropped: 0
[*] Received: 518, dropped: 0, if_dropped: 0

Building

# cargo build --release
# ./target/release/arp-spoof --help

Tested with rust 1.68.0.

Linux

On Arch based Linux, install community/rust, community/cargo and core/libpcap. If not running as root, you need to set capabilities like so: sudo setcap cap_net_raw,cap_net_admin=eip path/to/bin

TODO:

  • implement n to m route poisoning

arp-spoof's People

Contributors

gcarq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

arp-spoof's Issues

Use repr(C) for guaranteed layout

Rust reserves the right to reorder fields within structs/enums as it desires, which makes the transmutes from byte slices (from the wire) questionable.

You should annotate both Ethernet and ArpHeader as #[repr(C)] to guarantee layout (or anywhere else I've missed!). Possibly packed too if you need to remove padding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.