| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 38541b0 commit 5ed106e
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,6 +223,7 @@ | |||
| 223 | 223 | "--replicate": "use '--dump-format=SQLITE' instead", | |
| 224 | 224 | "--no-unescape": "use '--no-escape' instead", | |
| 225 | 225 | "--binary": "use '--binary-fields' instead", | |
| 226 | + "--auth-private": "use '--auth-file' instead", | ||
| 226 | 227 | "--check-payload": None, | |
| 227 | 228 | "--check-waf": None, | |
| 228 | 229 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1264,13 +1264,13 @@ def _setHTTPAuthentication(): | |||
| 1264 | 1264 | ||
| 1265 | 1265 | global authHandler | |
| 1266 | 1266 | ||
| 1267 | - if not conf.authType and not conf.authCred and not conf.authPrivate: | ||
| 1267 | + if not conf.authType and not conf.authCred and not conf.authFile: | ||
| 1268 | 1268 | return | |
| 1269 | 1269 | ||
| 1270 | - if conf.authPrivate and not conf.authType: | ||
| 1270 | + if conf.authFile and not conf.authType: | ||
| 1271 | 1271 | conf.authType = AUTH_TYPE.PKI | |
| 1272 | 1272 | ||
| 1273 | - elif conf.authType and not conf.authCred and not conf.authPrivate: | ||
| 1273 | + elif conf.authType and not conf.authCred and not conf.authFile: | ||
| 1274 | 1274 | errMsg = "you specified the HTTP authentication type, but " | |
| 1275 | 1275 | errMsg += "did not provide the credentials" | |
| 1276 | 1276 | raise SqlmapSyntaxException(errMsg) | |
@@ -1285,7 +1285,7 @@ def _setHTTPAuthentication(): | |||
| 1285 | 1285 | errMsg += "Basic, Digest, NTLM or PKI" | |
| 1286 | 1286 | raise SqlmapSyntaxException(errMsg) | |
| 1287 | 1287 | ||
| 1288 | - if not conf.authPrivate: | ||
| 1288 | + if not conf.authFile: | ||
| 1289 | 1289 | debugMsg = "setting the HTTP authentication type and credentials" | |
| 1290 | 1290 | logger.debug(debugMsg) | |
| 1291 | 1291 | ||
@@ -1336,7 +1336,7 @@ def _setHTTPAuthentication(): | |||
| 1336 | 1336 | debugMsg = "setting the HTTP(s) authentication PEM private key" | |
| 1337 | 1337 | logger.debug(debugMsg) | |
| 1338 | 1338 | ||
| 1339 | - _ = safeExpandUser(conf.authPrivate) | ||
| 1339 | + _ = safeExpandUser(conf.authFile) | ||
| 1340 | 1340 | checkFile(_) | |
| 1341 | 1341 | authHandler = HTTPSPKIAuthHandler(_) | |
| 1342 | 1342 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ | |||
| 37 | 37 | "headers": "string", | |
| 38 | 38 | "authType": "string", | |
| 39 | 39 | "authCred": "string", | |
| 40 | - "authPrivate": "string", | ||
| 40 | + "authFile": "string", | ||
| 41 | 41 | "proxy": "string", | |
| 42 | 42 | "proxyCred": "string", | |
| 43 | 43 | "proxyFile": "string", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -144,8 +144,8 @@ def cmdLineParser(argv=None): | |||
| 144 | 144 | help="HTTP authentication credentials " | |
| 145 | 145 | "(name:password)") | |
| 146 | 146 | ||
| 147 | - request.add_option("--auth-private", dest="authPrivate", | ||
| 148 | - help="HTTP authentication PEM private key file") | ||
| 147 | + request.add_option("--auth-file", dest="authFile", | ||
| 148 | + help="HTTP authentication PEM cert/private key file") | ||
| 149 | 149 | ||
| 150 | 150 | request.add_option("--ignore-401", dest="ignore401", action="store_true", | |
| 151 | 151 | help="Ignore HTTP Error 401 (Unauthorized)") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,12 +11,13 @@ | |||
| 11 | 11 | from lib.core.data import conf | |
| 12 | 12 | ||
| 13 | 13 | class HTTPSPKIAuthHandler(urllib2.HTTPSHandler): | |
| 14 | - def __init__(self, key_file): | ||
| 14 | + def __init__(self, auth_file): | ||
| 15 | 15 | urllib2.HTTPSHandler.__init__(self) | |
| 16 | - self.key_file = key_file | ||
| 16 | + self.auth_file = auth_file | ||
| 17 | 17 | ||
| 18 | 18 | def https_open(self, req): | |
| 19 | 19 | return self.do_open(self.getConnection, req) | |
| 20 | 20 | ||
| 21 | 21 | def getConnection(self, host, timeout=None): | |
| 22 | - return httplib.HTTPSConnection(host, key_file=self.key_file, timeout=conf.timeout) | ||
| 22 | + # Reference: https://docs.python.org/2/library/ssl.html#ssl.SSLContext.load_cert_chain | ||
| 23 | + return httplib.HTTPSConnection(host, cert_file=self.auth_file, key_file=self.auth_file, timeout=conf.timeout) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,10 +93,10 @@ authType = | |||
| 93 | 93 | # Syntax: username:password | |
| 94 | 94 | authCred = | |
| 95 | 95 | ||
| 96 | - # HTTP Authentication PEM private key. Useful only if the target URL requires | ||
| 96 | + # HTTP Authentication PEM private/cert key file. Useful only if the target URL requires | ||
| 97 | 97 | # PKI authentication and you have such data. | |
| 98 | 98 | # Syntax: key_file | |
| 99 | - authPrivate = | ||
| 99 | + authFile = | ||
| 100 | 100 | ||
| 101 | 101 | # Use a proxy to connect to the target URL. | |
| 102 | 102 | # Syntax: (http|https|socks4|socks5)://address:port | |
| Back | FazBrowse Home | New Git URL |
0 commit comments