Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Added --no-check-certificate to work on untrusted certificates #1

Open
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
19 changes: 16 additions & 3 deletions deblaze.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,11 @@ class Deblaze:
methodsArray = []
gatewaysArray = []
servicesArray = []
ssl_ctx = None

def __init__ (self, url = None, service = None, method = None, creds = None, cookies = None, agent_string = None, fuzz = False):
def __init__ (self, url = None, service = None, method = None, creds = None,
cookies = None, agent_string = None, fuzz = False,
ssl_ctx = None):

self.url = url
self.service = service
Expand All @@ -709,6 +712,7 @@ def __init__ (self, url = None, service = None, method = None, creds = None, coo
self.agent_string = agent_string
self.gatewayurl = url
self.fuzz = fuzz
self.ssl_ctx = ssl_ctx


def auto(self):
Expand Down Expand Up @@ -749,7 +753,8 @@ def run(self, *params):
@return: Nothing

"""
gw = RemotingService(self.gatewayurl, user_agent=self.agent_string)
gw = RemotingService(self.gatewayurl, user_agent=self.agent_string,
ssl_ctx=self.ssl_ctx)

amf_server_debug = {
"amf": "true",
Expand Down Expand Up @@ -1147,6 +1152,7 @@ def parse_params(params):
parser.add_option("-v", "--verbose", help="Print http request/response", action="store_true")
parser.add_option("-r", "--report", help="Generate HTML report", action="store_true")
parser.add_option("-n", "--nobanner", help="Do not display banner", action="store_true")
parser.add_option("--no-check-certificate", help="Ignore invalid certificates", action="store_true", dest="noCheckCert")
parser.add_option("-q", "--quiet", help="Do not display messages", action="store_true")


Expand Down Expand Up @@ -1188,6 +1194,12 @@ def parse_params(params):
useragent = options.useragent
else:
useragent = 'PyAMF/%s' % '.'.join(map(lambda x: str(x), pyamf.__version__))

if options.noCheckCert:
import ssl
ssl_ctx = ssl._create_unverified_context()
else:
ssl_ctx = None

if options.swf:
if not os.path.isfile('swfdump'):
Expand Down Expand Up @@ -1238,7 +1250,8 @@ def parse_params(params):
sys.exit(1)

else:
d = Deblaze(options.url, options.service, options.method, options.creds, cookies, useragent, options.fuzz)
d = Deblaze(options.url, options.service, options.method, options.creds,
cookies, useragent, options.fuzz, ssl_ctx)
d.run(*params)
if options.report:
buildHTML()
Expand Down
Binary file removed pyamf/cpyamf/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/adapters/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/amf0.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/flex/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/flex/messaging.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/logging.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/remoting/__init__.pyc
Binary file not shown.
7 changes: 5 additions & 2 deletions pyamf/pyamf/remoting/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ class RemotingService(object):
"""

def __init__(self, url, amf_version=pyamf.AMF0, client_type=DEFAULT_CLIENT_TYPE,
referer=None, user_agent=DEFAULT_USER_AGENT, strict=False):
referer=None, user_agent=DEFAULT_USER_AGENT, strict=False,
ssl_ctx=None):
self.logger = logging.instance_logger(self)
self.original_url = url
self.requests = []
Expand All @@ -213,6 +214,7 @@ def __init__(self, url, amf_version=pyamf.AMF0, client_type=DEFAULT_CLIENT_TYPE,
self.headers = remoting.HeaderCollection()
self.http_headers = {}
self.strict = strict
self.ssl_ctx = ssl_ctx

self._setUrl(url)

Expand Down Expand Up @@ -254,7 +256,8 @@ def _setUrl(self, url):
if port is None:
port = httplib.HTTPS_PORT

self.connection = httplib.HTTPSConnection(hostname, port)
self.connection = httplib.HTTPSConnection(hostname, port,
context=self.ssl_ctx)
else:
raise ValueError('Unknown scheme')

Expand Down
Binary file removed pyamf/pyamf/remoting/client/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/util/__init__.pyc
Binary file not shown.
Binary file removed pyamf/pyamf/util/imports.pyc
Binary file not shown.