Yet another TCP Port Scanner, but lightning faster.

Fast TCP Port Scanner

A highly concurrent TCP port scanner.

Run Tests with Code Coverage (Linux)

go test -cover

Compile (Linux)

go build -v -o fglps

Run (Linux)

Scan a single host

./fglps -host localhost

See the built-in help

./fglps -help

Usage Information

Usage of ./fglps:
  -firstPort int
        First port of port range to scan (1-65535) (default 1)
  -host string
        Host to scan
  -lastPort int
        Last port of port range to scan (1-65535) (default 65535)
  -portTimeout int
        Port timeout in seconds. (default 5)
  -threads int
        Thread count. (maximum simultaneous port scans) (default 65535)
Owner
Hysteresis
{Soft,Hard}ware Security Engineer.
Hysteresis
Similar Resources

Crimson prober - Asynchronous TCP scanner through SOCKS5 proxies

Crimson prober - Asynchronous TCP scanner through SOCKS5 proxies

Crimson Prober v1 Alpha version of Asynchronous TCP scanner through SOCKS5 proxi

Feb 19, 2022

TcpRoute , TCP 层的路由器。对于 TCP 连接自动从多个线路(电信、联通、移动)、多个域名解析结果中选择最优线路。

TcpRoute2 TcpRoute , TCP 层的路由器。对于 TCP 连接自动从多个线路(允许任意嵌套)、多个域名解析结果中选择最优线路。 TcpRoute 使用激进的选路策略,对 DNS 解析获得的多个IP同时尝试连接,同时使用多个线路进行连接,最终使用最快建立的连接。支持 TcpRoute

Dec 27, 2022

Multiplexer over TCP. Useful if target server only allows you to create limited tcp connections concurrently.

tcp-multiplexer Use it in front of target server and let your client programs connect it, if target server only allows you to create limited tcp conne

May 27, 2021

TCP output for beats to send events over TCP socket.

beats-tcp-output How To Use Clone this project to elastic/beats/libbeat/output/ Modify elastic/beats/libbeat/publisher/includes/includes.go : // add i

Aug 25, 2022

Tcp chat go - Create tcp chat in golang

TCP chat in GO libs Go net package and goroutines and channels tcp tcp or transm

Feb 5, 2022

A simple port scanner written in go

Scan27 A simple port scanner written in go Features: V1 it Scans the given Ip or Host name for open ports Usage ./scan27 Enter IP address or Host name

Jul 23, 2022

port close check scanner. detects open ports, sends alert with slack.

aite9 (port close check scanner) サーバのポートが空いてないことを確認するポートスキャナー たくさんのサーバを管理していると設定ミスで内部利用ポートが外部に公開されてしまっている可能性があり、それに早く気付くためのチェックツールです。 サーバのリストを標準入力で渡すと

Feb 3, 2022

Port Scanner & Banner Identify From TianXiang

Port Scanner & Banner Identify From TianXiang

TXPortMap Port Scanner & Banner Identify From TianXiang ./TxPortMap -h 新增加彩色文字输出格式 对http/https协议进行title以及报文长度打印,获取title失败打印报文前20字节 新增日志文件以及扫描结果文件 T

Jan 5, 2023

A port scanner written in go

GoScanner A poor mans port scanner written in go Why? To help learn go Try and build something "somewhat" functional from the command line 🤷 To not s

Sep 15, 2021
Comments
  • Fixed wait group calls

    Fixed wait group calls

    I fixed a few of the wait group calls, here are the problems I noticed.

    tl;dr There may just be a fundamental misunderstanding of wait groups here, the general idea is that wait groups are meant to synchronize the lifetimes of go-routines, they should not be coupled with, or coordinate values on channels which is how they're currently being used.


    You were incrementing the wait group for every iteration of the for loop here, even though you weren't spawning any go-routines. You were calling wg.Done once at the end.

    	go func() {
    		for i := *argPortStart; i <= *argPortEnd; i++ {
    			targetHost := fmt.Sprintf("%s:%d", *argHost, i)
    			wg.Add(1)
    			portsChan <- targetHost
    		}
    		wg.Done()
    		close(portsChan)
    	}()
    

    I changed it to this

            wg.Add(1)
    	go func() {
    		defer wg.Done()
    		for i := *argPortStart; i <= *argPortEnd; i++ {
    			targetHost := fmt.Sprintf("%s:%d", *argHost, i)
    			portsChan <- targetHost
    		}
    		close(portsChan)
    	}()
    

    In the following snippet, you were spawning go-routines that you wanted to wait for, but you were not incrementing the wait-group. Instead, you were calling wg.Done for each value in the channel.

    	// Consuming events
    	for i := 0; i <= *argThreadsNum; i++ {
    		go portScanner(portsChan, resChan, &wg)
    	}
    

    I changed it to this

    	for i := 0; i <= *argThreadsNum; i++ {
    		wg.Add(1)
    		go portScanner(portsChan, resChan, &wg)
    	}
            // ...
    	func portScanner(portsChan, resChan chan string, wg *sync.WaitGroup) {
    		defer wg.Done()
    		for targetHost := range portsChan {
    			_, err := net.DialTimeout("tcp", targetHost, time.Millisecond*300)
    			if err == nil {
    				resChan <- targetHost
    			}
    		}
    	}
    

    There may just be a fundamental misunderstanding of wait groups here, the general idea is that wait groups are meant to synchronize the lifetimes of go-routines, they should not be coupled with values on channels.

  • Fixed a critical application non-exit bug

    Fixed a critical application non-exit bug

    • Fixed a CRITICAL bug where the application wouldn't quit due to a misalignment of the wait groups.
    • Removed the use of channels, as it wasn't actually required, and was potentially causing minimal channel sending/receiving contention.
    • Refactored the goroutine spawning code.
    • Fixed a README typo.
  • Check for invalid hostname on startup

    Check for invalid hostname on startup

    • Now checks for invalid hostname on startup, shows an error message, and exits with exit status code 1, if the hostname does not resolve to an IP.
    • Refactored function names.
    • Added tests. Now up to 12% code coverage.
  • Numerous improvements and some recommendations

    Numerous improvements and some recommendations

    Improvements:

    • Renamed FGPLS.go to main.go, as it's always easier for developers to see a main.go then to have to search through .go files to search for 'func main()'.
    • Corrected the go.mod module import designation from 'v1' to 'github.com/0xCC00FFEE/FGLPS'. For future reference, a project name of 'fglps' is preferred, per Go naming recommendations.
    • Removed the "Contribution" section.
    • Removed the "Who do I talk to?" section.
    • Add .gitignore file
    • Converted single letter flags into spelled out flag names.
    • Added a flag for portTimeout.
    • Added input validation for all of the Int based CLI flags.
    • Added ERROR output for all flags evaluated in a single pass.
    • Set the default port scanning timeout to 5 seconds, which helps when port scanning hosts on the other side of the world.
    • Set the default threads to 65535 to support 100% parallel execution for the fastest completion times possible. This was previously set to 4.
    • resChan -> resultsChan
    • Added input validation to prevent the lastPort from being less than the firstPort.
    • Added a goroutine spawn limiter to spawn the lesser of the number of ports to scan and the number of threads to spawn, to eliminate CPU waste.
    • Changed default lastPort flag from 100 to 65535.
    • Updated readme.
    • Added JetBrains GoLand to .gitignore

    Recommendations:

    • Rename the project to "Fast Port Scanner", leaving out the "GoLang" portion, as it is a generic port scanner, and not one that is specific to only scanning Go ports, nor is it important to state the name of the language the application is written in, in the application name.
    • While this may be your first serious project in GoLang, refrain from using "GoLang", "Go" is preferred.
    • Any users of your application code, aren't interested in your background, but are definitely interested in what the application does and how to use it. Focus on that instead.
Related tags
TCP Port Scanner in GO lang

Port-Scanner-GO Simple TCP port scanner in golang. Installation & Build You have to have GO version 1.13 run: go build port-scanner-go.go Run single

Jun 6, 2022
A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection.
A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection.

aScan A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection. Fu

Aug 15, 2022
🚥 Yet another pinger: A high-performance ICMP ping implementation build on top of BPF technology.

yap Yet-Another-Pinger: A high-performance ICMP ping implementation build on top of BPF technology. yap uses the gopacket library to receive and handl

Nov 9, 2022
Yet another SIP003 plugin for shadowsocks, based on Xray-core

Yet another SIP003 plugin for shadowsocks, based on Xray-core Build go build Usage See command line args for advanced usages.

Jan 8, 2023
Yet another codemod alternative

rnm Yet another codemod alternative. Replace all occurrences of a name to another name in your code! Features Support for different case styles See rn

Sep 28, 2022
Yet another SIP003 plugin for shadowsocks, based on v2ray

Yet another SIP003 plugin for shadowsocks, based on v2ray Build go build Alternatively, you can grab the latest nightly from Circle CI by logging into

Oct 20, 2021
Yagma - Yet Another Go Mojang API

Yagma Yet Another Go Mojang API Mojang API support While we plan on wrapping Moj

Jan 13, 2022
Kasen - Yet-another open-source CMS for scanlators

Kasen Oh no, a yet-another open-source CMS for scanlators. Anyways... The back-e

Dec 27, 2022
netscanner - TCP/UDP scanner to find open or closed ports

netscanner netscanner - TCP/UDP scanner to find open or closed ports installation you have to run this command to install the program $ go get github.

Dec 19, 2022