Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 869 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 869 Bytes

Sniffer Example

This article explains a bit more what's going on in the code.

Simple sniffer written on Elixir using sockets.

Requires OTP version 22+

Usage

Run iex:

iex sniffer.ex

Start the sniffer:

> Sniffer.start_link([if_name: "wlp1s0", promiscuous: true])

> Sniffer.start_link([if_name: "wlp1s0"])

> Sniffer.start_link([])

Permissions

Make sure you have permissions to parse raw packets and enable promiscuous mode. It may require you to use sudo or set Linux capabilities:

setcap cap_net_raw,cap_net_admin=ep ERLANG_PATH/erts-VERSION/bin/beam.smp

Promiscuous mode

When promiscuous mode is enabled by the sniffer it is not set back when application clesed. Make sure you turn it off manually:

ip link set wlp1s0 promisc off