Skip to content

Commit cc2f09e

Browse files
committed
enumerations use the in-memory graph database
1 parent 8039ece commit cc2f09e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cmd/amass/enum.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ func runEnumCommand(clArgs []string) {
193193
// Expand data source category names into the associated source names
194194
initializeSourceTags(sys.DataSources())
195195
cfg.SourceFilter.Sources = expandCategoryNames(cfg.SourceFilter.Sources, generateCategoryMap(sys))
196-
197-
graph := sys.GraphDatabases()[0]
196+
// Create the in-memory graph database used to store enumeration findings
197+
graph := netmap.NewGraph(netmap.NewCayleyGraphMemory())
198+
defer graph.Close()
198199
// Setup the new enumeration
199200
e := enum.NewEnumeration(cfg, sys, graph)
200201
if e == nil {
@@ -261,7 +262,7 @@ func runEnumCommand(clArgs []string) {
261262
wg.Wait()
262263
fmt.Fprintf(color.Error, "\n%s\n", green("The enumeration has finished"))
263264
// If necessary, handle graph database migration
264-
if len(e.Sys.GraphDatabases()) > 1 {
265+
if len(e.Sys.GraphDatabases()) > 0 {
265266
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
266267
defer cancel()
267268
// Monitor for cancellation by the user
@@ -274,7 +275,7 @@ func runEnumCommand(clArgs []string) {
274275
c()
275276
}(cancel)
276277
// Copy the graph of findings into the system graph databases
277-
for _, g := range e.Sys.GraphDatabases()[1:] {
278+
for _, g := range e.Sys.GraphDatabases() {
278279
fmt.Fprintf(color.Error, "%s%s%s\n",
279280
yellow("Discoveries are being migrated into the "), yellow(g.String()), yellow(" database"))
280281

systems/local.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ func (l *LocalSystem) setupGraphDBs() error {
224224
}
225225
dbs = append(dbs, cfg.GraphDBs...)
226226

227-
if cfg.Passive {
228-
l.graphs = append(l.graphs, netmap.NewGraph(netmap.NewCayleyGraphMemory()))
229-
}
230227
for _, db := range dbs {
231228
cayley := netmap.NewCayleyGraph(db.System, db.URL, db.Options)
232229
if cayley == nil {

0 commit comments

Comments
 (0)