From c26d461238e9d83ebb86b22be360d641f25bfc29 Mon Sep 17 00:00:00 2001 From: caffix Date: Fri, 20 Feb 2026 01:29:55 -0500 Subject: [PATCH] updated copyright dates and small changes --- LICENSE | 2 +- README.md | 2 +- cmd/ae_isready/main.go | 4 +- cmd/amass/main.go | 2 +- cmd/amass/process.go | 2 +- cmd/amass/process_unix.go | 2 +- cmd/amass/process_windows.go | 2 +- cmd/amass_engine/main.go | 2 +- cmd/oam_assoc/main.go | 2 +- cmd/oam_i2y/ini.go | 19 +++------- cmd/oam_i2y/main.go | 2 +- cmd/oam_subs/main.go | 2 +- cmd/oam_track/main.go | 2 +- cmd/oam_viz/main.go | 2 +- config/active.go | 5 ++- config/active_test.go | 2 +- config/brute.go | 2 +- config/brute_test.go | 2 +- config/datasrcs.go | 2 +- config/datasrcs_test.go | 2 +- config/engineapi.go | 4 +- config/engineapi_test.go | 2 +- config/graphdb.go | 2 +- config/graphdb_test.go | 2 +- config/resolvers.go | 2 +- config/resolvers_test.go | 2 +- config/rigid.go | 7 ++-- config/rigid_test.go | 2 +- config/scope.go | 2 +- config/scope_test.go | 2 +- config/transform.go | 2 +- config/transform_test.go | 2 +- config/wordlist_test.go | 2 +- engine/plugins/load.go | 2 +- engine/plugins/scrape/bing.go | 9 ++++- engine/plugins/scrape/dnshistory.go | 11 ++++-- engine/plugins/scrape/duckduckgo.go | 8 +++- engine/plugins/scrape/ipverse.go | 1 + engine/plugins/scrape/rapiddns.go | 8 +++- engine/plugins/scrape/sitedossier.go | 9 ++++- engine/plugins/service_discovery/dns/txt.go | 5 ++- .../http_probes/fqdn_endpoint.go | 6 +-- engine/types/events.go | 2 +- internal/afmt/parse.go | 2 +- internal/afmt/parse_test.go | 2 +- internal/afmt/print.go | 4 +- internal/amass_engine/cli.go | 2 +- internal/assoc/cli.go | 2 +- internal/enum/cli.go | 37 ++++++++++--------- internal/net/dns/dns.go | 2 +- internal/net/dns/dns_test.go | 2 +- internal/net/http/http_test.go | 2 +- internal/net/network.go | 2 +- internal/net/network_test.go | 2 +- internal/tools/file.go | 2 +- internal/viz/d3.go | 2 +- internal/viz/dot.go | 2 +- internal/viz/dot_test.go | 2 +- internal/viz/gexf.go | 2 +- internal/viz/gexf_test.go | 2 +- internal/viz/viz_test.go | 2 +- resources/resources.go | 2 +- 62 files changed, 126 insertions(+), 105 deletions(-) diff --git a/LICENSE b/LICENSE index de25a7bb..b3c1d220 100644 --- a/LICENSE +++ b/LICENSE @@ -190,7 +190,7 @@ License: Apache2.0 same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017-2025 Jeff Foley + Copyright 2017-2026 Jeff Foley Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index c49456d1..b08ebb90 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,6 @@ If you need help with installation and/or usage of the tool, please join our [Di ## Licensing [![License](https://img.shields.io/badge/license-apache%202-blue)](https://www.apache.org/licenses/LICENSE-2.0) -This program is free software: you can redistribute it and/or modify it under the terms of the [Apache license](LICENSE). OWASP Amass and any contributions are Copyright © by Jeff Foley 2017-2025. Some subcomponents have separate licenses. +This program is free software: you can redistribute it and/or modify it under the terms of the [Apache license](LICENSE). OWASP Amass and any contributions are Copyright © by Jeff Foley 2017-2026. Some subcomponents have separate licenses. ![Network graph](https://raw.githubusercontent.com/owasp-amass/docs/master/images/network_06092018.png "Amass Network Mapping") diff --git a/cmd/ae_isready/main.go b/cmd/ae_isready/main.go index f05c7fc5..b1d007fe 100644 --- a/cmd/ae_isready/main.go +++ b/cmd/ae_isready/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -43,7 +43,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() - u := "http://" + hostname + ":4000/graphql" + u := "http://" + hostname + ":4000" if _, err := amasshttp.RequestWebPage(ctx, &amasshttp.Request{URL: u}); err != nil { // a failure to respond indicates that the server is not yet available os.Exit(1) diff --git a/cmd/amass/main.go b/cmd/amass/main.go index 20a6b335..16369abe 100644 --- a/cmd/amass/main.go +++ b/cmd/amass/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/amass/process.go b/cmd/amass/process.go index 2eeabfa8..5681723c 100644 --- a/cmd/amass/process.go +++ b/cmd/amass/process.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/amass/process_unix.go b/cmd/amass/process_unix.go index 6af3b642..04ea531b 100644 --- a/cmd/amass/process_unix.go +++ b/cmd/amass/process_unix.go @@ -1,6 +1,6 @@ //go:build !windows -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/amass/process_windows.go b/cmd/amass/process_windows.go index ca98510b..96015fee 100644 --- a/cmd/amass/process_windows.go +++ b/cmd/amass/process_windows.go @@ -1,6 +1,6 @@ //go:build windows -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/amass_engine/main.go b/cmd/amass_engine/main.go index 313bff6a..2098256d 100644 --- a/cmd/amass_engine/main.go +++ b/cmd/amass_engine/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/oam_assoc/main.go b/cmd/oam_assoc/main.go index 51b0db57..4a442539 100644 --- a/cmd/oam_assoc/main.go +++ b/cmd/oam_assoc/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/oam_i2y/ini.go b/cmd/oam_i2y/ini.go index 19718c84..59c74b9c 100644 --- a/cmd/oam_i2y/ini.go +++ b/cmd/oam_i2y/ini.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -9,6 +9,7 @@ import ( "fmt" "net" "regexp" + "slices" "strconv" "strings" "sync" @@ -356,10 +357,8 @@ func (c *Config) AddDomain(domain string) { } // Check that none of the labels are empty - for _, label := range labels { - if label == "" { - return - } + if slices.Contains(labels, "") { + return } // Check that the regular expression map has been initialized @@ -379,15 +378,7 @@ func (c *Config) AddDomain(domain string) { func uniqueIntAppend(s []int, e string) []int { if a1, err := strconv.Atoi(e); err == nil { - var found bool - - for _, a2 := range s { - if a1 == a2 { - found = true - break - } - } - if !found { + if !slices.Contains(s, a1) { s = append(s, a1) } } diff --git a/cmd/oam_i2y/main.go b/cmd/oam_i2y/main.go index 56193f85..dd633123 100644 --- a/cmd/oam_i2y/main.go +++ b/cmd/oam_i2y/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/oam_subs/main.go b/cmd/oam_subs/main.go index 35a7af01..faf53445 100644 --- a/cmd/oam_subs/main.go +++ b/cmd/oam_subs/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/oam_track/main.go b/cmd/oam_track/main.go index bfa426dc..d9e844f0 100644 --- a/cmd/oam_track/main.go +++ b/cmd/oam_track/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/cmd/oam_viz/main.go b/cmd/oam_viz/main.go index 7354925c..09700631 100644 --- a/cmd/oam_viz/main.go +++ b/cmd/oam_viz/main.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/active.go b/config/active.go index 579af9c3..ae38dee5 100644 --- a/config/active.go +++ b/config/active.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -10,7 +10,7 @@ func (c *Config) loadActiveSettings(cfg *Config) error { // Retrieve the active option from the configuration activeinterface, ok := c.Options["active"] if !ok { - // "active" not found in options, so nothing to do here. + // "active" not found in options, so nothing to do here return nil } @@ -18,6 +18,7 @@ func (c *Config) loadActiveSettings(cfg *Config) error { if !ok { return fmt.Errorf("failed to parse active setting, value is not a boolean") } + c.Active = active return nil } diff --git a/config/active_test.go b/config/active_test.go index 2ca7774b..fee3a557 100644 --- a/config/active_test.go +++ b/config/active_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/brute.go b/config/brute.go index 3d0a9d55..dd0ba0cd 100644 --- a/config/brute.go +++ b/config/brute.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/brute_test.go b/config/brute_test.go index b14d2d94..05c0efcb 100644 --- a/config/brute_test.go +++ b/config/brute_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/datasrcs.go b/config/datasrcs.go index bf8adafd..b5f083be 100644 --- a/config/datasrcs.go +++ b/config/datasrcs.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/datasrcs_test.go b/config/datasrcs_test.go index e844edb4..e5012870 100644 --- a/config/datasrcs_test.go +++ b/config/datasrcs_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/engineapi.go b/config/engineapi.go index 7723c985..56e4317b 100644 --- a/config/engineapi.go +++ b/config/engineapi.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -90,7 +90,7 @@ func (c *Config) LoadEngineEnvSettings() error { port = pEnv } eng.Port = port - path := "graphql" + path := "" if pEnv, set := os.LookupEnv(enginePath); set { path = pEnv } diff --git a/config/engineapi_test.go b/config/engineapi_test.go index d7f5c1bc..446be080 100644 --- a/config/engineapi_test.go +++ b/config/engineapi_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/graphdb.go b/config/graphdb.go index 831e9bd4..110096c7 100644 --- a/config/graphdb.go +++ b/config/graphdb.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/graphdb_test.go b/config/graphdb_test.go index ece70a8e..8fe59fb4 100644 --- a/config/graphdb_test.go +++ b/config/graphdb_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/resolvers.go b/config/resolvers.go index 0e702c90..88dbe2da 100644 --- a/config/resolvers.go +++ b/config/resolvers.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/resolvers_test.go b/config/resolvers_test.go index 79d03cdc..9abf1188 100644 --- a/config/resolvers_test.go +++ b/config/resolvers_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/rigid.go b/config/rigid.go index 32bf906f..c0186b27 100644 --- a/config/rigid.go +++ b/config/rigid.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -7,10 +7,10 @@ package config import "fmt" func (c *Config) loadRigidSettings(cfg *Config) error { - // Retrieve the rigid_boundaries option from the configuration + // retrieve the rigid_boundaries option from the configuration rigidinterface, ok := c.Options["rigid_boundaries"] if !ok { - // "rigid_boundaries" not found in options, so nothing to do here. + // "rigid_boundaries" not found in options, so nothing to do here return nil } @@ -18,6 +18,7 @@ func (c *Config) loadRigidSettings(cfg *Config) error { if !ok { return fmt.Errorf("failed to parse rigid_boundaries setting, value is not a boolean") } + c.Rigid = rigid return nil } diff --git a/config/rigid_test.go b/config/rigid_test.go index ca2afd13..36522091 100644 --- a/config/rigid_test.go +++ b/config/rigid_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/scope.go b/config/scope.go index 50b73b46..ae3b95ce 100644 --- a/config/scope.go +++ b/config/scope.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/scope_test.go b/config/scope_test.go index 21b2b616..7f27593f 100644 --- a/config/scope_test.go +++ b/config/scope_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/transform.go b/config/transform.go index e59796ba..969af64e 100644 --- a/config/transform.go +++ b/config/transform.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/transform_test.go b/config/transform_test.go index 3fb98227..6c52c55d 100644 --- a/config/transform_test.go +++ b/config/transform_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/config/wordlist_test.go b/config/wordlist_test.go index 338947b4..9eb9a4ad 100644 --- a/config/wordlist_test.go +++ b/config/wordlist_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/engine/plugins/load.go b/engine/plugins/load.go index c19f5850..00361962 100644 --- a/engine/plugins/load.go +++ b/engine/plugins/load.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/engine/plugins/scrape/bing.go b/engine/plugins/scrape/bing.go index 026de8cc..068a5654 100644 --- a/engine/plugins/scrape/bing.go +++ b/engine/plugins/scrape/bing.go @@ -55,6 +55,7 @@ func (b *bing) Start(r et.Registry) error { Plugin: b, Name: b.name + "-Handler", Position: 33, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.FQDN)}, EventType: oam.FQDN, @@ -103,8 +104,12 @@ func (b *bing) query(e *et.Event, name string) []*dbt.Entity { defer subs.Close() for i := 1; i < 10; i++ { - _ = b.rlimit.Wait(context.TODO()) - resp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: fmt.Sprintf(b.fmtstr, i, name, name)}) + _ = b.rlimit.Wait(e.Session.Ctx()) + + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + resp, err := http.RequestWebPage(ctx, &http.Request{URL: fmt.Sprintf(b.fmtstr, i, name, name)}) if err != nil || resp.Body == "" { break } diff --git a/engine/plugins/scrape/dnshistory.go b/engine/plugins/scrape/dnshistory.go index 467c50d6..6dfc6879 100644 --- a/engine/plugins/scrape/dnshistory.go +++ b/engine/plugins/scrape/dnshistory.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -55,6 +55,7 @@ func (d *dnsHistory) Start(r et.Registry) error { Plugin: d, Name: d.name + "-Handler", Position: 34, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.FQDN)}, EventType: oam.FQDN, @@ -103,8 +104,12 @@ func (d *dnsHistory) query(e *et.Event, name string) []*dbt.Entity { defer subs.Close() for i := 1; i < 20; i++ { - _ = d.rlimit.Wait(context.TODO()) - resp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: fmt.Sprintf(d.fmtstr, i, name)}) + _ = d.rlimit.Wait(e.Session.Ctx()) + + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + resp, err := http.RequestWebPage(ctx, &http.Request{URL: fmt.Sprintf(d.fmtstr, i, name)}) if err != nil || resp.Body == "" { break } diff --git a/engine/plugins/scrape/duckduckgo.go b/engine/plugins/scrape/duckduckgo.go index 960fb8af..7eaef9d6 100644 --- a/engine/plugins/scrape/duckduckgo.go +++ b/engine/plugins/scrape/duckduckgo.go @@ -55,6 +55,7 @@ func (d *duckDuckGo) Start(r et.Registry) error { Plugin: d, Name: d.name + "-Handler", Position: 35, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.FQDN)}, EventType: oam.FQDN, @@ -102,8 +103,11 @@ func (d *duckDuckGo) query(e *et.Event, name string) []*dbt.Entity { subs := stringset.New() defer subs.Close() - _ = d.rlimit.Wait(context.TODO()) - resp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: fmt.Sprintf(d.fmtstr, name, name)}) + _ = d.rlimit.Wait(e.Session.Ctx()) + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + resp, err := http.RequestWebPage(ctx, &http.Request{URL: fmt.Sprintf(d.fmtstr, name, name)}) if err != nil || resp.Body == "" { return nil } diff --git a/engine/plugins/scrape/ipverse.go b/engine/plugins/scrape/ipverse.go index 847dcc43..32e3e81b 100644 --- a/engine/plugins/scrape/ipverse.go +++ b/engine/plugins/scrape/ipverse.go @@ -56,6 +56,7 @@ func (v *ipverse) Start(r et.Registry) error { Plugin: v, Name: v.name + "-Handler", Position: 30, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.Netblock)}, EventType: oam.AutonomousSystem, diff --git a/engine/plugins/scrape/rapiddns.go b/engine/plugins/scrape/rapiddns.go index ba54c99d..f36e5c10 100644 --- a/engine/plugins/scrape/rapiddns.go +++ b/engine/plugins/scrape/rapiddns.go @@ -55,6 +55,7 @@ func (rd *rapidDNS) Start(r et.Registry) error { Plugin: rd, Name: rd.name + "-Handler", Position: 36, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.FQDN)}, EventType: oam.FQDN, @@ -102,8 +103,11 @@ func (rd *rapidDNS) query(e *et.Event, name string) []*dbt.Entity { subs := stringset.New() defer subs.Close() - _ = rd.rlimit.Wait(context.TODO()) - resp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: fmt.Sprintf(rd.fmtstr, name)}) + _ = rd.rlimit.Wait(e.Session.Ctx()) + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + resp, err := http.RequestWebPage(ctx, &http.Request{URL: fmt.Sprintf(rd.fmtstr, name)}) if err != nil || resp.Body == "" { return nil } diff --git a/engine/plugins/scrape/sitedossier.go b/engine/plugins/scrape/sitedossier.go index d45b0d5a..0740cf42 100644 --- a/engine/plugins/scrape/sitedossier.go +++ b/engine/plugins/scrape/sitedossier.go @@ -55,6 +55,7 @@ func (sd *siteDossier) Start(r et.Registry) error { Plugin: sd, Name: sd.name + "-Handler", Position: 37, + Exclusive: true, MaxInstances: support.MidHandlerInstances, Transforms: []string{string(oam.FQDN)}, EventType: oam.FQDN, @@ -103,8 +104,12 @@ func (sd *siteDossier) query(e *et.Event, name string) []*dbt.Entity { defer subs.Close() for i := 1; i < 20; i++ { - _ = sd.rlimit.Wait(context.TODO()) - resp, err := http.RequestWebPage(context.TODO(), &http.Request{URL: fmt.Sprintf(sd.fmtstr, name, i)}) + _ = sd.rlimit.Wait(e.Session.Ctx()) + + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + resp, err := http.RequestWebPage(ctx, &http.Request{URL: fmt.Sprintf(sd.fmtstr, name, i)}) if err != nil || resp.Body == "" { break } diff --git a/engine/plugins/service_discovery/dns/txt.go b/engine/plugins/service_discovery/dns/txt.go index 111b4a87..9e357afc 100644 --- a/engine/plugins/service_discovery/dns/txt.go +++ b/engine/plugins/service_discovery/dns/txt.go @@ -42,7 +42,10 @@ func (r *txtHandler) check(e *et.Event) error { func (r *txtHandler) lookup(e *et.Event, since time.Time) []string { var rdata []string - if tags, err := e.Session.DB().FindEntityTags(context.Background(), e.Entity, since, "dns_record"); err == nil { + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 10*time.Second) + defer cancel() + + if tags, err := e.Session.DB().FindEntityTags(ctx, e.Entity, since, "dns_record"); err == nil { for _, tag := range tags { if prop, ok := tag.Property.(*oamdns.DNSRecordProperty); ok && prop.Header.RRType == int(dns.TypeTXT) { rdata = append(rdata, prop.Data) diff --git a/engine/plugins/service_discovery/http_probes/fqdn_endpoint.go b/engine/plugins/service_discovery/http_probes/fqdn_endpoint.go index c7fb7042..0e559799 100644 --- a/engine/plugins/service_discovery/http_probes/fqdn_endpoint.go +++ b/engine/plugins/service_discovery/http_probes/fqdn_endpoint.go @@ -16,7 +16,7 @@ import ( dbt "github.com/owasp-amass/asset-db/types" oam "github.com/owasp-amass/open-asset-model" oamdns "github.com/owasp-amass/open-asset-model/dns" - "github.com/owasp-amass/open-asset-model/general" + oamgen "github.com/owasp-amass/open-asset-model/general" ) type fqdnEndpoint struct { @@ -68,7 +68,7 @@ func (fe *fqdnEndpoint) check(e *et.Event) error { func (fe *fqdnEndpoint) lookup(e *et.Event, host *dbt.Entity, since time.Time) []*support.Finding { var findings []*support.Finding - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(e.Session.Ctx(), 30*time.Second) defer cancel() if edges, err := e.Session.DB().OutgoingEdges(ctx, host, since); err == nil && len(edges) > 0 { @@ -76,7 +76,7 @@ func (fe *fqdnEndpoint) lookup(e *et.Event, host *dbt.Entity, since time.Time) [ if _, err := e.Session.DB().FindEdgeTags(ctx, edge, since, fe.plugin.source.Name); err != nil { continue } - if _, ok := edge.Relation.(*general.PortRelation); ok { + if _, ok := edge.Relation.(*oamgen.PortRelation); ok { if srv, err := e.Session.DB().FindEntityById(ctx, edge.ToEntity.ID); err == nil && srv != nil && srv.Asset.AssetType() == oam.Service { findings = append(findings, &support.Finding{ diff --git a/engine/types/events.go b/engine/types/events.go index a68fafed..c9d133c1 100644 --- a/engine/types/events.go +++ b/engine/types/events.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/afmt/parse.go b/internal/afmt/parse.go index daf4519a..6c270fea 100644 --- a/internal/afmt/parse.go +++ b/internal/afmt/parse.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/afmt/parse_test.go b/internal/afmt/parse_test.go index 934b54f1..c54b341b 100644 --- a/internal/afmt/parse_test.go +++ b/internal/afmt/parse_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/afmt/print.go b/internal/afmt/print.go index 38d34c35..ce9edca6 100644 --- a/internal/afmt/print.go +++ b/internal/afmt/print.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 @@ -31,7 +31,7 @@ const Banner = ` .+++:. : .+++. const ( // Version is used to display the current version of Amass. - Version = "v5.0.0" + Version = "v5.1.0" // Author is used to display the Amass Project Team. Author = "OWASP Amass Project - @owaspamass" diff --git a/internal/amass_engine/cli.go b/internal/amass_engine/cli.go index cdf73642..07da6bba 100644 --- a/internal/amass_engine/cli.go +++ b/internal/amass_engine/cli.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/assoc/cli.go b/internal/assoc/cli.go index b108b0df..e64c54ab 100644 --- a/internal/assoc/cli.go +++ b/internal/assoc/cli.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/enum/cli.go b/internal/enum/cli.go index 9de623fc..2d607915 100644 --- a/internal/enum/cli.go +++ b/internal/enum/cli.go @@ -107,7 +107,7 @@ func defineArgumentFlags(fs *flag.FlagSet, args *Args) { fs.Var(&args.Ports, "p", "Ports separated by commas (default: 80, 443)") fs.Var(args.Resolvers, "r", "IP addresses of untrusted DNS resolvers (can be used multiple times)") fs.Var(args.Resolvers, "tr", "IP addresses of trusted DNS resolvers (can be used multiple times)") - fs.IntVar(&args.Timeout, "timeout", 0, "Number of minutes to let enumeration run before quitting") + fs.IntVar(&args.Timeout, "timeout", 0, "Minutes to run without progress before terminating (Default: 30)") } func defineOptionFlags(fs *flag.FlagSet, args *Args) { @@ -236,6 +236,10 @@ func CLIWorkflow(cmdName string, clArgs []string) { } } + if args.Timeout == 0 { + args.Timeout = 30 + } + var progress *pb.ProgressBar if !args.Options.Silent { progress = pb.Start64(int64(count)) @@ -243,9 +247,11 @@ func CLIWorkflow(cmdName string, clArgs []string) { done := make(chan struct{}, 1) go func() { - var finished int + var previous, finished int t := time.NewTicker(2 * time.Second) defer t.Stop() + term := time.NewTimer(time.Duration(args.Timeout) * time.Minute) + defer term.Stop() for { select { @@ -257,14 +263,19 @@ func CLIWorkflow(cmdName string, clArgs []string) { } case <-t.C: if stats, err := c.SessionStats(token); err == nil && stats != nil { - stotal := max(count, stats.WorkItemsTotal) - scomplete := max(0, stats.WorkItemsCompleted) - if !args.Options.Silent { + stotal := max(count, stats.WorkItemsTotal) + scomplete := max(0, stats.WorkItemsCompleted) + progress.SetTotal(int64(stotal)) progress.SetCurrent(int64(scomplete)) } + if comp := stats.WorkItemsCompleted; comp != previous { + previous = comp + _ = term.Reset(time.Duration(args.Timeout)) + } + if stats.WorkItemsCompleted == stats.WorkItemsTotal { finished++ if finished == 5 { @@ -275,23 +286,13 @@ func CLIWorkflow(cmdName string, clArgs []string) { finished = 0 } } + case <-term.C: + close(done) + return } } }() - if args.Timeout > 0 { - go func() { - t := time.NewTimer(time.Minute * time.Duration(args.Timeout)) - defer t.Stop() - - select { - case <-done: - case <-t.C: - close(done) - } - }() - } - select { case <-done: case <-interrupt: diff --git a/internal/net/dns/dns.go b/internal/net/dns/dns.go index 9fe2c157..ea413460 100644 --- a/internal/net/dns/dns.go +++ b/internal/net/dns/dns.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/net/dns/dns_test.go b/internal/net/dns/dns_test.go index b888d161..543bba31 100644 --- a/internal/net/dns/dns_test.go +++ b/internal/net/dns/dns_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/net/http/http_test.go b/internal/net/http/http_test.go index 49cec9f3..51244ae2 100644 --- a/internal/net/http/http_test.go +++ b/internal/net/http/http_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/net/network.go b/internal/net/network.go index 9274398c..2eb3c06e 100644 --- a/internal/net/network.go +++ b/internal/net/network.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/net/network_test.go b/internal/net/network_test.go index 4c913dcd..81ed8c8a 100644 --- a/internal/net/network_test.go +++ b/internal/net/network_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/tools/file.go b/internal/tools/file.go index dc2d69db..b96c48fa 100644 --- a/internal/tools/file.go +++ b/internal/tools/file.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/d3.go b/internal/viz/d3.go index 77c57c17..9022a75c 100644 --- a/internal/viz/d3.go +++ b/internal/viz/d3.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/dot.go b/internal/viz/dot.go index 1ae92d9a..73d7aa35 100644 --- a/internal/viz/dot.go +++ b/internal/viz/dot.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/dot_test.go b/internal/viz/dot_test.go index b4573bc2..be23a4ed 100644 --- a/internal/viz/dot_test.go +++ b/internal/viz/dot_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/gexf.go b/internal/viz/gexf.go index 289db666..1073dc36 100644 --- a/internal/viz/gexf.go +++ b/internal/viz/gexf.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/gexf_test.go b/internal/viz/gexf_test.go index c36aa9c2..5adf8d41 100644 --- a/internal/viz/gexf_test.go +++ b/internal/viz/gexf_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/internal/viz/viz_test.go b/internal/viz/viz_test.go index c0bbd377..91700d93 100644 --- a/internal/viz/viz_test.go +++ b/internal/viz/viz_test.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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 diff --git a/resources/resources.go b/resources/resources.go index 308a9822..6afe1066 100644 --- a/resources/resources.go +++ b/resources/resources.go @@ -1,4 +1,4 @@ -// Copyright © by Jeff Foley 2017-2025. All rights reserved. +// Copyright © by Jeff Foley 2017-2026. 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