Skip to content

Commit

Permalink
updates to the enumeration pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Feb 13, 2023
1 parent 2771940 commit b073bcb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions enum/active.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © by Jeff Foley 2017-2022. All rights reserved.
// Copyright © by Jeff Foley 2017-2023. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -144,11 +144,11 @@ func (a *activeTask) crawlName(ctx context.Context, req *requests.DNSRequest, tp
protocol = "http://"
} else if strings.HasSuffix(strconv.Itoa(port), "443") {
protocol = "https://"
} else if c, err := http.TLSConn(ctx, req.Name, port); err != nil {
protocol = "http://"
} else {
} else if c, err := http.TLSConn(ctx, req.Name, port); err == nil {
c.Close()
protocol = "https://"
} else {
protocol = "http://"
}

u := protocol + req.Name + ":" + strconv.Itoa(port)
Expand Down
2 changes: 1 addition & 1 deletion enum/dns.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © by Jeff Foley 2017-2022. All rights reserved.
// Copyright © by Jeff Foley 2017-2023. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// SPDX-License-Identifier: Apache-2.0

Expand Down
8 changes: 3 additions & 5 deletions enum/input.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © by Jeff Foley 2017-2022. All rights reserved.
// Copyright © by Jeff Foley 2017-2023. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -193,8 +193,6 @@ func (r *enumSource) Next(ctx context.Context) bool {

t := time.NewTimer(waitForDuration)
defer t.Stop()
check := time.NewTicker(time.Second)
defer check.Stop()

for {
select {
Expand All @@ -212,8 +210,6 @@ func (r *enumSource) Next(ctx context.Context) bool {
t.Reset(waitForDuration)
case <-r.queue.Signal():
return true
case <-check.C:
r.fillQueue()
}
}
}
Expand Down Expand Up @@ -265,10 +261,12 @@ func (r *enumSource) fillQueue() {
}

func (r *enumSource) releaseOutput(num int) {
loop:
for i := 0; i < num; i++ {
select {
case r.release <- struct{}{}:
default:
break loop
}
}
}
Expand Down

0 comments on commit b073bcb

Please sign in to comment.