Skip to content
Host discovery written in go
Go Dockerfile Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
cmd/scan
.gitignore
Dockerfile
Gopkg.lock
Gopkg.toml
Makefile
README.md
scan.go

README.md

Go-scan

go-scan illustration

Go-scan is a host discovery written in go. It returns a structured list of devices connected to a specified network.

Getting started

# Download dependencies
$ dep ensure

# Generate the binary
$ make

# Read the doc
$ ./go-scan --help

# Scan a specific CIDR
$ ./go-scan --cidr 72.5.1.1/24

# Scan local network (192.168.1.1/24)
$ ./go-scan

How to use it

import (
  fmt

  scan "github.com/fberrez/go-scan"
)

func main() {
  scan, err := scan.New("192.168.1.1/24")

  if err != nil {
    panic(err)
  }

  if err = scan.Scan(); err != nil {
    panic(err)
  }

  results, err := json.Marshal(scan.Result)
	if err != nil {
		panic(err)
	}

  fmt.Printf("%s", results)
}

Example of results

[
 {
   "host": "192.168.1.1",
   "name": "box"
 },
 {
   "host": "192.168.1.10",
   "name": "device1"
 },
 # ... other devices
]
You can’t perform that action at this time.