Coder Social home page Coder Social logo

goportscanner's Introduction

GoPortScanner

GoPortScanner is a lightweight and efficient command-line tool written in Go for scanning TCP ports on a target host. It allows you to scan a range of ports concurrently, identify open ports, and optionally report errors for failed connections.

Features

  • Cross-Platform: Runs on various operating systems like Linux, macOS, and Windows.
  • Platform Support: The tool can be run on Linux, Windows, and macOS. It also supports both 32-bit and 64-bit machines.
  • Concurrent Scanning: Improves performance for large port ranges by utilizing multiple goroutines.
  • Timeout Control: Limits the connection attempt duration for each port.
  • Flexible Port Range: Supports single ports, comma-separated lists, or port ranges using a hyphen (-).
  • Error Reporting: Displays detailed error messages for failed connections (optional).
  • Clear Output: Provides a concise output indicating open ports and any encountered errors.

Notes

The compiled binary is available in the Releases section for convenience. and The windows version are currently not be able run it right now, you can build it by yourself. I will fix it ASAP.

Getting Started

Prerequisites

Installation

  1. Clone this repository:
git clone https://github.com/yoruakio/goportscan.git
  1. Navigate to the project directory:
cd goportscan
  1. Build the project:
go build # Output: goportscan (or goportscan.exe on Windows)
  1. Run the executable:
./goportscan -host example.com -range 80-85 -threads 100 -timeout 20

Usage

Usage of ./goportscan:
  -host string
    	Host or IP to scan (default "localhost")
  -range string
    	Port ranges e.g. 80,443,200-1000,8000-9000 (default "80,443")
  -threads int
    	Threads to use (default 100)
  -timeout duration
    	Timeout per port (default 1s)
  -verbose
    	Show errors for failed ports

Examples

  • Scan a single port (e.g., 80) on localhost:
./goportscan -host localhost -range 80
  • Scan multiple ports (e.g., 80, 443, 8080) on a remote host:
./goportscan -host example.com -range 80,443,8080
  • Scan a range of ports (e.g., 2000-3000) with verbose output:
./goportscan -host localhost -range 2000-3000 -verbose

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve the tool.

License

This project is licensed under the MIT License. See the LICENSE file for details.

goportscanner's People

Contributors

yoruakio avatar

Watchers

 avatar

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.