/
main.go
57 lines (47 loc) · 1.4 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright 2017 Jeff Foley. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package main
import (
"fmt"
"math/rand"
"os"
"time"
"github.com/OWASP/Amass/amass"
"github.com/OWASP/Amass/amass/core"
"github.com/sensepost/maltegolocal/maltegolocal"
)
func main() {
var domain string
lt := maltegolocal.ParseLocalArguments(os.Args)
domain = lt.Value
trx := maltegolocal.MaltegoTransform{}
enum := amass.NewEnumeration()
go func() {
for n := range enum.Output {
if n != nil && n.Domain == domain {
entity := trx.AddEntity("maltego.DNSName", n.Name)
switch n.Type {
case core.TypeNorm:
entity.AddProperty("Fqdn", "DNS Name", "", n.Name)
case core.TypeNS:
entity.SetType("maltego.NSRecord")
entity.AddProperty("fqdn", "NS Record", "", n.Name)
case core.TypeMX:
entity.SetType("maltego.MXRecord")
entity.AddProperty("fqdn", "MX Record", "", n.Name)
case core.TypeWeb:
entity.SetType("maltego.Website")
entity.AddProperty("fqdn", "Website", "", n.Name)
}
}
}
}()
trx.AddUIMessage("The amass transform can take a few minutes to complete.", "Inform")
// Seed the pseudo-random number generator
rand.Seed(time.Now().UTC().UnixNano())
enum.AddDomain(domain)
// Begin the enumeration process
enum.Start()
time.Sleep(2 * time.Second)
fmt.Println(trx.ReturnOutput())
}