Skip to content

Commit 2380f67

Browse files
committed
added list option
1 parent d9912c3 commit 2380f67

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

certscan.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var parallel uint
4141
var starttls bool
4242
var sortCerts bool
4343
var savePath string
44+
var list bool
4445

4546
// domain node conection status
4647
type domainStatus int
@@ -92,6 +93,9 @@ func NewDomainNode(domain string, depth uint) *DomainNode {
9293

9394
// get the string representation of a node
9495
func (d *DomainNode) String() string {
96+
if list {
97+
return fmt.Sprintf("%s", d.Domain)
98+
}
9599
return fmt.Sprintf("%s\t%d\t%s\t%X\t%v", d.Domain, d.Depth, d.Status, d.Fingerprint, d.Neighbors)
96100
}
97101

@@ -103,6 +107,7 @@ func main() {
103107
flag.UintVar(&parallel, "parallel", 10, "number of certificates to retrieve in parallel")
104108
flag.BoolVar(&starttls, "starttls", false, "connect without TLS and then upgrade with STARTTLS for SMTP, useful with -port 25")
105109
flag.BoolVar(&sortCerts, "sort", false, "visit and print domains in sorted order")
110+
flag.BoolVar(&list, "list", false, "only print the domains found and not the entire graph")
106111
flag.StringVar(&savePath, "save", "", "save certs to folder in PEM formate")
107112
flag.Usage = func() {
108113
fmt.Fprintf(os.Stderr, "Usage of %s: [OPTION]... HOST...\n", os.Args[0])

0 commit comments

Comments
 (0)