Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl error #179

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions core/zap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from core.colors import run, good
from plugins.wayback import time_machine


def zap(input_url, archive, domain, host, internal, robots, proxies):
def zap(input_url, archive, domain, host, internal, robots, proxies,verf):
response = ''
"""Extract links from robots.txt and sitemap.xml."""
if archive:
print('%s Fetching URLs from archive.org' % run)
Expand All @@ -21,8 +21,14 @@ def zap(input_url, archive, domain, host, internal, robots, proxies):
verb('Internal page', url)
internal.add(url)
# Makes request to robots.txt
response = requests.get(input_url + '/robots.txt',
proxies=random.choice(proxies)).text
try:
response = requests.get(input_url + '/robots.txt',
proxies=random.choice(proxies),
verify=verf).text
except requests.exceptions.SSLError as Error:
response = requests.get(input_url + '/robots.txt',
proxies=random.choice(proxies),
verify=verf).text
# Making sure robots.txt isn't some fancy 404 page
if '<body' not in response:
# If you know it, you know it
Expand All @@ -42,8 +48,14 @@ def zap(input_url, archive, domain, host, internal, robots, proxies):
robots.add(url)
print('%s URLs retrieved from robots.txt: %s' % (good, len(robots)))
# Makes request to sitemap.xml
response = requests.get(input_url + '/sitemap.xml',
proxies=random.choice(proxies)).text
try:
response = requests.get(input_url + '/sitemap.xml',
proxies=random.choice(proxies),
verify=verf).text
except requests.exceptions.SSLError as Error:
response = requests.get(input_url + '/sitemap.xml',
proxies=random.choice(proxies),
verify=verf).text
# Making sure robots.txt isn't some fancy 404 page
if '<body' not in response:
matches = xml_parser(response)
Expand Down
10 changes: 8 additions & 2 deletions photon.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
type=float)
parser.add_argument('-p', '--proxy', help='Proxy server IP:PORT or DOMAIN:PORT', dest='proxies',
type=proxy_type)

parser.add_argument('--no-cert', help="No check certificate", dest="certificate", action='store_true')
# Switches
parser.add_argument('--clone', help='clone the website locally', dest='clone',
action='store_true')
Expand All @@ -98,6 +98,12 @@
dest='archive', action='store_true')
args = parser.parse_args()

#check argument certificate
verf = bool
if args.certificate:
verf = False
else:
verf = True

# If the user has supplied --update argument
if args.update:
Expand Down Expand Up @@ -306,7 +312,7 @@ def jscanner(url):
then = time.time()

# Step 1. Extract urls from robots.txt & sitemap.xml
zap(main_url, args.archive, domain, host, internal, robots, proxies)
zap(main_url, args.archive, domain, host, internal, robots, proxies,verf)

# This is so the level 1 emails are parsed as well
internal = set(remove_regex(internal, args.exclude))
Expand Down