Skip to content

Instantly share code, notes, and snippets.

@se7enack
Last active April 12, 2025 19:34
Show Gist options
  • Save se7enack/047a43f7e3b14a5068e8b224d36c0664 to your computer and use it in GitHub Desktop.
Save se7enack/047a43f7e3b14a5068e8b224d36c0664 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"crypto/tls"
"fmt"
"log"
"os"
"strings"
"time"
)
func main() {
file, err := os.Open("domainlist.txt")
if err != nil {
fmt.Println("Error opening file:", err)
return
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
domain := scanner.Text()
if strings.TrimSpace(domain) != "" {
if err := scanner.Err(); err != nil {
fmt.Println("Error reading file:", err)
}
conn, err := tls.Dial("tcp", domain+":443", nil)
if err != nil {
log.Fatalf("Failed to connect: %v", err)
}
defer conn.Close()
certs := conn.ConnectionState().PeerCertificates
if len(certs) == 0 {
log.Fatal("No certificates found")
}
cert := certs[0]
expirationTime := cert.NotAfter
formattedExpirationTime := expirationTime.Format(time.DateOnly)
fmt.Printf("%v's SSL certificate expires on: %v\n", domain, formattedExpirationTime)
}
}
}
amazon.com
android.com
apple.com
azure.com
bing.com
digicert.com
dns.google
dropbox.com
epicgames.com
example.com
facebook.com
getburke.com
github.com
gmail.com
google.com
google.co.uk
icloud.com
instagram.com
ipv4ip.com
linkedin.com
live.com
microsoft.com
msn.com
netflix.com
ntp.org
nvidia.com
office.com
office365.com
opera.com
outlook.com
pinterest.com
reddit.com
roblox.com
roku.com
samsung.com
sharepoint.com
skype.com
snapchat.com
spotify.com
stackoverflow.com
tiktok.com
twitter.com
ubuntu.com
whatsapp.com
whatsapp.net
wikipedia.org
windows.com
yahoo.com
youtube.com
zoom.us
@se7enack
Copy link
Author

demo-run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment