diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9ebf1..df6b0f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +### v1.1.1 + 新特征: + 1. 扫描进度信息中追加了估算剩余时间信息 + + 增强: + 1. 增加默认端口: 1024,6868,8182,9080,9999 + + 修复: + 1. 修复使用 `-p xx` 时,不会覆盖默认端口的逻辑问题 + ### v1.1.0 概述: 主要为自动消除 TCP 无意义的扫描,提升扫描速度 @@ -18,7 +28,7 @@ 3. 对位置的错误情况,添加了更详细的错误输出,便于调试 4. 增强扫描结束后统计的数据显示 5. 降低了耗时统计的时间单位精确度 - 6. 对端口列表进行去重处理 + 6. 对端口列表进行去重处理 7. 对端口随机后还是会优先探测常用端口列表 (Targets:Ports 则常用端口交集), 从而提高自动放弃扫描机制可靠性 修复: diff --git a/README.md b/README.md index 9d29843..2edf039 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Version -1.1.0 - [版本修改日志](CHANGELOG.md) +1.1.1 - [版本修改日志](CHANGELOG.md) @@ -35,7 +35,7 @@ $ ./mx1014 10010000000011.1110000001.111.111......1111111111111111.......... 10twelve0111... .10001. .. 100011... 1001 MX1014 by L - .001 1001 Version 1.1.0 + .001 1001 Version 1.1.1 .1. ...1. diff --git a/mx1014.go b/mx1014.go index ffdbd38..6e5aca3 100644 --- a/mx1014.go +++ b/mx1014.go @@ -28,6 +28,14 @@ func ErrPrint(msg string) { os.Exit(1) } +func secondToTime(second int) string { + minute := second / 60 + if minute == 0 { + return fmt.Sprintf("%ds", second) + }else{ + return fmt.Sprintf("%dm%ds", minute, second % 60) + } +} func Shuffle(vals []string) []string { r := rand.New(rand.NewSource(time.Now().Unix())) @@ -290,10 +298,12 @@ func portScan(targets []Target, dports []string) int { go func() { for { time.Sleep(time.Second * time.Duration(progressDelay)) - rate := doneCount * 100.0 / total + rate := float64(doneCount) * 100 / float64(total) second := time.Since(startTime).Seconds() pps := float64(doneCount) / second - log.Printf("# Progress (%d/%d) open: %d, pps: %.0f, rate: %d%%\n", doneCount, total, openCount, pps, rate) + remaining := second * 100 / float64(rate) - second + remainingTime := secondToTime(int(remaining)) + log.Printf("# Progress (%d/%d) open: %d, pps: %.0f, rate: %0.f%% (RD %s)\n", doneCount, total, openCount, pps, rate, remainingTime) } }() @@ -401,7 +411,7 @@ var ( startTime time.Time targetFilterCount = make(map[string]int) - rawCommonPorts = "22,80,81,82,88,89,135,137,138,139,389,443,445,1080,1433,1521,3128,3308,3389,4430,4433,4560,5432,5800,5900,5985,5986,6379,6588,7001,7002,8000,8001,8002,8009,8161,8080,8081,8082,8090,9000,9090,9043,9060,9200,9875,8443,8880,8888" + rawCommonPorts = "22,80,81,82,88,89,135,137,138,139,389,443,445,1024,1080,1433,1521,3128,3308,3389,4430,4433,4560,5432,5800,5900,5985,5986,6379,6588,6868,7001,7002,8000,8001,8002,8009,8182,8161,8080,8081,8082,8090,8443,8880,8888,9000,9090,9043,9060,9200,9080,9875,9999" commonPorts = ParsePortRange(rawCommonPorts) ) @@ -415,7 +425,7 @@ func usage() { 10010000000011.1110000001.111.111......1111111111111111.......... 10twelve0111... .10001. .. 100011... 1001 MX1014 by L - .001 1001 Version 1.1.0 + .001 1001 Version 1.1.1 .1. ...1. @@ -474,7 +484,6 @@ func main() { if !order { defaultPorts = Shuffle(defaultPorts) } - defaultPorts = append(commonPorts, defaultPorts...) defaultPorts = RemoveRepeatedElement(defaultPorts) defaultPortsLen = len(defaultPorts)