Skip to content

Commit

Permalink
refactoring process begins
Browse files Browse the repository at this point in the history
  • Loading branch information
nunc committed Sep 11, 2018
1 parent e409b90 commit 8948269
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ slurp-linux-amd64
slurp-macos-amd64
slurp-windows-386.exe
slurp-windows-amd64.exe
slurp.exe
slurp.exe
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
env GOOS=darwin GOARCH=amd64 go build -o slurp-macos-amd64
env GOOS=darwin GOARCH=arm64 go build -o slurp-macos-arm64
env GOOS=linux GOARCH=amd64 go build -o slurp-linux-amd64
env GOOS=windows GOARCH=386 go build -o slurp-windows-386.exe
env GOOS=windows GOARCH=386 go build -o slurp-windows-386.exe
28 changes: 15 additions & 13 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func StreamCerts() {
log.Error(err2)
}

//log.Infof("Domain: %s", domain)
log.Infof("Domain: %s", domain)
//log.Info(jq)

dQ.Put(domain)
Expand Down Expand Up @@ -225,14 +225,16 @@ func ProcessQueue() {
}

if punyCfgDomain != cn[0].(string) {
log.Infof("%s is %s (punycode); AWS does not support internationalized buckets", cn[0].(string), punyCfgDomain)
continue
err := fmt.Sprintf("%s is (punycode); AWS does not support internationalized buckets", cn[0].(string))
log.Error(err)
}

dbQ.Put(d)
}
if err == nil {
dbQ.Put(d)
}

//log.Infof("CN: %s\tDomain: %s", cn[0].(string), domain)
log.Infof("CN: %s\tDomain: %s", cn[0].(string), d)
}
}
}

Expand All @@ -246,7 +248,7 @@ func PermutateDomainRunner() {
continue
}

var d Domain = dstruct[0].(Domain)
var d = dstruct[0].(Domain)

//log.Infof("CN: %s\tDomain: %s.%s", d.CN, d.Domain, d.Suffix)

Expand All @@ -271,7 +273,7 @@ func PermutateKeywordRunner() {
continue
}

var d string = dstruct[0].(string)
var d = dstruct[0].(string)

//log.Infof("CN: %s\tDomain: %s.%s", d.CN, d.Domain, d.Suffix)

Expand All @@ -288,7 +290,7 @@ func PermutateKeywordRunner() {

// CheckPermutations runs through all permutations checking them for PUBLIC/FORBIDDEN buckets
func CheckPermutations() {
var max = runtime.NumCPU() * 10
var max = 10 * runtime.NumCPU()
sem = make(chan int, max)

for {
Expand Down Expand Up @@ -387,7 +389,7 @@ func CheckPermutations() {
}

checked = checked + 1

resp.Body.Close()
<-sem
}(dom[0].(PermutatedDomain))
}
Expand Down Expand Up @@ -618,15 +620,15 @@ func main() {
log.Info("Initializing....")
Init()

//go PrintJob()
go PrintJob()

log.Info("Starting to stream certs....")
go StreamCerts()

log.Info("Starting to process queue....")
go ProcessQueue()

//log.Info("Starting to stream certs....")
log.Info("Starting to stream certs....")
go PermutateDomainRunner()

log.Info("Starting to process permutations....")
Expand All @@ -637,7 +639,7 @@ func main() {
break
}

time.Sleep(1 * time.Second)
time.Sleep(3 * time.Second)
}
case "DOMAIN":
Init()
Expand Down

0 comments on commit 8948269

Please sign in to comment.