Skip to content

mike-kasianov/sniffer_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

About

Basic packet sniffer implementation on Elixir using sockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages