Skip to content

Commit 8c6361c

Browse files
committed
removed the db subcommand now found in oam_subs
1 parent 87f73be commit 8c6361c

File tree

3 files changed

+1
-331
lines changed

3 files changed

+1
-331
lines changed

cmd/amass/db.go

Lines changed: 0 additions & 270 deletions
This file was deleted.

cmd/amass/help.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ func runHelpCommand(clArgs []string) {
1919
return
2020
}
2121
switch clArgs[0] {
22-
case "db":
23-
runDBCommand(help)
2422
case "enum":
2523
runEnumCommand(help)
2624
case "intel":

cmd/amass/main.go

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,23 @@ package main
2424

2525
import (
2626
"bytes"
27-
"context"
2827
"flag"
2928
"fmt"
3029
"net"
3130
"os"
3231
"path"
33-
"path/filepath"
34-
"strings"
35-
"time"
3632

37-
"github.com/caffix/netmap"
3833
"github.com/caffix/service"
39-
"github.com/caffix/stringset"
4034
"github.com/fatih/color"
4135
"github.com/owasp-amass/amass/v4/datasrcs"
4236
"github.com/owasp-amass/amass/v4/format"
4337
amassnet "github.com/owasp-amass/amass/v4/net"
44-
"github.com/owasp-amass/amass/v4/requests"
4538
"github.com/owasp-amass/amass/v4/systems"
4639
"github.com/owasp-amass/config/config"
4740
)
4841

4942
const (
50-
mainUsageMsg = "intel|enum|db [options]"
43+
mainUsageMsg = "intel|enum [options]"
5144
exampleConfigFileURL = "https://github.com/owasp-amass/amass/blob/master/examples/config.yaml"
5245
userGuideURL = "https://github.com/owasp-amass/amass/blob/master/doc/user_guide.md"
5346
tutorialURL = "https://github.com/owasp-amass/amass/blob/master/doc/tutorial.md"
@@ -76,7 +69,6 @@ func commandUsage(msg string, cmdFlagSet *flag.FlagSet, errBuf *bytes.Buffer) {
7669
g.Fprintf(color.Error, "\nSubcommands: \n\n")
7770
g.Fprintf(color.Error, "\t%-11s - Discover targets for enumerations\n", "amass intel")
7871
g.Fprintf(color.Error, "\t%-11s - Perform enumerations and network mapping\n", "amass enum")
79-
g.Fprintf(color.Error, "\t%-11s - Manipulate the Amass graph database\n", "amass db")
8072
}
8173

8274
g.Fprintln(color.Error)
@@ -114,8 +106,6 @@ func main() {
114106
}
115107

116108
switch os.Args[1] {
117-
case "db":
118-
runDBCommand(os.Args[2:])
119109
case "enum":
120110
runEnumCommand(os.Args[2:])
121111
case "intel":
@@ -190,54 +180,6 @@ func createOutputDirectory(cfg *config.Config) {
190180
}
191181
}
192182

193-
func openGraphDatabase(dir string, cfg *config.Config) *netmap.Graph {
194-
// Add the local database settings to the configuration
195-
cfg.GraphDBs = append(cfg.GraphDBs, cfg.LocalDatabaseSettings(cfg.GraphDBs))
196-
197-
for _, db := range cfg.GraphDBs {
198-
if db.Primary {
199-
var g *netmap.Graph
200-
201-
if db.System == "local" {
202-
g = netmap.NewGraph(db.System, filepath.Join(config.OutputDirectory(cfg.Dir), "amass.sqlite"), db.Options)
203-
} else {
204-
connStr := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s", db.Host, db.Port, db.Username, db.Password, db.DBName)
205-
g = netmap.NewGraph(db.System, connStr, db.Options)
206-
}
207-
208-
if g != nil {
209-
return g
210-
}
211-
break
212-
}
213-
}
214-
215-
return netmap.NewGraph("memory", "", "")
216-
}
217-
218-
func getEventOutput(ctx context.Context, domains []string, asninfo bool, db *netmap.Graph, cache *requests.ASNCache) []*requests.Output {
219-
filter := stringset.New()
220-
defer filter.Close()
221-
222-
return EventOutput(ctx, db, domains, time.Time{}, filter, asninfo, cache)
223-
}
224-
225-
func domainNameInScope(name string, scope []string) bool {
226-
var discovered bool
227-
228-
n := strings.ToLower(strings.TrimSpace(name))
229-
for _, d := range scope {
230-
d = strings.ToLower(d)
231-
232-
if n == d || strings.HasSuffix(n, "."+d) {
233-
discovered = true
234-
break
235-
}
236-
}
237-
238-
return discovered
239-
}
240-
241183
func assignNetInterface(iface *net.Interface) error {
242184
addrs, err := iface.Addrs()
243185
if err != nil {

0 commit comments

Comments
 (0)