99 "time"
1010
1111 "github.com/OWASP/Amass/amass"
12- "github.com/nu7hatch/gouuid"
12+ "github.com/OWASP/Amass/amass/core"
13+ uuid "github.com/nu7hatch/gouuid"
1314 "github.com/op/go-logging"
1415 "github.com/secureCodeBox/scanner-infrastructure-amass/ScannerScaffolding"
1516)
@@ -34,8 +35,7 @@ func createJobFailure(jobId, message, details string) ScannerScaffolding.JobFail
3435func workOnJobs (jobs <- chan ScannerScaffolding.ScanJob , results chan <- ScannerScaffolding.JobResult , failures chan <- ScannerScaffolding.JobFailure ) {
3536 for job := range jobs {
3637 logger .Infof ("Working on job '%s'" , job .JobId )
37-
38- masterOutput := make (chan * amass.Output )
38+ masterOutput := make (chan * core.Output )
3939
4040 // Seed the default pseudo-random number generator
4141 rand .Seed (time .Now ().UTC ().UnixNano ())
@@ -97,43 +97,37 @@ func workOnJobs(jobs <-chan ScannerScaffolding.ScanJob, results chan<- ScannerSc
9797 }()
9898
9999 for _ , target := range job .Targets {
100- output := make ( chan * amass.Output )
100+ enum := amass .NewEnumeration ( )
101101
102102 go func () {
103- for result := range output {
103+ for result := range enum . Output {
104104 masterOutput <- result
105105 }
106106 }()
107107
108- enum := amass .NewEnumeration ()
109-
110- enum .Output = output
111-
112108 if _ , isDebug := os .LookupEnv ("DEBUG" ); isDebug {
113109 logger .Infof ("Setting up high verbosity Logger for amass." )
114- enum .Log = log .New (os .Stdout , "amass" , log .Ldate | log .Ltime | log .Lshortfile )
110+ enum .Config . Log = log .New (os .Stdout , "amass" , log .Ldate | log .Ltime | log .Lshortfile )
115111 }
116112
117113 logger .Infof ("Job '%s' is scanning subdomains for '%s'" , job .JobId , target .Location )
118114
119- config := & amass.Config {}
120- config .AddDomain (target .Location )
115+ enum .Config .AddDomain (target .Location )
121116
122117 if _ , exists := target .Attributes ["NO_DNS" ]; exists == false {
123- config .Passive = true
118+ enum . Config .Passive = true
124119 } else {
125120 switch noDNS := target .Attributes ["NO_DNS" ].(type ) {
126121 case bool :
127- config .Passive = noDNS
122+ enum . Config .Passive = noDNS
128123 default :
129124 failures <- createJobFailure (job .JobId , "Scan Parameter 'NO_DNS' must be boolean" , "" )
130125 }
131126 }
132127
133- enum .Config = config
134-
135128 // Begin the enumeration process
136129 enum .Start ()
130+ <- enum .Done
137131 }
138132
139133 logger .Infof ("Subdomainscan '%s' found %d subdomains." , job .JobId , len (findings ))
0 commit comments