gophorus

module
v0.0.0-...-6fd5be8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2020 License: Apache-2.0

README

Gophorus

GitHub GitHub go.mod Go version GitHub tag (latest SemVer)

A really fast network utility library for scanning network devices.

Features:

  • Port Scanning
  • UPnP (ssdp)

Build with ❤ by

Oleaintueri is sponsoring the development and maintenance of this project within their organisation.

Getting started

Installation

GO111MODULE=on go get github.com/Oleaintueri/gophorus

Usage

package main

import (
	"fmt"
	"github.com/Oleaintueri/gophorus/internal/pkg/ports"
	"github.com/Oleaintueri/gophorus/pkg/gophorus"
)

func main() {
	// A singular IP to scan
	gp, err := gophorus.NewPortScanner("192.168.0.1",
		ports.WithReturnOnlyOpen(true),
		ports.WithPorts([]int{
			443,
			8000,
			9000,
		}))

	// Scan an entire cidr
	gp, err = gophorus.NewPortScanner("192.168.0.1",
		ports.WithEntireCidr(true),
		ports.WithReturnOnlyOpen(true),
		ports.WithTimeout(2000),
		ports.WithProtocol(ports.PROTOCOL_TCP),
		ports.WithPorts([]int{
			80,
			443,
			8000,
			9000,
		}))

	if err != nil {
		panic(err)
	}

	devices, err := gp.Scan()

	if err != nil {
		panic(err)
	}

	for i := range devices {
		fmt.Printf("Device: %v", devices[i])
	}
}

Other Resources

Directories

Path Synopsis
internal
pkg
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL