Skip to content

Commit

Permalink
updates required by the Amass Scripting Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Jun 10, 2020
1 parent f0ac478 commit 1f28622
Show file tree
Hide file tree
Showing 8 changed files with 583 additions and 359 deletions.
438 changes: 82 additions & 356 deletions datasrcs/script.go

Large diffs are not rendered by default.

478 changes: 478 additions & 0 deletions datasrcs/script_exports.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion enum/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (e *Enumeration) Start() error {
* discovered names that will train the machine learning system and to
* release the similar names generated by the algorithm
*/
if false && !e.Config.Passive && e.Config.Alterations {
if !e.Config.Passive && e.Config.Alterations {
e.guessMgr = NewGuessManager(e)
defer e.guessMgr.Stop()
e.managers = append(e.managers, e.guessMgr)
Expand Down
4 changes: 2 additions & 2 deletions enum/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ func (r *SubdomainManager) InputName(req *requests.DNSRequest) {

r.enum.srcsLock.Lock()
defer r.enum.srcsLock.Unlock()
// Alert all data sources to the newly discovered subdomain name
// Alert all data sources to the newly discovered resolved FQDN
for _, srv := range r.enum.Sys.DataSources() {
if r.enum.srcs.Has(srv.String()) {
srv.SubdomainDiscovered(r.enum.ctx, req, 1)
srv.Resolved(r.enum.ctx, req)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/cayleygraph/quad v1.2.4
github.com/chromedp/cdproto v0.0.0-20200424080200-0de008e41fa0 // indirect
github.com/chromedp/chromedp v0.5.3 // indirect
github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199
github.com/dghubble/go-twitter v0.0.0-20190719072343-39e5462e111f
github.com/fatih/color v1.9.0
github.com/geziyor/geziyor v0.0.0-20191212210344-cfb16fe1ee0e
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aa
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199 h1:cJ1E8ZwZLfercTX3dywnCAQDilbbi+m2cw3+8tCFpRo=
github.com/cjoudrey/gluaurl v0.0.0-20161028222611-31cbb9bef199/go.mod h1:jC+zrjHA5CaxJzn+tojIoIOzSp/6BlkRWXnMlxNkB+g=
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
Expand Down
3 changes: 3 additions & 0 deletions intel/intel.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ func (c *Collection) ReverseWhois() error {
c.Bus.Subscribe(requests.NewWhoisTopic, collect)
defer c.Bus.Unsubscribe(requests.NewWhoisTopic, collect)

c.Bus.Subscribe(requests.SetActiveTopic, c.updateLastActive)
defer c.Bus.Unsubscribe(requests.SetActiveTopic, c.updateLastActive)

// Setup the stringset of included data sources
c.srcsLock.Lock()
srcs := stringset.New()
Expand Down
14 changes: 14 additions & 0 deletions requests/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type Service interface {
DNSRequest(ctx context.Context, req *DNSRequest)
OnDNSRequest(ctx context.Context, req *DNSRequest)

// Methods to support processing of resolved FQDNs
Resolved(ctx context.Context, req *DNSRequest)
OnResolved(ctx context.Context, req *DNSRequest)

// Methods to support processing of discovered proper subdomains
SubdomainDiscovered(ctx context.Context, req *DNSRequest, times int)
OnSubdomainDiscovered(ctx context.Context, req *DNSRequest, times int)
Expand Down Expand Up @@ -172,6 +176,16 @@ func (bas *BaseService) OnDNSRequest(ctx context.Context, req *DNSRequest) {
return
}

// Resolved adds the request provided by the parameter to the service request channel.
func (bas *BaseService) Resolved(ctx context.Context, req *DNSRequest) {
bas.queueRequest(bas.service.OnResolved, ctx, req)
}

// OnResolved is called for a request that was queued via Resolved.
func (bas *BaseService) OnResolved(ctx context.Context, req *DNSRequest) {
return
}

// SubdomainDiscovered adds the request provided by the parameter to the service request channel.
func (bas *BaseService) SubdomainDiscovered(ctx context.Context, req *DNSRequest, times int) {
bas.queueRequest(bas.service.OnSubdomainDiscovered, ctx, req, times)
Expand Down

0 comments on commit 1f28622

Please sign in to comment.