Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions sslScrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

def banner():
#Our banner, doubled slashes added for proper formatting when banner is shown in STDOUT.
print "-" * 70
print """
print ("-" * 70)
print ("""

_________ _________.____ _________
/ _____// _____/| | / _____/ ________________ ______ ____
Expand All @@ -16,10 +16,11 @@ def banner():
SSLScrape | A scanning tool for scaping hostnames from SSL certificates.
Written by Peter Kim <Author, The Hacker Playbook> and @bbuerhaus
<CEO, Secure Planet LLC>
"""
print "Usage | python sslScrape.py [CIDR Range]"
print "E.X | python sslScrape.py 10.100.100.0/24"
print "-" * 70
""")
print (" Use pip3 install python-masscan, ndg-httpsclient")
print ("Usage | python3 sslScrape.py [CIDR Range]")
print ("E.X | python3 sslScrape.py 10.100.100.0/24")
print ("-" * 70)


import sys, socket, ssl, requests, ipaddress
Expand All @@ -31,8 +32,8 @@ def banner():
import masscan, errno, os, signal
from functools import wraps

#pip install ndg-httpsclient
#pip install python-masscan
#pip3 install ndg-httpsclient
#pip3 install python-masscan
class TimeoutError(Exception):
pass

Expand Down Expand Up @@ -91,7 +92,7 @@ def getDomainFromCert(ipAddr, port = 443):
return alt
except:
# failed, just save the CN instead
print "asdf"
print ("asdf")
return [name]

except:
Expand Down Expand Up @@ -130,7 +131,7 @@ def callback(conn, cert, errno, depth, result):
for host in mas.all_hosts:
host = str(host)
try:
print host + ":" + ",".join(getDomainFromCert(host))
print (host + ":" + ",".join(getDomainFromCert(host)))
except:
print host + ":fail"
print (host + ":fail")