MCPcopy Create free account
hub / github.com/BishopFox/cloudfox / writeLoot

Method writeLoot

aws/databases.go:314–342  ·  view source on GitHub ↗
(outputDirectory string, verbosity int)

Source from the content-addressed store, hash-verified

312}
313
314func (m *DatabasesModule) writeLoot(outputDirectory string, verbosity int) string {
315 path := filepath.Join(outputDirectory, "loot")
316 f := filepath.Join(path, "databases-UrlsOnly.txt")
317
318 var out string
319
320 for _, database := range m.Databases {
321 out = out + fmt.Sprintln(database.Endpoint)
322 }
323
324 // err = os.WriteFile(f, []byte(out), 0644)
325 // if err != nil {
326 // m.modLog.Error(err.Error())
327 // m.CommandCounter.IncrError()
328 // panic(err.Error())
329 // }
330
331 if verbosity > 2 {
332 fmt.Println()
333 fmt.Printf("[%s][%s] %s \n", cyan(m.output.CallingModule), cyan(m.AWSProfile), green("Feed this databases into nmap and something like gowitness/aquatone for screenshots."))
334 fmt.Print(out)
335 fmt.Printf("[%s][%s] %s \n\n", cyan(m.output.CallingModule), cyan(m.AWSProfile), green("End of loot file."))
336 }
337
338 fmt.Printf("[%s][%s] Loot written to [%s]\n", cyan(m.output.CallingModule), cyan(m.AWSProfile), f)
339
340 return out
341
342}
343
344func (m *DatabasesModule) getRdsClustersPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Database) {
345 defer func() {

Callers 1

PrintDatabasesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected