Skip to content

Commit

Permalink
removed hostname cleaning due to too many bugs, added make install
Browse files Browse the repository at this point in the history
  • Loading branch information
lanrat committed Dec 16, 2017
1 parent a061d59 commit c142ad1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ endif
fmt:
gofmt -s -w -l .

install: $(SOURCES) $(ALL_SOURCES)
go install $(BUILD_FLAGS)

clean:
rm -r certgraph build/

Expand Down
24 changes: 2 additions & 22 deletions certgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"encoding/json"
"flag"
"fmt"
"net"
"net/url"
"os"
"strings"
"sync"
Expand Down Expand Up @@ -111,7 +109,8 @@ func main() {
startDomains := make([]string, 0, 1)

for _, domain := range flag.Args() {
d := cleanHostName(strings.ToLower(domain))
d := strings.ToLower(domain)
v("cleaned", domain, d)
if len(d) > 0 {
startDomains = append(startDomains, d)
v("clean", d)
Expand Down Expand Up @@ -321,22 +320,3 @@ func visitSSL(node *graph.DomainNode) {
node.VisitedCert = certnode.Fingerprint
}
}

// sanitize the input to accept urls
func cleanHostName(host string) string {
u, err := url.Parse(host)
if err != nil {
v(err)
return ""
}
host = u.Host

if strings.Contains(host, ":") {
host, _, err = net.SplitHostPort(host)
if err != nil {
v(err)
return ""
}
}
return host
}

0 comments on commit c142ad1

Please sign in to comment.