Skip to content

Commit

Permalink
优化进度输出, 每进行65535次扫描会在命令行解密上输出一条信息.
Browse files Browse the repository at this point in the history
  • Loading branch information
M09Ic committed Dec 7, 2022
1 parent 89066cb commit ad60758
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions v2/internal/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ func DefaultMod(targets interface{}, config Config) {
}

func SmartMod(target *ipcs.CIDR, config Config) {
// 输出预估时间
spended := guessSmartTime(target, config)
Log.Importantf("Spraying %s with %s, Estimated to take %d seconds", target, config.Mod, spended)

// 初始化mask
var mask int
switch config.Mod {
Expand All @@ -112,7 +108,8 @@ func SmartMod(target *ipcs.CIDR, config Config) {
config.PortProbeList = []string{DefaultSmartPortProbe}
}
}

spended := guessSmartTime(target, config)
Log.Importantf("Spraying %s with %s, Estimated to take %d seconds", target, config.Mod, spended)
var wg sync.WaitGroup

//var ipChannel chan string
Expand Down
5 changes: 4 additions & 1 deletion v2/internal/core/generator.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package core

import (
"github.com/chainreactors/gogo/v2/internal/plugin"
. "github.com/chainreactors/gogo/v2/pkg"
"github.com/chainreactors/ipcs"
. "github.com/chainreactors/logs"
Expand All @@ -23,7 +24,6 @@ type IpGenerator struct {
ch chan string
alivedMap *sync.Map
ipProbe []uint
//excludeIP map[uint]bool
}

func (gen *IpGenerator) defaultIpGenerator(cidr *ipcs.CIDR) {
Expand Down Expand Up @@ -120,6 +120,9 @@ func (gen *targetGenerator) genFromDefault(cidrs ipcs.CIDRs, portlist []string)
for ip := range ch {
for _, port := range portlist {
gen.ch <- targetConfig{ip: ip, port: port, hosts: gen.hostsMap[ip]}
if plugin.RunOpt.Sum%65535 == 0 {
Log.Importantf("Current processing %s:%s, number: %d", ip, port, plugin.RunOpt.Sum)
}
}
}
if cidr.Count() > 1 {
Expand Down

0 comments on commit ad60758

Please sign in to comment.