Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

amirhnajafiz-archive/port-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Port Scanner

Get package:

go get github.com/amirhnajafiz/port-scanner

You need to give a host address and port range, after that the scanner will check the ports and returns the open ports.

package main

import (
    "fmt"

    scanner "github.com/amirhnajafiz/port-scanner"
)

func main() {
    // creating scanner with URI, Port Range, Number of workers (optional, default is 100)
    openports := scanner.Scan("", 2048)

    for _, port := range openports {
        fmt.Printf("%d open\n", port)
    }
}