Skip to content

Commit 2da9450

Browse files
committed
added the Aviato plugin
1 parent 6201693 commit 2da9450

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright © by Jeff Foley 2017-2025. All rights reserved.
2+
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package aviato
6+
7+
import (
8+
"errors"
9+
"time"
10+
11+
et "github.com/owasp-amass/amass/v4/engine/types"
12+
dbt "github.com/owasp-amass/asset-db/types"
13+
oam "github.com/owasp-amass/open-asset-model"
14+
"github.com/owasp-amass/open-asset-model/general"
15+
"golang.org/x/time/rate"
16+
)
17+
18+
func NewAviato() et.Plugin {
19+
limit := rate.Every(3 * time.Second)
20+
21+
return &aviato{
22+
name: "Aviato",
23+
rlimit: rate.NewLimiter(limit, 1),
24+
source: &et.Source{
25+
Name: "Aviato",
26+
Confidence: 90,
27+
},
28+
}
29+
}
30+
31+
func (a *aviato) Name() string {
32+
return a.name
33+
}
34+
35+
func (a *aviato) Start(r et.Registry) error {
36+
a.log = r.Log().WithGroup("plugin").With("name", a.name)
37+
38+
a.log.Info("Plugin started")
39+
return nil
40+
}
41+
42+
func (a *aviato) Stop() {
43+
a.log.Info("Plugin stopped")
44+
}
45+
46+
func (a *aviato) createRelation(session et.Session, obj *dbt.Entity, rel oam.Relation, subject *dbt.Entity, conf int) error {
47+
edge, err := session.Cache().CreateEdge(&dbt.Edge{
48+
Relation: rel,
49+
FromEntity: obj,
50+
ToEntity: subject,
51+
})
52+
if err != nil {
53+
return err
54+
} else if edge == nil {
55+
return errors.New("failed to create the edge")
56+
}
57+
58+
_, err = session.Cache().CreateEdgeProperty(edge, &general.SourceProperty{
59+
Source: a.source.Name,
60+
Confidence: conf,
61+
})
62+
return err
63+
}

engine/plugins/api/aviato/types.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright © by Jeff Foley 2017-2025. All rights reserved.
2+
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package aviato
6+
7+
import (
8+
"log/slog"
9+
10+
et "github.com/owasp-amass/amass/v4/engine/types"
11+
"golang.org/x/time/rate"
12+
)
13+
14+
type aviato struct {
15+
name string
16+
log *slog.Logger
17+
rlimit *rate.Limiter
18+
source *et.Source
19+
}

engine/plugins/load.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package plugins
66

77
import (
88
"github.com/owasp-amass/amass/v4/engine/plugins/api"
9+
"github.com/owasp-amass/amass/v4/engine/plugins/api/aviato"
910
"github.com/owasp-amass/amass/v4/engine/plugins/api/gleif"
1011
"github.com/owasp-amass/amass/v4/engine/plugins/api/rdap"
1112
"github.com/owasp-amass/amass/v4/engine/plugins/archive"
@@ -36,6 +37,7 @@ var pluginNewFuncs = []func() et.Plugin{
3637
api.NewVirusTotal,
3738
api.NewZetalytics,
3839
archive.NewWayback,
40+
aviato.NewAviato,
3941
bgptools.NewBGPTools,
4042
brute.NewFQDNAlterations,
4143
dns.NewDNS,

0 commit comments

Comments
 (0)