@@ -24,30 +24,23 @@ package main
24
24
25
25
import (
26
26
"bytes"
27
- "context"
28
27
"flag"
29
28
"fmt"
30
29
"net"
31
30
"os"
32
31
"path"
33
- "path/filepath"
34
- "strings"
35
- "time"
36
32
37
- "github.com/caffix/netmap"
38
33
"github.com/caffix/service"
39
- "github.com/caffix/stringset"
40
34
"github.com/fatih/color"
41
35
"github.com/owasp-amass/amass/v4/datasrcs"
42
36
"github.com/owasp-amass/amass/v4/format"
43
37
amassnet "github.com/owasp-amass/amass/v4/net"
44
- "github.com/owasp-amass/amass/v4/requests"
45
38
"github.com/owasp-amass/amass/v4/systems"
46
39
"github.com/owasp-amass/config/config"
47
40
)
48
41
49
42
const (
50
- mainUsageMsg = "intel|enum|db [options]"
43
+ mainUsageMsg = "intel|enum [options]"
51
44
exampleConfigFileURL = "https://github.com/owasp-amass/amass/blob/master/examples/config.yaml"
52
45
userGuideURL = "https://github.com/owasp-amass/amass/blob/master/doc/user_guide.md"
53
46
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) {
76
69
g .Fprintf (color .Error , "\n Subcommands: \n \n " )
77
70
g .Fprintf (color .Error , "\t %-11s - Discover targets for enumerations\n " , "amass intel" )
78
71
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" )
80
72
}
81
73
82
74
g .Fprintln (color .Error )
@@ -114,8 +106,6 @@ func main() {
114
106
}
115
107
116
108
switch os .Args [1 ] {
117
- case "db" :
118
- runDBCommand (os .Args [2 :])
119
109
case "enum" :
120
110
runEnumCommand (os .Args [2 :])
121
111
case "intel" :
@@ -190,54 +180,6 @@ func createOutputDirectory(cfg *config.Config) {
190
180
}
191
181
}
192
182
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
-
241
183
func assignNetInterface (iface * net.Interface ) error {
242
184
addrs , err := iface .Addrs ()
243
185
if err != nil {
0 commit comments