Coder Social home page Coder Social logo

hwipl / listnd Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 184 KB

Passive discovery and listing of devices on a network

License: MIT License

Go 100.00%
network network-devices network-discovery network-analyzer packet-capture packet-analyzer command-line-tool golang

listnd's Introduction

listnd

listnd is a command line tool for discovery of devices on a network and listing them. The discovery process is passive in the sense that listnd does not send any packets to discover devices on the network. Instead, it only captures packets on a network interface and analyses them.

Installation

listnd requires libpcap to capture packets from network interfaces. So, make sure you have libpcap installed. For example on a debian-based distribution:

$ sudo apt install libpcap-dev

After installing dependencies you can download, build and install listnd with its other dependencies to your GOPATH or GOBIN (usually ~/go/bin/) with the go tool:

$ go install github.com/hwipl/listnd/cmd/listnd

Usage

You can run listnd with

$ listnd

Make sure your user has the permission to capture traffic on the network interface.

You can specify the network interface with the option -i. For example, you can specify the interface eth3 with:

$ listnd -i eth3

Command line options of the listnd command:

  -debug
        set debugging mode
  -f file
        set the pcap file to read packets from
  -http address
        use http server and set the listen address (e.g.: :8000)
  -i interface
        set the interface to listen on
  -interval seconds
        set output interval to seconds (default 5)
  -pcap-filter filter
        set pcap packet filtering to filter
  -pcap-promisc
        set pcap promiscuous parameter (default true)
  -pcap-snaplen bytes
        set pcap snapshot length parameter to bytes (default 1024)
  -pcap-timeout seconds
        set pcap timeout parameter to seconds (default 1)
  -peers
        show peers

When listnd is running, it periodically prints the discovered devices and information it was able to gather about them to the console.

Examples

Running listnd on a small home network for a short period:

$ sudo ./listnd -i eth3
[...]
======================================================================
Devices: 2                                       (pkts: 5246)
======================================================================
MAC: 5c:49:79:fe:dc:ba                           (age: 1, pkts: 3317)
  Properties:
    Router: true                                 (age: 122)
    Powerline: true                              (age: 2)
  Unicast Addresses:
    IP: 2001:c0ff:eec0:ffee:5e49:79ff:fefe:dcba  (age: 93, pkts: 1)
    IP: fe80::5e49:79ff:fefe:dcba                (age: 52, pkts: 1)
    IP: 192.168.1.1                              (age: 87, pkts: 12)
  Multicast Addresses:
    IP: 224.0.0.251                              (age: -1, pkts: 0)
    IP: 224.0.0.22                               (age: -1, pkts: 0)
    IP: 224.0.0.2                                (age: -1, pkts: 0)
    IP: 239.255.255.250                          (age: -1, pkts: 0)
    IP: 224.0.0.252                              (age: -1, pkts: 0)

MAC: 70:85:c2:ab:cd:ef                           (age: 1, pkts: 1929)
  Unicast Addresses:
    IP: 192.168.1.23                             (age: 1, pkts: 1842)
    IP: fe80::7285:c2ff:feab:cdef                (age: 52, pkts: 5)

listnd's People

Contributors

dependabot[bot] avatar hwipl avatar zekiahmetbayar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

listnd's Issues

Installation fail

Trying to install listnd:

user@ubuntu:~/Desktop$ go get github.com/hwipl/listnd/cmd/listnd
github.com/hwipl/listnd/internal/pkt
../go/src/github.com/hwipl/listnd/internal/pkt/dhcp.go:44:8: undefined: layers.DHCPv6MsgTypeAdverstise

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.