| 312 | } |
| 313 | |
| 314 | func (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 | |
| 344 | func (m *DatabasesModule) getRdsClustersPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Database) { |
| 345 | defer func() { |