From 149837ebf56063c09b279bc17f541d5b62ed1958 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 18 Oct 2010 09:02:56 +0000 Subject: [PATCH] added the same for proxy authorization header --- lib/core/option.py | 1 + lib/core/target.py | 1 + lib/request/connect.py | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/lib/core/option.py b/lib/core/option.py index 8d15a6484..b9a1246c3 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1070,6 +1070,7 @@ def __setKnowledgeBaseAttributes(): kb.parenthesis = None kb.partRun = None + kb.proxyAuthHeader = None kb.lastRequestUID = 0 kb.queryCounter = 0 kb.resumedQueries = {} diff --git a/lib/core/target.py b/lib/core/target.py index 59f6dd0c5..b01aa8686 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -296,6 +296,7 @@ def initTargetEnv(): kb.injType = None kb.nullConnection = None kb.parenthesis = None + kb.proxyAuthHeader = None kb.unionComment = "" kb.unionCount = None kb.unionPosition = None diff --git a/lib/request/connect.py b/lib/request/connect.py index 3a6717556..a708e9d33 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -124,6 +124,9 @@ class Connect: if kb.authHeader: headers["Authorization"] = kb.authHeader + if kb.proxyAuthHeader: + headers["Proxy-authorization"] = kb.proxyAuthHeader + if auxHeaders: for key, item in auxHeaders.items(): headers[key] = item @@ -169,6 +172,9 @@ class Connect: if req.has_header("Authorization"): kb.authHeader = req.headers["Authorization"] + if req.has_header("Proxy-authorization"): + kb.proxyAuthHeader = req.headers["Proxy-authorization"] + if hasattr(conn, "redurl") and hasattr(conn, "redcode") and not conf.redirectHandled: msg = "sqlmap got a %d redirect to " % conn.redcode msg += "%s - What target address do you " % conn.redurl