Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Update SSL Checker
Browse files Browse the repository at this point in the history
  • Loading branch information
aancw committed Nov 29, 2017
1 parent b8aeb74 commit 6302216
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ proxy.txt
belati.conf
beta/*
#remove comment after 0.2.3-dev
#web/web/db.sqlite3
web/web/db.sqlite3
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ Please see [CONTRIBUTORS.md](https://github.com/aancw/Belati/blob/master/CONTRIB
Thanks to PyWhois Library, Sublist3r, MailHarvester, Emingoo for being part of my code. Also thanks to Hispagatos, Infosec-ninjas, eCHo, RNDC( Research and development center ) and all other people who are inspiring this project :)
Thanks to Echo-Zine Staff for approving my Ezine : http://ezine.echo.or.id/issue31/005.txt - Belati : Collecting Public Data & Public Document for OSINT Purpose - Petruknisme
## Publications
Echo Ezine 31 : http://ezine.echo.or.id/issue31/005.txt - Belati : Collecting Public Data & Public Document for OSINT Purpose - Petruknisme
IDSECCONF 2017 : https://www.slideshare.net/idsecconf/belati-the-traditional-swiss-army-knife-for-osint - Belati: The Traditional Swiss Army Knife for OSINT
## License
Expand Down
12 changes: 11 additions & 1 deletion plugins/url_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import sys, socket
import ssl
import urllib2
import urllib2, httplib
from user_agents import UserAgents
from urlparse import urlparse
from logger import Logger
Expand Down Expand Up @@ -99,6 +99,8 @@ def header_info(self, url_request, proxy_address):
except Exception, detail:
log.console_log('ERROR {}'.format( str(detail)))
return 1
except httplib.BadStatusLine:
pass

def just_url_open(self, url_request, proxy_address):
try:
Expand Down Expand Up @@ -137,8 +139,16 @@ def ssl_checker(self, domain):
# https://stackoverflow.com/questions/27835619/ssl-certificate-verify-failed-error
gcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1) # Only for gangstars
data = urllib2.urlopen("https://{}".format(domain), timeout=25, context=gcontext)
if "ERROR" in data or "Errno" in data:
domain_fix = "http://{}".format(domain)
except urllib2.HTTPError, e:
pass
except urllib2.URLError, e:
domain_fix = "http://{}".format(domain)
except ssl.SSLError as e:
domain_fix = "http://{}".format(domain)
except httplib.BadStatusLine:
domain_fix = "http://{}".format(domain)

return domain_fix

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ beautifulsoup4
python-whois
futures
django
pyexifinfo
pyexifinfo
cmd2

0 comments on commit 6302216

Please sign in to comment.