Skip to content

Commit

Permalink
fix ssl date parsing, fix version to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesago committed Jan 29, 2019
1 parent 8b4db61 commit 91de43b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"gopkg.in/ns3777k/go-shodan.v3/shodan"
)

var version = "0.1.0"
var version = "0.2.0"

var au aurora.Aurora

Expand Down Expand Up @@ -60,8 +60,8 @@ func printHost(j int, h *shodan.HostData) {
if h.SSL != nil {
sslv := strings.Join(h.SSL.Versions, " ")
ssld := h.SSL.Certificate.Expires
t, _ := time.Parse("20060102030405Z", ssld) //20191127120000Z
fmt.Printf(" SSL: %s %s %s\n", au.Brown(sslv), t.Format("02-Jan-2006"), au.Brown(h.SSL.Certificate.Subject.CommonName))
te, _ := time.Parse("20060102150405Z", ssld) //20191127120000Z
fmt.Printf(" SSL: %s %s %s\n", au.Brown(sslv), te.Format("02-Jan-2006"), au.Brown(h.SSL.Certificate.Subject.CommonName))
}

cpe := strings.Join(h.CPE, ",")
Expand Down Expand Up @@ -181,11 +181,12 @@ func main() {

// Query
res, err := client.GetHostsForQuery(context.Background(), a)
log.Println(res.Total)
if err != nil {
fmt.Println("Error HostsForQuery:", err)
os.Exit(0)
}
log.Println(res.Total)

// Print results
for j := range res.Matches {
printHost(j, res.Matches[j])
Expand Down

0 comments on commit 91de43b

Please sign in to comment.